=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://docs.mailslurp.com/) - [Examples](https://github.com/mailslurp/examples) repository The version of the OpenAPI document: 6.5.2 Contact: contact@mailslurp.dev 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 [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. Avoid `SMTP` inboxes if you need to send emails as they can only receive. 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 [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 [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 [String] :description Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with # @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. # @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 [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] :allow_team_access DEPRECATED (team access is always true). Grant team access to this inbox and the emails that belong to it for team members of your organization. # @option opts [String] :inbox_type HTTP (default) or SMTP inbox type. HTTP inboxes are default and best solution for most cases. SMTP inboxes are more reliable for public inbound email consumption (but do not support sending emails). 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 [Boolean] :virtual_inbox Virtual inbox prevents any outbound emails from being sent. It creates sent email records but will never send real emails to recipients. Great for testing and faking email sending. # @return [InboxDto] 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 [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. Avoid `SMTP` inboxes if you need to send emails as they can only receive. 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 [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 [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 [String] :description Optional description of the inbox for labelling purposes. Is shown in the dashboard and can be used with # @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. # @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 [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] :allow_team_access DEPRECATED (team access is always true). Grant team access to this inbox and the emails that belong to it for team members of your organization. # @option opts [String] :inbox_type HTTP (default) or SMTP inbox type. HTTP inboxes are default and best solution for most cases. SMTP inboxes are more reliable for public inbound email consumption (but do not support sending emails). 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 [Boolean] :virtual_inbox Virtual inbox prevents any outbound emails from being sent. It creates sent email records but will never send real emails to recipients. Great for testing and faking email sending. # @return [Array<(InboxDto, Integer, Hash)>] InboxDto 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[:'emailAddress'] = opts[:'email_address'] if !opts[:'email_address'].nil? query_params[:'tags'] = @api_client.build_collection_param(opts[:'tags'], :multi) if !opts[:'tags'].nil? query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? query_params[:'description'] = opts[:'description'] if !opts[:'description'].nil? query_params[:'useDomainPool'] = opts[:'use_domain_pool'] if !opts[:'use_domain_pool'].nil? query_params[:'favourite'] = opts[:'favourite'] if !opts[:'favourite'].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[:'allowTeamAccess'] = opts[:'allow_team_access'] if !opts[:'allow_team_access'].nil? query_params[:'inboxType'] = opts[:'inbox_type'] if !opts[:'inbox_type'].nil? query_params[:'virtualInbox'] = opts[:'virtual_inbox'] if !opts[:'virtual_inbox'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InboxDto' # 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] # @param [Hash] opts the optional parameters # @return [InboxRulesetDto] def create_inbox_ruleset(inbox_id, create_inbox_ruleset_options, opts = {}) data, _status_code, _headers = create_inbox_ruleset_with_http_info(inbox_id, create_inbox_ruleset_options, opts) data 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] # @param [Hash] opts the optional parameters # @return [Array<(InboxRulesetDto, Integer, Hash)>] InboxRulesetDto data, 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 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # 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] || 'InboxRulesetDto' # 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 [InboxDto] 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<(InboxDto, Integer, Hash)>] InboxDto 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(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InboxDto' # 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] # @param [Hash] opts the optional parameters # @return [InboxDto] 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] # @param [Hash] opts the optional parameters # @return [Array<(InboxDto, Integer, Hash)>] InboxDto 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(['*/*']) # 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] || 'InboxDto' # 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 emails in a given inboxes. # Deletes all emails in an inbox. Be careful as emails cannot be recovered # @param inbox_id [String] # @param [Hash] opts the optional parameters # @return [nil] def delete_all_inbox_emails(inbox_id, opts = {}) delete_all_inbox_emails_with_http_info(inbox_id, opts) nil end # Delete all emails in a given inboxes. # Deletes all emails in an inbox. Be careful as emails cannot be recovered # @param inbox_id [String] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_all_inbox_emails_with_http_info(inbox_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.delete_all_inbox_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.delete_all_inbox_emails" end # resource path local_var_path = '/inboxes/{inboxId}/deleteAllInboxEmails'.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_all_inbox_emails\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] # @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] # @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 # Does inbox exist # Check if inboxes exist by email address. Useful if you are sending emails to mailslurp addresses # @param email_address [String] Email address # @param [Hash] opts the optional parameters # @return [InboxExistsDto] def does_inbox_exist(email_address, opts = {}) data, _status_code, _headers = does_inbox_exist_with_http_info(email_address, opts) data end # Does inbox exist # Check if inboxes exist by email address. Useful if you are sending emails to mailslurp addresses # @param email_address [String] Email address # @param [Hash] opts the optional parameters # @return [Array<(InboxExistsDto, Integer, Hash)>] InboxExistsDto data, response status code and response headers def does_inbox_exist_with_http_info(email_address, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.does_inbox_exist ...' end # verify the required parameter 'email_address' is set if @api_client.config.client_side_validation && email_address.nil? fail ArgumentError, "Missing the required parameter 'email_address' when calling InboxControllerApi.does_inbox_exist" end # resource path local_var_path = '/inboxes/exists' # query parameters query_params = opts[:query_params] || {} query_params[:'emailAddress'] = email_address # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InboxExistsDto' # 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#does_inbox_exist\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Remove expired inboxes # Remove any expired inboxes for your account (instead of waiting for scheduled removal on server) # @param [Hash] opts the optional parameters # @option opts [DateTime] :before Optional expired at before flag to flush expired inboxes that have expired before the given time # @return [FlushExpiredInboxesResult] def flush_expired(opts = {}) data, _status_code, _headers = flush_expired_with_http_info(opts) data end # Remove expired inboxes # Remove any expired inboxes for your account (instead of waiting for scheduled removal on server) # @param [Hash] opts the optional parameters # @option opts [DateTime] :before Optional expired at before flag to flush expired inboxes that have expired before the given time # @return [Array<(FlushExpiredInboxesResult, Integer, Hash)>] FlushExpiredInboxesResult data, response status code and response headers def flush_expired_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.flush_expired ...' end # resource path local_var_path = '/inboxes/expired' # query parameters query_params = opts[:query_params] || {} query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'FlushExpiredInboxesResult' # 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#flush_expired\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. # @param [Hash] opts the optional parameters # @option opts [Integer] :page Optional page index in list pagination (default to 0) # @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 [Boolean] :favourite Optionally filter results for favourites only (default to false) # @option opts [String] :search Optionally filter by search words partial matching ID, tags, name, and email address # @option opts [String] :tag Optionally filter by tags. Will return inboxes that include given tags # @option opts [Boolean] :team_access DEPRECATED. Optionally filter by team access. # @option opts [DateTime] :since Optional filter by created after given date time # @option opts [DateTime] :before Optional filter by created before given date time # @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. # @param [Hash] opts the optional parameters # @option opts [Integer] :page Optional page index in list pagination # @option opts [Integer] :size Optional page size in list pagination # @option opts [String] :sort Optional createdAt sort direction ASC or DESC # @option opts [Boolean] :favourite Optionally filter results for favourites only # @option opts [String] :search Optionally filter by search words partial matching ID, tags, name, and email address # @option opts [String] :tag Optionally filter by tags. Will return inboxes that include given tags # @option opts [Boolean] :team_access DEPRECATED. Optionally filter by team access. # @option opts [DateTime] :since Optional filter by created after given date time # @option opts [DateTime] :before Optional filter by created before given date time # @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[:'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? query_params[:'favourite'] = opts[:'favourite'] if !opts[:'favourite'].nil? query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil? query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil? query_params[:'teamAccess'] = opts[:'team_access'] if !opts[:'team_access'].nil? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # 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] :size Alias for limit. Assessed first before assessing any passed limit. # @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 [String] :sort Sort the results by received date and direction ASC or DESC # @option opts [Integer] :retry_timeout Maximum milliseconds to spend retrying inbox database until minCount emails are returned # @option opts [Integer] :delay_timeout # @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 [Boolean] :unread_only # @option opts [DateTime] :before Exclude emails received after this ISO 8601 date time # @option opts [DateTime] :since Exclude emails received before this ISO 8601 date time # @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] :size Alias for limit. Assessed first before assessing any passed limit. # @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 [String] :sort Sort the results by received date and direction ASC or DESC # @option opts [Integer] :retry_timeout Maximum milliseconds to spend retrying inbox database until minCount emails are returned # @option opts [Integer] :delay_timeout # @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 [Boolean] :unread_only # @option opts [DateTime] :before Exclude emails received after this ISO 8601 date time # @option opts [DateTime] :since Exclude emails received before this ISO 8601 date time # @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 if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100 fail ArgumentError, 'invalid value for "opts[:"size"]" when calling InboxControllerApi.get_emails, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling InboxControllerApi.get_emails, must be smaller than or equal to 100.' 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[:'size'] = opts[:'size'] if !opts[:'size'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'retryTimeout'] = opts[:'retry_timeout'] if !opts[:'retry_timeout'].nil? query_params[:'delayTimeout'] = opts[:'delay_timeout'] if !opts[:'delay_timeout'].nil? query_params[:'minCount'] = opts[:'min_count'] if !opts[:'min_count'].nil? query_params[:'unreadOnly'] = opts[:'unread_only'] if !opts[:'unread_only'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # 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 IMAP and SMTP access usernames and passwords # @param [Hash] opts the optional parameters # @option opts [String] :inbox_id Inbox ID # @return [ImapSmtpAccessDetails] def get_imap_smtp_access(opts = {}) data, _status_code, _headers = get_imap_smtp_access_with_http_info(opts) data end # Get IMAP and SMTP access usernames and passwords # @param [Hash] opts the optional parameters # @option opts [String] :inbox_id Inbox ID # @return [Array<(ImapSmtpAccessDetails, Integer, Hash)>] ImapSmtpAccessDetails data, response status code and response headers def get_imap_smtp_access_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_imap_smtp_access ...' end # resource path local_var_path = '/inboxes/imap-smtp-access' # query parameters query_params = opts[:query_params] || {} query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'ImapSmtpAccessDetails' # 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_imap_smtp_access\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] # @param [Hash] opts the optional parameters # @return [InboxDto] 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] # @param [Hash] opts the optional parameters # @return [Array<(InboxDto, Integer, Hash)>] InboxDto 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(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InboxDto' # 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 # Search for an inbox with the provided email address # Get a inbox result by email address # @param email_address [String] # @param [Hash] opts the optional parameters # @return [InboxByEmailAddressResult] def get_inbox_by_email_address(email_address, opts = {}) data, _status_code, _headers = get_inbox_by_email_address_with_http_info(email_address, opts) data end # Search for an inbox with the provided email address # Get a inbox result by email address # @param email_address [String] # @param [Hash] opts the optional parameters # @return [Array<(InboxByEmailAddressResult, Integer, Hash)>] InboxByEmailAddressResult data, response status code and response headers def get_inbox_by_email_address_with_http_info(email_address, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inbox_by_email_address ...' end # verify the required parameter 'email_address' is set if @api_client.config.client_side_validation && email_address.nil? fail ArgumentError, "Missing the required parameter 'email_address' when calling InboxControllerApi.get_inbox_by_email_address" end # resource path local_var_path = '/inboxes/byEmailAddress' # query parameters query_params = opts[:query_params] || {} query_params[:'emailAddress'] = email_address # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InboxByEmailAddressResult' # 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_by_email_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get total inbox count # @param [Hash] opts the optional parameters # @return [CountDto] def get_inbox_count(opts = {}) data, _status_code, _headers = get_inbox_count_with_http_info(opts) data end # Get total inbox count # @param [Hash] opts the optional parameters # @return [Array<(CountDto, Integer, Hash)>] CountDto data, response status code and response headers def get_inbox_count_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inbox_count ...' end # resource path local_var_path = '/inboxes/count' # 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(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'CountDto' # 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_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get email count in inbox # @param inbox_id [String] Id of inbox that emails belongs to # @param [Hash] opts the optional parameters # @return [CountDto] def get_inbox_email_count(inbox_id, opts = {}) data, _status_code, _headers = get_inbox_email_count_with_http_info(inbox_id, opts) data end # Get email count in inbox # @param inbox_id [String] Id of inbox that emails belongs to # @param [Hash] opts the optional parameters # @return [Array<(CountDto, Integer, Hash)>] CountDto data, response status code and response headers def get_inbox_email_count_with_http_info(inbox_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inbox_email_count ...' 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_email_count" end # resource path local_var_path = '/inboxes/{inboxId}/emails/count'.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(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'CountDto' # 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_email_count\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') # @option opts [DateTime] :since Optional filter by received after given date time # @option opts [DateTime] :before Optional filter by received before given date time # @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 # @option opts [DateTime] :since Optional filter by received after given date time # @option opts [DateTime] :before Optional filter by received before given date time # @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? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # 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 all inbox IDs # Get list of inbox IDs # @param [Hash] opts the optional parameters # @return [InboxIdsResult] def get_inbox_ids(opts = {}) data, _status_code, _headers = get_inbox_ids_with_http_info(opts) data end # Get all inbox IDs # Get list of inbox IDs # @param [Hash] opts the optional parameters # @return [Array<(InboxIdsResult, Integer, Hash)>] InboxIdsResult data, response status code and response headers def get_inbox_ids_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_inbox_ids ...' end # resource path local_var_path = '/inboxes/ids' # 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(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InboxIdsResult' # 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_ids\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] # @param [Hash] opts the optional parameters # @option opts [Integer] :page Optional page index in inbox sent email list pagination (default to 0) # @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') # @option opts [String] :search_filter Optional sent email search # @option opts [DateTime] :since Optional filter by sent after given date time # @option opts [DateTime] :before Optional filter by sent before given date time # @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] # @param [Hash] opts the optional parameters # @option opts [Integer] :page Optional page index in inbox sent email list pagination # @option opts [Integer] :size Optional page size in inbox sent email list pagination # @option opts [String] :sort Optional createdAt sort direction ASC or DESC # @option opts [String] :search_filter Optional sent email search # @option opts [DateTime] :since Optional filter by sent after given date time # @option opts [DateTime] :before Optional filter by sent before given date time # @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[:'size'] = opts[:'size'] if !opts[:'size'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # 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(['*/*']) # 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 addresses # List the inboxes you have created. Note use of the more advanced `getAllEmails` is recommended and allows paginated access using 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') # @option opts [DateTime] :since Optional filter by created after given date time # @option opts [DateTime] :before Optional filter by created before given date time # @return [Array] def get_inboxes(opts = {}) data, _status_code, _headers = get_inboxes_with_http_info(opts) data end # List Inboxes and email addresses # List the inboxes you have created. Note use of the more advanced `getAllEmails` is recommended and allows paginated access using 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 # @option opts [DateTime] :since Optional filter by created after given date time # @option opts [DateTime] :before Optional filter by created before given date time # @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 if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100 fail ArgumentError, 'invalid value for "opts[:"size"]" when calling InboxControllerApi.get_inboxes, must be smaller than or equal to 100.' 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? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # 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 # Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet. # Get the newest email in an inbox or wait for one to arrive # @param inbox_id [String] ID of the inbox you want to get the latest email from # @param timeout_millis [Integer] Timeout milliseconds to wait for latest email # @param [Hash] opts the optional parameters # @return [Email] def get_latest_email_in_inbox(inbox_id, timeout_millis, opts = {}) data, _status_code, _headers = get_latest_email_in_inbox_with_http_info(inbox_id, timeout_millis, opts) data end # Get latest email in an inbox. Use `WaitForController` to get emails that may not have arrived yet. # Get the newest email in an inbox or wait for one to arrive # @param inbox_id [String] ID of the inbox you want to get the latest email from # @param timeout_millis [Integer] Timeout milliseconds to wait for latest email # @param [Hash] opts the optional parameters # @return [Array<(Email, Integer, Hash)>] Email data, response status code and response headers def get_latest_email_in_inbox_with_http_info(inbox_id, timeout_millis, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_latest_email_in_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_latest_email_in_inbox" end # verify the required parameter 'timeout_millis' is set if @api_client.config.client_side_validation && timeout_millis.nil? fail ArgumentError, "Missing the required parameter 'timeout_millis' when calling InboxControllerApi.get_latest_email_in_inbox" end # resource path local_var_path = '/inboxes/getLatestEmail' # query parameters query_params = opts[:query_params] || {} query_params[:'inboxId'] = inbox_id query_params[:'timeoutMillis'] = timeout_millis # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Email' # 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_latest_email_in_inbox\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 [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] :search_filter Optional search filter # @option opts [DateTime] :since Optional filter by created after given date time # @option opts [DateTime] :before Optional filter by created before given date time # @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 [Integer] :size Optional page size in list pagination # @option opts [String] :sort Optional createdAt sort direction ASC or DESC # @option opts [String] :search_filter Optional search filter # @option opts [DateTime] :since Optional filter by created after given date time # @option opts [DateTime] :before Optional filter by created before given date time # @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[:'size'] = opts[:'size'] if !opts[:'size'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # 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] # @param [Hash] opts the optional parameters # @option opts [Integer] :page Optional page index in inbox ruleset list pagination (default to 0) # @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') # @option opts [String] :search_filter Optional search filter # @option opts [DateTime] :since Optional filter by created after given date time # @option opts [DateTime] :before Optional filter by created before given date time # @return [PageInboxRulesetDto] def list_inbox_rulesets(inbox_id, opts = {}) data, _status_code, _headers = list_inbox_rulesets_with_http_info(inbox_id, opts) data end # List inbox rulesets # List all rulesets attached to an inbox # @param inbox_id [String] # @param [Hash] opts the optional parameters # @option opts [Integer] :page Optional page index in inbox ruleset list pagination # @option opts [Integer] :size Optional page size in inbox ruleset list pagination # @option opts [String] :sort Optional createdAt sort direction ASC or DESC # @option opts [String] :search_filter Optional search filter # @option opts [DateTime] :since Optional filter by created after given date time # @option opts [DateTime] :before Optional filter by created before given date time # @return [Array<(PageInboxRulesetDto, Integer, Hash)>] PageInboxRulesetDto data, 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[:'size'] = opts[:'size'] if !opts[:'size'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PageInboxRulesetDto' # 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 # List inbox tracking pixels # List all tracking pixels sent from an inbox # @param inbox_id [String] # @param [Hash] opts the optional parameters # @option opts [Integer] :page Optional page index in inbox tracking pixel list pagination (default to 0) # @option opts [Integer] :size Optional page size in inbox tracking pixel list pagination (default to 20) # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC') # @option opts [String] :search_filter Optional search filter # @option opts [DateTime] :since Optional filter by created after given date time # @option opts [DateTime] :before Optional filter by created before given date time # @return [PageTrackingPixelProjection] def list_inbox_tracking_pixels(inbox_id, opts = {}) data, _status_code, _headers = list_inbox_tracking_pixels_with_http_info(inbox_id, opts) data end # List inbox tracking pixels # List all tracking pixels sent from an inbox # @param inbox_id [String] # @param [Hash] opts the optional parameters # @option opts [Integer] :page Optional page index in inbox tracking pixel list pagination # @option opts [Integer] :size Optional page size in inbox tracking pixel list pagination # @option opts [String] :sort Optional createdAt sort direction ASC or DESC # @option opts [String] :search_filter Optional search filter # @option opts [DateTime] :since Optional filter by created after given date time # @option opts [DateTime] :before Optional filter by created before given date time # @return [Array<(PageTrackingPixelProjection, Integer, Hash)>] PageTrackingPixelProjection data, response status code and response headers def list_inbox_tracking_pixels_with_http_info(inbox_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.list_inbox_tracking_pixels ...' 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_tracking_pixels" 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}/tracking-pixels'.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? query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PageTrackingPixelProjection' # 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_tracking_pixels\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 send_email_options [SendEmailOptions] # @param [Hash] opts the optional parameters # @return [nil] def send_email(inbox_id, send_email_options, opts = {}) send_email_with_http_info(inbox_id, send_email_options, 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 send_email_options [SendEmailOptions] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def send_email_with_http_info(inbox_id, send_email_options, 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 # verify the required parameter 'send_email_options' is set if @api_client.config.client_side_validation && send_email_options.nil? fail ArgumentError, "Missing the required parameter 'send_email_options' 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(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 send_email_options [SendEmailOptions] # @param [Hash] opts the optional parameters # @return [SentEmailDto] def send_email_and_confirm(inbox_id, send_email_options, opts = {}) data, _status_code, _headers = send_email_and_confirm_with_http_info(inbox_id, send_email_options, 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 send_email_options [SendEmailOptions] # @param [Hash] opts the optional parameters # @return [Array<(SentEmailDto, Integer, Hash)>] SentEmailDto data, response status code and response headers def send_email_and_confirm_with_http_info(inbox_id, send_email_options, 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 # verify the required parameter 'send_email_options' is set if @api_client.config.client_side_validation && send_email_options.nil? fail ArgumentError, "Missing the required parameter 'send_email_options' 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(['*/*']) # 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(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 email using an SMTP mail envelope and message body and return sent confirmation # Send email using an SMTP envelope containing RCPT TO, MAIL FROM, and a SMTP BODY. # @param inbox_id [String] ID of the inbox you want to send the email from # @param send_smtp_envelope_options [SendSMTPEnvelopeOptions] # @param [Hash] opts the optional parameters # @return [SentEmailDto] def send_smtp_envelope(inbox_id, send_smtp_envelope_options, opts = {}) data, _status_code, _headers = send_smtp_envelope_with_http_info(inbox_id, send_smtp_envelope_options, opts) data end # Send email using an SMTP mail envelope and message body and return sent confirmation # Send email using an SMTP envelope containing RCPT TO, MAIL FROM, and a SMTP BODY. # @param inbox_id [String] ID of the inbox you want to send the email from # @param send_smtp_envelope_options [SendSMTPEnvelopeOptions] # @param [Hash] opts the optional parameters # @return [Array<(SentEmailDto, Integer, Hash)>] SentEmailDto data, response status code and response headers def send_smtp_envelope_with_http_info(inbox_id, send_smtp_envelope_options, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: InboxControllerApi.send_smtp_envelope ...' 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_smtp_envelope" end # verify the required parameter 'send_smtp_envelope_options' is set if @api_client.config.client_side_validation && send_smtp_envelope_options.nil? fail ArgumentError, "Missing the required parameter 'send_smtp_envelope_options' when calling InboxControllerApi.send_smtp_envelope" end # resource path local_var_path = '/inboxes/{inboxId}/smtp-envelope'.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(['*/*']) # 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(send_smtp_envelope_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_smtp_envelope\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] # @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] # @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] ID of inbox to set favourite state # @param set_inbox_favourited_options [SetInboxFavouritedOptions] # @param [Hash] opts the optional parameters # @return [InboxDto] 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] ID of inbox to set favourite state # @param set_inbox_favourited_options [SetInboxFavouritedOptions] # @param [Hash] opts the optional parameters # @return [Array<(InboxDto, Integer, Hash)>] InboxDto 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(['*/*']) # 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] || 'InboxDto' # 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] # @param update_inbox_options [UpdateInboxOptions] # @param [Hash] opts the optional parameters # @return [InboxDto] 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] # @param update_inbox_options [UpdateInboxOptions] # @param [Hash] opts the optional parameters # @return [Array<(InboxDto, Integer, Hash)>] InboxDto 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(['*/*']) # 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] || 'InboxDto' # 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