=begin #MailSlurp API #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository The version of the OpenAPI document: 6.5.2 Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 =end require 'cgi' module MailSlurpClient class InboxControllerApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Create an inbox email address. An inbox has a real email address and can send and receive emails. Inboxes can be either `SMTP` or `HTTP` inboxes. # Create a new inbox and with a randomized email address to send and receive from. Pass emailAddress parameter if you wish to use a specific email address. Creating an inbox is required before sending or receiving emails. If writing tests it is recommended that you create a new inbox during each test method so that it is unique and empty. # @param [Hash] opts the optional parameters # @option opts [Boolean] :allow_team_access Grant team access to this inbox and the emails that belong to it for team members of your organization. # @option opts [String] :description Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with # @option opts [String] :email_address A custom email address to use with the inbox. Defaults to null. When null MailSlurp will assign a random email address to the inbox such as `123@mailslurp.com`. If you use the `useDomainPool` option when the email address is null it will generate an email address with a more varied domain ending such as `123@mailslurp.info` or `123@mailslurp.biz`. When a custom email address is provided the address is split into a domain and the domain is queried against your user. If you have created the domain in the MailSlurp dashboard and verified it you can use any email address that ends with the domain. Note domain types must match the inbox type - so `SMTP` inboxes will only work with `SMTP` type domains. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. # @option opts [DateTime] :expires_at Optional inbox expiration date. If null then this inbox is permanent and the emails in it won't be deleted. If an expiration date is provided or is required by your plan the inbox will be closed when the expiration time is reached. Expired inboxes still contain their emails but can no longer send or receive emails. An ExpiredInboxRecord is created when an inbox and the email address and inbox ID are recorded. The expiresAt property is a timestamp string in ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSXXX. # @option opts [Integer] :expires_in Number of milliseconds that inbox should exist for # @option opts [Boolean] :favourite Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering # @option opts [String] :inbox_type HTTP (default) or SMTP inbox type. HTTP inboxes are best for testing while SMTP inboxes are more reliable for public inbound email consumption. When using custom domains the domain type must match the inbox type. HTTP inboxes are processed by AWS SES while SMTP inboxes use a custom mail server running at `mx.mailslurp.com`. # @option opts [String] :name Optional name of the inbox. Displayed in the dashboard for easier search and used as the sender name when sending emails. # @option opts [Array] :tags Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. # @option opts [Boolean] :use_domain_pool Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default `@mailslurp.com` email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in `@mailslurp.{world,info,xyz,...}` . This means a TLD is randomly selecting from a list of `.biz`, `.info`, `.xyz` etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of `@mailslurp.com` or custom email address provided by the emailAddress field. Note this feature is only available for `HTTP` inbox types. # @return [Inbox] def create_inbox(opts = {}) data, _status_code, _headers = create_inbox_with_http_info(opts) data end # Create an inbox email address. An inbox has a real email address and can send and receive emails. Inboxes can be either `SMTP` or `HTTP` inboxes. # Create a new inbox and with a randomized email address to send and receive from. Pass emailAddress parameter if you wish to use a specific email address. Creating an inbox is required before sending or receiving emails. If writing tests it is recommended that you create a new inbox during each test method so that it is unique and empty. # @param [Hash] opts the optional parameters # @option opts [Boolean] :allow_team_access Grant team access to this inbox and the emails that belong to it for team members of your organization. # @option opts [String] :description Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with # @option opts [String] :email_address A custom email address to use with the inbox. Defaults to null. When null MailSlurp will assign a random email address to the inbox such as `123@mailslurp.com`. If you use the `useDomainPool` option when the email address is null it will generate an email address with a more varied domain ending such as `123@mailslurp.info` or `123@mailslurp.biz`. When a custom email address is provided the address is split into a domain and the domain is queried against your user. If you have created the domain in the MailSlurp dashboard and verified it you can use any email address that ends with the domain. Note domain types must match the inbox type - so `SMTP` inboxes will only work with `SMTP` type domains. Send an email to this address and the inbox will receive and store it for you. To retrieve the email use the Inbox and Email Controller endpoints with the inbox ID. # @option opts [DateTime] :expires_at Optional inbox expiration date. If null then this inbox is permanent and the emails in it won't be deleted. If an expiration date is provided or is required by your plan the inbox will be closed when the expiration time is reached. Expired inboxes still contain their emails but can no longer send or receive emails. An ExpiredInboxRecord is created when an inbox and the email address and inbox ID are recorded. The expiresAt property is a timestamp string in ISO DateTime Format yyyy-MM-dd'T'HH:mm:ss.SSSXXX. # @option opts [Integer] :expires_in Number of milliseconds that inbox should exist for # @option opts [Boolean] :favourite Is the inbox a favorite. Marking an inbox as a favorite is typically done in the dashboard for quick access or filtering # @option opts [String] :inbox_type HTTP (default) or SMTP inbox type. HTTP inboxes are best for testing while SMTP inboxes are more reliable for public inbound email consumption. When using custom domains the domain type must match the inbox type. HTTP inboxes are processed by AWS SES while SMTP inboxes use a custom mail server running at `mx.mailslurp.com`. # @option opts [String] :name Optional name of the inbox. Displayed in the dashboard for easier search and used as the sender name when sending emails. # @option opts [Array] :tags Tags that inbox has been tagged with. Tags can be added to inboxes to group different inboxes within an account. You can also search for inboxes by tag in the dashboard UI. # @option opts [Boolean] :use_domain_pool Use the MailSlurp domain name pool with this inbox when creating the email address. Defaults to null. If enabled the inbox will be an email address with a domain randomly chosen from a list of the MailSlurp domains. This is useful when the default `@mailslurp.com` email addresses used with inboxes are blocked or considered spam by a provider or receiving service. When domain pool is enabled an email address will be generated ending in `@mailslurp.{world,info,xyz,...}` . This means a TLD is randomly selecting from a list of `.biz`, `.info`, `.xyz` etc to add variance to the generated email addresses. When null or false MailSlurp uses the default behavior of `@mailslurp.com` or custom email address provided by the emailAddress field. Note this feature is only available for `HTTP` inbox types. # @return [Array<(Inbox, Integer, Hash)>] Inbox data, response status code and response headers def create_inbox_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.create_inbox ...' end allowable_values = ["HTTP_INBOX", "SMTP_INBOX"] if @api_client.config.client_side_validation && opts[:'inbox_type'] && !allowable_values.include?(opts[:'inbox_type']) fail ArgumentError, "invalid value for \"inbox_type\", must be one of #{allowable_values}" end # resource path local_var_path = '/inboxes' # query parameters query_params = opts[:query_params] || {} query_params[:'allowTeamAccess'] = opts[:'allow_team_access'] if !opts[:'allow_team_access'].nil? query_params[:'description'] = opts[:'description'] if !opts[:'description'].nil? query_params[:'emailAddress'] = opts[:'email_address'] if !opts[:'email_address'].nil? query_params[:'expiresAt'] = opts[:'expires_at'] if !opts[:'expires_at'].nil? query_params[:'expiresIn'] = opts[:'expires_in'] if !opts[:'expires_in'].nil? query_params[:'favourite'] = opts[:'favourite'] if !opts[:'favourite'].nil? query_params[:'inboxType'] = opts[:'inbox_type'] if !opts[:'inbox_type'].nil? query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? query_params[:'tags'] = @api_client.build_collection_param(opts[:'tags'], :multi) if !opts[:'tags'].nil? query_params[:'useDomainPool'] = opts[:'use_domain_pool'] if !opts[:'use_domain_pool'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Inbox' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#create_inbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create an inbox ruleset # Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving # @param inbox_id [String] inboxId # @param create_inbox_ruleset_options [CreateInboxRulesetOptions] createInboxRulesetOptions # @param [Hash] opts the optional parameters # @return [nil] def create_inbox_ruleset(inbox_id, create_inbox_ruleset_options, opts = {}) create_inbox_ruleset_with_http_info(inbox_id, create_inbox_ruleset_options, opts) nil end # Create an inbox ruleset # Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving # @param inbox_id [String] inboxId # @param create_inbox_ruleset_options [CreateInboxRulesetOptions] createInboxRulesetOptions # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def create_inbox_ruleset_with_http_info(inbox_id, create_inbox_ruleset_options, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.create_inbox_ruleset ...' end # verify the required parameter 'inbox_id' is set if @api_client.config.client_side_validation && inbox_id.nil? fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.create_inbox_ruleset" end # verify the required parameter 'create_inbox_ruleset_options' is set if @api_client.config.client_side_validation && create_inbox_ruleset_options.nil? fail ArgumentError, "Missing the required parameter 'create_inbox_ruleset_options' when calling InboxControllerApi.create_inbox_ruleset" end # resource path local_var_path = '/inboxes/{inboxId}/rulesets'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(create_inbox_ruleset_options) # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#create_inbox_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create an inbox with default options. Uses MailSlurp domain pool address and is private. # @param [Hash] opts the optional parameters # @return [Inbox] def create_inbox_with_defaults(opts = {}) data, _status_code, _headers = create_inbox_with_defaults_with_http_info(opts) data end # Create an inbox with default options. Uses MailSlurp domain pool address and is private. # @param [Hash] opts the optional parameters # @return [Array<(Inbox, Integer, Hash)>] Inbox data, response status code and response headers def create_inbox_with_defaults_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.create_inbox_with_defaults ...' end # resource path local_var_path = '/inboxes/withDefaults' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Inbox' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#create_inbox_with_defaults\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create an inbox with options. Extended options for inbox creation. # Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients. # @param create_inbox_dto [CreateInboxDto] createInboxDto # @param [Hash] opts the optional parameters # @return [Inbox] def create_inbox_with_options(create_inbox_dto, opts = {}) data, _status_code, _headers = create_inbox_with_options_with_http_info(create_inbox_dto, opts) data end # Create an inbox with options. Extended options for inbox creation. # Additional endpoint that allows inbox creation with request body options. Can be more flexible that other methods for some clients. # @param create_inbox_dto [CreateInboxDto] createInboxDto # @param [Hash] opts the optional parameters # @return [Array<(Inbox, Integer, Hash)>] Inbox data, response status code and response headers def create_inbox_with_options_with_http_info(create_inbox_dto, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.create_inbox_with_options ...' end # verify the required parameter 'create_inbox_dto' is set if @api_client.config.client_side_validation && create_inbox_dto.nil? fail ArgumentError, "Missing the required parameter 'create_inbox_dto' when calling InboxControllerApi.create_inbox_with_options" end # resource path local_var_path = '/inboxes/withOptions' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(create_inbox_dto) # return_type return_type = opts[:return_type] || 'Inbox' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#create_inbox_with_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete all inboxes # Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have. # @param [Hash] opts the optional parameters # @return [nil] def delete_all_inboxes(opts = {}) delete_all_inboxes_with_http_info(opts) nil end # Delete all inboxes # Permanently delete all inboxes and associated email addresses. This will also delete all emails within the inboxes. Be careful as inboxes cannot be recovered once deleted. Note: deleting inboxes will not impact your usage limits. Monthly inbox creation limits are based on how many inboxes were created in the last 30 days, not how many inboxes you currently have. # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_all_inboxes_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.delete_all_inboxes ...' end # resource path local_var_path = '/inboxes' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#delete_all_inboxes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete inbox # Permanently delete an inbox and associated email address as well as all emails within the given inbox. This action cannot be undone. Note: deleting an inbox will not affect your account usage. Monthly inbox usage is based on how many inboxes you create within 30 days, not how many exist at time of request. # @param inbox_id [String] inboxId # @param [Hash] opts the optional parameters # @return [nil] def delete_inbox(inbox_id, opts = {}) delete_inbox_with_http_info(inbox_id, opts) nil end # Delete inbox # Permanently delete an inbox and associated email address as well as all emails within the given inbox. This action cannot be undone. Note: deleting an inbox will not affect your account usage. Monthly inbox usage is based on how many inboxes you create within 30 days, not how many exist at time of request. # @param inbox_id [String] inboxId # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_inbox_with_http_info(inbox_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.delete_inbox ...' end # verify the required parameter 'inbox_id' is set if @api_client.config.client_side_validation && inbox_id.nil? fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.delete_inbox" end # resource path local_var_path = '/inboxes/{inboxId}'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#delete_inbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List All Inboxes Paginated # List inboxes in paginated form. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). You Can also filter by whether an inbox is favorited or use email address pattern. This method is the recommended way to query inboxes. The alternative `getInboxes` method returns a full list of inboxes but is limited to 100 results. Results do not include team access inboxes by default. Use organization method to list team inboxes or set `teamAccess` to true. # @param [Hash] opts the optional parameters # @option opts [Boolean] :favourite Optionally filter results for favourites only (default to false) # @option opts [Integer] :page Optional page index in list pagination (default to 0) # @option opts [String] :search Optionally filter by search words partial matching ID, tags, name, and email address # @option opts [Integer] :size Optional page size in list pagination (default to 20) # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC') # @option opts [String] :tag Optionally filter by tags. Will return inboxes that include given tags # @option opts [Boolean] :team_access Optionally filter by team access. Defaults to false so organization inboxes are not included (default to false) # @return [PageInboxProjection] def get_all_inboxes(opts = {}) data, _status_code, _headers = get_all_inboxes_with_http_info(opts) data end # List All Inboxes Paginated # List inboxes in paginated form. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). You Can also filter by whether an inbox is favorited or use email address pattern. This method is the recommended way to query inboxes. The alternative `getInboxes` method returns a full list of inboxes but is limited to 100 results. Results do not include team access inboxes by default. Use organization method to list team inboxes or set `teamAccess` to true. # @param [Hash] opts the optional parameters # @option opts [Boolean] :favourite Optionally filter results for favourites only # @option opts [Integer] :page Optional page index in list pagination # @option opts [String] :search Optionally filter by search words partial matching ID, tags, name, and email address # @option opts [Integer] :size Optional page size in list pagination # @option opts [String] :sort Optional createdAt sort direction ASC or DESC # @option opts [String] :tag Optionally filter by tags. Will return inboxes that include given tags # @option opts [Boolean] :team_access Optionally filter by team access. Defaults to false so organization inboxes are not included # @return [Array<(PageInboxProjection, Integer, Hash)>] PageInboxProjection data, response status code and response headers def get_all_inboxes_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_all_inboxes ...' end allowable_values = ["ASC", "DESC"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/inboxes/paginated' # query parameters query_params = opts[:query_params] || {} query_params[:'favourite'] = opts[:'favourite'] if !opts[:'favourite'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil? query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil? query_params[:'teamAccess'] = opts[:'team_access'] if !opts[:'team_access'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PageInboxProjection' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#get_all_inboxes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead. # List emails that an inbox has received. Only emails that are sent to the inbox's email address will appear in the inbox. It may take several seconds for any email you send to an inbox's email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the `minCount` parameter. The server will retry the inbox database until the `minCount` is satisfied or the `retryTimeout` is reached # @param inbox_id [String] Id of inbox that emails belongs to # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Limit the result set, ordered by received date time sort direction. Maximum 100. For more listing options see the email controller # @option opts [Integer] :min_count Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached. # @option opts [Integer] :retry_timeout Maximum milliseconds to spend retrying inbox database until minCount emails are returned # @option opts [DateTime] :since Exclude emails received before this ISO 8601 date time # @option opts [Integer] :size Alias for limit. Assessed first before assessing any passed limit. # @option opts [String] :sort Sort the results by received date and direction ASC or DESC # @return [Array] def get_emails(inbox_id, opts = {}) data, _status_code, _headers = get_emails_with_http_info(inbox_id, opts) data end # Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead. # List emails that an inbox has received. Only emails that are sent to the inbox's email address will appear in the inbox. It may take several seconds for any email you send to an inbox's email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the `minCount` parameter. The server will retry the inbox database until the `minCount` is satisfied or the `retryTimeout` is reached # @param inbox_id [String] Id of inbox that emails belongs to # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Limit the result set, ordered by received date time sort direction. Maximum 100. For more listing options see the email controller # @option opts [Integer] :min_count Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached. # @option opts [Integer] :retry_timeout Maximum milliseconds to spend retrying inbox database until minCount emails are returned # @option opts [DateTime] :since Exclude emails received before this ISO 8601 date time # @option opts [Integer] :size Alias for limit. Assessed first before assessing any passed limit. # @option opts [String] :sort Sort the results by received date and direction ASC or DESC # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def get_emails_with_http_info(inbox_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_emails ...' end # verify the required parameter 'inbox_id' is set if @api_client.config.client_side_validation && inbox_id.nil? fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.get_emails" end allowable_values = ["ASC", "DESC"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/inboxes/{inboxId}/emails'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'minCount'] = opts[:'min_count'] if !opts[:'min_count'].nil? query_params[:'retryTimeout'] = opts[:'retry_timeout'] if !opts[:'retry_timeout'].nil? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Array' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#get_emails\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Inbox. Returns properties of an inbox. # Returns an inbox's properties, including its email address and ID. # @param inbox_id [String] inboxId # @param [Hash] opts the optional parameters # @return [Inbox] def get_inbox(inbox_id, opts = {}) data, _status_code, _headers = get_inbox_with_http_info(inbox_id, opts) data end # Get Inbox. Returns properties of an inbox. # Returns an inbox's properties, including its email address and ID. # @param inbox_id [String] inboxId # @param [Hash] opts the optional parameters # @return [Array<(Inbox, Integer, Hash)>] Inbox data, response status code and response headers def get_inbox_with_http_info(inbox_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inbox ...' end # verify the required parameter 'inbox_id' is set if @api_client.config.client_side_validation && inbox_id.nil? fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.get_inbox" end # resource path local_var_path = '/inboxes/{inboxId}'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Inbox' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#get_inbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get inbox emails paginated # Get a paginated list of emails in an inbox. Does not hold connections open. # @param inbox_id [String] Id of inbox that emails belongs to # @param [Hash] opts the optional parameters # @option opts [Integer] :page Optional page index in inbox emails list pagination (default to 0) # @option opts [Integer] :size Optional page size in inbox emails list pagination (default to 20) # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC') # @return [PageEmailPreview] def get_inbox_emails_paginated(inbox_id, opts = {}) data, _status_code, _headers = get_inbox_emails_paginated_with_http_info(inbox_id, opts) data end # Get inbox emails paginated # Get a paginated list of emails in an inbox. Does not hold connections open. # @param inbox_id [String] Id of inbox that emails belongs to # @param [Hash] opts the optional parameters # @option opts [Integer] :page Optional page index in inbox emails list pagination # @option opts [Integer] :size Optional page size in inbox emails list pagination # @option opts [String] :sort Optional createdAt sort direction ASC or DESC # @return [Array<(PageEmailPreview, Integer, Hash)>] PageEmailPreview data, response status code and response headers def get_inbox_emails_paginated_with_http_info(inbox_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inbox_emails_paginated ...' end # verify the required parameter 'inbox_id' is set if @api_client.config.client_side_validation && inbox_id.nil? fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.get_inbox_emails_paginated" end allowable_values = ["ASC", "DESC"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/inboxes/{inboxId}/emails/paginated'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PageEmailPreview' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#get_inbox_emails_paginated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Inbox Sent Emails # Returns an inbox's sent email receipts. Call individual sent email endpoints for more details. Note for privacy reasons the full body of sent emails is never stored. An MD5 hash hex is available for comparison instead. # @param inbox_id [String] inboxId # @param [Hash] opts the optional parameters # @option opts [Integer] :page Optional page index in inbox sent email list pagination (default to 0) # @option opts [String] :search_filter Optional sent email search # @option opts [Integer] :size Optional page size in inbox sent email list pagination (default to 20) # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC') # @return [PageSentEmailProjection] def get_inbox_sent_emails(inbox_id, opts = {}) data, _status_code, _headers = get_inbox_sent_emails_with_http_info(inbox_id, opts) data end # Get Inbox Sent Emails # Returns an inbox's sent email receipts. Call individual sent email endpoints for more details. Note for privacy reasons the full body of sent emails is never stored. An MD5 hash hex is available for comparison instead. # @param inbox_id [String] inboxId # @param [Hash] opts the optional parameters # @option opts [Integer] :page Optional page index in inbox sent email list pagination # @option opts [String] :search_filter Optional sent email search # @option opts [Integer] :size Optional page size in inbox sent email list pagination # @option opts [String] :sort Optional createdAt sort direction ASC or DESC # @return [Array<(PageSentEmailProjection, Integer, Hash)>] PageSentEmailProjection data, response status code and response headers def get_inbox_sent_emails_with_http_info(inbox_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inbox_sent_emails ...' end # verify the required parameter 'inbox_id' is set if @api_client.config.client_side_validation && inbox_id.nil? fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.get_inbox_sent_emails" end allowable_values = ["ASC", "DESC"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/inboxes/{inboxId}/sent'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil? query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PageSentEmailProjection' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#get_inbox_sent_emails\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get inbox tags # Get all inbox tags # @param [Hash] opts the optional parameters # @return [Array] def get_inbox_tags(opts = {}) data, _status_code, _headers = get_inbox_tags_with_http_info(opts) data end # Get inbox tags # Get all inbox tags # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def get_inbox_tags_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inbox_tags ...' end # resource path local_var_path = '/inboxes/tags' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Array' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#get_inbox_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Inboxes and email eddresses # List the inboxes you have created. Note use of the more advanced `getAllEmails` is recommended. You can provide a limit and sort parameter. # @param [Hash] opts the optional parameters # @option opts [Integer] :size Optional result size limit. Note an automatic limit of 100 results is applied. See the paginated `getAllEmails` for larger queries. (default to 100) # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC') # @return [Array] def get_inboxes(opts = {}) data, _status_code, _headers = get_inboxes_with_http_info(opts) data end # List Inboxes and email eddresses # List the inboxes you have created. Note use of the more advanced `getAllEmails` is recommended. You can provide a limit and sort parameter. # @param [Hash] opts the optional parameters # @option opts [Integer] :size Optional result size limit. Note an automatic limit of 100 results is applied. See the paginated `getAllEmails` for larger queries. # @option opts [String] :sort Optional createdAt sort direction ASC or DESC # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def get_inboxes_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inboxes ...' end allowable_values = ["ASC", "DESC"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/inboxes' # query parameters query_params = opts[:query_params] || {} query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Array' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#get_inboxes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Organization Inboxes Paginated # List organization inboxes in paginated form. These are inboxes created with `allowTeamAccess` flag enabled. Organization inboxes are `readOnly` for non-admin users. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). # @param [Hash] opts the optional parameters # @option opts [Integer] :page Optional page index in list pagination (default to 0) # @option opts [String] :search_filter Optional search filter # @option opts [Integer] :size Optional page size in list pagination (default to 20) # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC') # @return [PageOrganizationInboxProjection] def get_organization_inboxes(opts = {}) data, _status_code, _headers = get_organization_inboxes_with_http_info(opts) data end # List Organization Inboxes Paginated # List organization inboxes in paginated form. These are inboxes created with `allowTeamAccess` flag enabled. Organization inboxes are `readOnly` for non-admin users. The results are available on the `content` property of the returned object. This method allows for page index (zero based), page size (how many results to return), and a sort direction (based on createdAt time). # @param [Hash] opts the optional parameters # @option opts [Integer] :page Optional page index in list pagination # @option opts [String] :search_filter Optional search filter # @option opts [Integer] :size Optional page size in list pagination # @option opts [String] :sort Optional createdAt sort direction ASC or DESC # @return [Array<(PageOrganizationInboxProjection, Integer, Hash)>] PageOrganizationInboxProjection data, response status code and response headers def get_organization_inboxes_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_organization_inboxes ...' end allowable_values = ["ASC", "DESC"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/inboxes/organization' # query parameters query_params = opts[:query_params] || {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil? query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PageOrganizationInboxProjection' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#get_organization_inboxes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List inbox rulesets # List all rulesets attached to an inbox # @param inbox_id [String] inboxId # @param [Hash] opts the optional parameters # @option opts [Integer] :page Optional page index in inbox ruleset list pagination (default to 0) # @option opts [String] :search_filter Optional search filter # @option opts [Integer] :size Optional page size in inbox ruleset list pagination (default to 20) # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC') # @return [nil] def list_inbox_rulesets(inbox_id, opts = {}) list_inbox_rulesets_with_http_info(inbox_id, opts) nil end # List inbox rulesets # List all rulesets attached to an inbox # @param inbox_id [String] inboxId # @param [Hash] opts the optional parameters # @option opts [Integer] :page Optional page index in inbox ruleset list pagination # @option opts [String] :search_filter Optional search filter # @option opts [Integer] :size Optional page size in inbox ruleset list pagination # @option opts [String] :sort Optional createdAt sort direction ASC or DESC # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def list_inbox_rulesets_with_http_info(inbox_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.list_inbox_rulesets ...' end # verify the required parameter 'inbox_id' is set if @api_client.config.client_side_validation && inbox_id.nil? fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.list_inbox_rulesets" end allowable_values = ["ASC", "DESC"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/inboxes/{inboxId}/rulesets'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil? query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#list_inbox_rulesets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Send Email # Send an email from an inbox's email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox's id not the inbox's email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method `sendEmailAndConfirm`. # @param inbox_id [String] ID of the inbox you want to send the email from # @param [Hash] opts the optional parameters # @option opts [SendEmailOptions] :send_email_options Options for the email # @return [nil] def send_email(inbox_id, opts = {}) send_email_with_http_info(inbox_id, opts) nil end # Send Email # Send an email from an inbox's email address. The request body should contain the `SendEmailOptions` that include recipients, attachments, body etc. See `SendEmailOptions` for all available properties. Note the `inboxId` refers to the inbox's id not the inbox's email address. See https://www.mailslurp.com/guides/ for more information on how to send emails. This method does not return a sent email entity due to legacy reasons. To send and get a sent email as returned response use the sister method `sendEmailAndConfirm`. # @param inbox_id [String] ID of the inbox you want to send the email from # @param [Hash] opts the optional parameters # @option opts [SendEmailOptions] :send_email_options Options for the email # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def send_email_with_http_info(inbox_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.send_email ...' end # verify the required parameter 'inbox_id' is set if @api_client.config.client_side_validation && inbox_id.nil? fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.send_email" end # resource path local_var_path = '/inboxes/{inboxId}'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:'send_email_options']) # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#send_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Send email and return sent confirmation # Sister method for standard `sendEmail` method with the benefit of returning a `SentEmail` entity confirming the successful sending of the email with a link to the sent object created for it. # @param inbox_id [String] ID of the inbox you want to send the email from # @param [Hash] opts the optional parameters # @option opts [SendEmailOptions] :send_email_options Options for the email # @return [SentEmailDto] def send_email_and_confirm(inbox_id, opts = {}) data, _status_code, _headers = send_email_and_confirm_with_http_info(inbox_id, opts) data end # Send email and return sent confirmation # Sister method for standard `sendEmail` method with the benefit of returning a `SentEmail` entity confirming the successful sending of the email with a link to the sent object created for it. # @param inbox_id [String] ID of the inbox you want to send the email from # @param [Hash] opts the optional parameters # @option opts [SendEmailOptions] :send_email_options Options for the email # @return [Array<(SentEmailDto, Integer, Hash)>] SentEmailDto data, response status code and response headers def send_email_and_confirm_with_http_info(inbox_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.send_email_and_confirm ...' end # verify the required parameter 'inbox_id' is set if @api_client.config.client_side_validation && inbox_id.nil? fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.send_email_and_confirm" end # resource path local_var_path = '/inboxes/{inboxId}/confirm'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:'send_email_options']) # return_type return_type = opts[:return_type] || 'SentEmailDto' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#send_email_and_confirm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Send a test email to inbox # Send an inbox a test email to test email receiving is working # @param inbox_id [String] inboxId # @param [Hash] opts the optional parameters # @return [nil] def send_test_email(inbox_id, opts = {}) send_test_email_with_http_info(inbox_id, opts) nil end # Send a test email to inbox # Send an inbox a test email to test email receiving is working # @param inbox_id [String] inboxId # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def send_test_email_with_http_info(inbox_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.send_test_email ...' end # verify the required parameter 'inbox_id' is set if @api_client.config.client_side_validation && inbox_id.nil? fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.send_test_email" end # resource path local_var_path = '/inboxes/{inboxId}/send-test-email'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#send_test_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Set inbox favourited state # Set and return new favourite state for an inbox # @param inbox_id [String] inboxId # @param set_inbox_favourited_options [SetInboxFavouritedOptions] setInboxFavouritedOptions # @param [Hash] opts the optional parameters # @return [Inbox] def set_inbox_favourited(inbox_id, set_inbox_favourited_options, opts = {}) data, _status_code, _headers = set_inbox_favourited_with_http_info(inbox_id, set_inbox_favourited_options, opts) data end # Set inbox favourited state # Set and return new favourite state for an inbox # @param inbox_id [String] inboxId # @param set_inbox_favourited_options [SetInboxFavouritedOptions] setInboxFavouritedOptions # @param [Hash] opts the optional parameters # @return [Array<(Inbox, Integer, Hash)>] Inbox data, response status code and response headers def set_inbox_favourited_with_http_info(inbox_id, set_inbox_favourited_options, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.set_inbox_favourited ...' end # verify the required parameter 'inbox_id' is set if @api_client.config.client_side_validation && inbox_id.nil? fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.set_inbox_favourited" end # verify the required parameter 'set_inbox_favourited_options' is set if @api_client.config.client_side_validation && set_inbox_favourited_options.nil? fail ArgumentError, "Missing the required parameter 'set_inbox_favourited_options' when calling InboxControllerApi.set_inbox_favourited" end # resource path local_var_path = '/inboxes/{inboxId}/favourite'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(set_inbox_favourited_options) # return_type return_type = opts[:return_type] || 'Inbox' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#set_inbox_favourited\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Inbox. Change name and description. Email address is not editable. # Update editable fields on an inbox # @param inbox_id [String] inboxId # @param update_inbox_options [UpdateInboxOptions] updateInboxOptions # @param [Hash] opts the optional parameters # @return [Inbox] def update_inbox(inbox_id, update_inbox_options, opts = {}) data, _status_code, _headers = update_inbox_with_http_info(inbox_id, update_inbox_options, opts) data end # Update Inbox. Change name and description. Email address is not editable. # Update editable fields on an inbox # @param inbox_id [String] inboxId # @param update_inbox_options [UpdateInboxOptions] updateInboxOptions # @param [Hash] opts the optional parameters # @return [Array<(Inbox, Integer, Hash)>] Inbox data, response status code and response headers def update_inbox_with_http_info(inbox_id, update_inbox_options, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.update_inbox ...' end # verify the required parameter 'inbox_id' is set if @api_client.config.client_side_validation && inbox_id.nil? fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.update_inbox" end # verify the required parameter 'update_inbox_options' is set if @api_client.config.client_side_validation && update_inbox_options.nil? fail ArgumentError, "Missing the required parameter 'update_inbox_options' when calling InboxControllerApi.update_inbox" end # resource path local_var_path = '/inboxes/{inboxId}'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(update_inbox_options) # return_type return_type = opts[:return_type] || 'Inbox' # auth_names auth_names = opts[:auth_names] || ['API_KEY'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: InboxControllerApi#update_inbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end