=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 ToolsControllerApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Create a BIMI record policy # @param generate_bimi_record_options [GenerateBimiRecordOptions] # @param [Hash] opts the optional parameters # @return [GenerateBimiRecordResults] def generate_bimi_record(generate_bimi_record_options, opts = {}) data, _status_code, _headers = generate_bimi_record_with_http_info(generate_bimi_record_options, opts) data end # Create a BIMI record policy # @param generate_bimi_record_options [GenerateBimiRecordOptions] # @param [Hash] opts the optional parameters # @return [Array<(GenerateBimiRecordResults, Integer, Hash)>] GenerateBimiRecordResults data, response status code and response headers def generate_bimi_record_with_http_info(generate_bimi_record_options, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ToolsControllerApi.generate_bimi_record ...' end # verify the required parameter 'generate_bimi_record_options' is set if @api_client.config.client_side_validation && generate_bimi_record_options.nil? fail ArgumentError, "Missing the required parameter 'generate_bimi_record_options' when calling ToolsControllerApi.generate_bimi_record" end # resource path local_var_path = '/tools/generate-bimi-record' # 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(generate_bimi_record_options) # return_type return_type = opts[:return_type] || 'GenerateBimiRecordResults' # 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: ToolsControllerApi#generate_bimi_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a DMARC record policy # @param generate_dmarc_record_options [GenerateDmarcRecordOptions] # @param [Hash] opts the optional parameters # @return [GenerateDmarcRecordResults] def generate_dmarc_record(generate_dmarc_record_options, opts = {}) data, _status_code, _headers = generate_dmarc_record_with_http_info(generate_dmarc_record_options, opts) data end # Create a DMARC record policy # @param generate_dmarc_record_options [GenerateDmarcRecordOptions] # @param [Hash] opts the optional parameters # @return [Array<(GenerateDmarcRecordResults, Integer, Hash)>] GenerateDmarcRecordResults data, response status code and response headers def generate_dmarc_record_with_http_info(generate_dmarc_record_options, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ToolsControllerApi.generate_dmarc_record ...' end # verify the required parameter 'generate_dmarc_record_options' is set if @api_client.config.client_side_validation && generate_dmarc_record_options.nil? fail ArgumentError, "Missing the required parameter 'generate_dmarc_record_options' when calling ToolsControllerApi.generate_dmarc_record" end # resource path local_var_path = '/tools/generate-dmarc-record' # 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(generate_dmarc_record_options) # return_type return_type = opts[:return_type] || 'GenerateDmarcRecordResults' # 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: ToolsControllerApi#generate_dmarc_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a TLS reporting record policy # @param generate_mta_sts_record_options [GenerateMtaStsRecordOptions] # @param [Hash] opts the optional parameters # @return [GenerateMtaStsRecordResults] def generate_mta_sts_record(generate_mta_sts_record_options, opts = {}) data, _status_code, _headers = generate_mta_sts_record_with_http_info(generate_mta_sts_record_options, opts) data end # Create a TLS reporting record policy # @param generate_mta_sts_record_options [GenerateMtaStsRecordOptions] # @param [Hash] opts the optional parameters # @return [Array<(GenerateMtaStsRecordResults, Integer, Hash)>] GenerateMtaStsRecordResults data, response status code and response headers def generate_mta_sts_record_with_http_info(generate_mta_sts_record_options, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ToolsControllerApi.generate_mta_sts_record ...' end # verify the required parameter 'generate_mta_sts_record_options' is set if @api_client.config.client_side_validation && generate_mta_sts_record_options.nil? fail ArgumentError, "Missing the required parameter 'generate_mta_sts_record_options' when calling ToolsControllerApi.generate_mta_sts_record" end # resource path local_var_path = '/tools/generate-mta-sts-record' # 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(generate_mta_sts_record_options) # return_type return_type = opts[:return_type] || 'GenerateMtaStsRecordResults' # 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: ToolsControllerApi#generate_mta_sts_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a TLS reporting record policy # @param generate_tls_reporting_record_options [GenerateTlsReportingRecordOptions] # @param [Hash] opts the optional parameters # @return [GenerateTlsReportingRecordResults] def generate_tls_reporting_record(generate_tls_reporting_record_options, opts = {}) data, _status_code, _headers = generate_tls_reporting_record_with_http_info(generate_tls_reporting_record_options, opts) data end # Create a TLS reporting record policy # @param generate_tls_reporting_record_options [GenerateTlsReportingRecordOptions] # @param [Hash] opts the optional parameters # @return [Array<(GenerateTlsReportingRecordResults, Integer, Hash)>] GenerateTlsReportingRecordResults data, response status code and response headers def generate_tls_reporting_record_with_http_info(generate_tls_reporting_record_options, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ToolsControllerApi.generate_tls_reporting_record ...' end # verify the required parameter 'generate_tls_reporting_record_options' is set if @api_client.config.client_side_validation && generate_tls_reporting_record_options.nil? fail ArgumentError, "Missing the required parameter 'generate_tls_reporting_record_options' when calling ToolsControllerApi.generate_tls_reporting_record" end # resource path local_var_path = '/tools/generate-tls-reporting-record' # 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(generate_tls_reporting_record_options) # return_type return_type = opts[:return_type] || 'GenerateTlsReportingRecordResults' # 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: ToolsControllerApi#generate_tls_reporting_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Lookup a BIMI record policy # @param lookup_bimi_domain_options [LookupBimiDomainOptions] # @param [Hash] opts the optional parameters # @return [LookupBimiDomainResults] def lookup_bimi_domain(lookup_bimi_domain_options, opts = {}) data, _status_code, _headers = lookup_bimi_domain_with_http_info(lookup_bimi_domain_options, opts) data end # Lookup a BIMI record policy # @param lookup_bimi_domain_options [LookupBimiDomainOptions] # @param [Hash] opts the optional parameters # @return [Array<(LookupBimiDomainResults, Integer, Hash)>] LookupBimiDomainResults data, response status code and response headers def lookup_bimi_domain_with_http_info(lookup_bimi_domain_options, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ToolsControllerApi.lookup_bimi_domain ...' end # verify the required parameter 'lookup_bimi_domain_options' is set if @api_client.config.client_side_validation && lookup_bimi_domain_options.nil? fail ArgumentError, "Missing the required parameter 'lookup_bimi_domain_options' when calling ToolsControllerApi.lookup_bimi_domain" end # resource path local_var_path = '/tools/lookup-bimi-domain' # 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(lookup_bimi_domain_options) # return_type return_type = opts[:return_type] || 'LookupBimiDomainResults' # 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: ToolsControllerApi#lookup_bimi_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Lookup a DMARC record policy # @param lookup_dmarc_domain_options [LookupDmarcDomainOptions] # @param [Hash] opts the optional parameters # @return [LookupDmarcDomainResults] def lookup_dmarc_domain(lookup_dmarc_domain_options, opts = {}) data, _status_code, _headers = lookup_dmarc_domain_with_http_info(lookup_dmarc_domain_options, opts) data end # Lookup a DMARC record policy # @param lookup_dmarc_domain_options [LookupDmarcDomainOptions] # @param [Hash] opts the optional parameters # @return [Array<(LookupDmarcDomainResults, Integer, Hash)>] LookupDmarcDomainResults data, response status code and response headers def lookup_dmarc_domain_with_http_info(lookup_dmarc_domain_options, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ToolsControllerApi.lookup_dmarc_domain ...' end # verify the required parameter 'lookup_dmarc_domain_options' is set if @api_client.config.client_side_validation && lookup_dmarc_domain_options.nil? fail ArgumentError, "Missing the required parameter 'lookup_dmarc_domain_options' when calling ToolsControllerApi.lookup_dmarc_domain" end # resource path local_var_path = '/tools/lookup-dmarc-domain' # 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(lookup_dmarc_domain_options) # return_type return_type = opts[:return_type] || 'LookupDmarcDomainResults' # 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: ToolsControllerApi#lookup_dmarc_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Lookup a MTA-STS domain policy # @param lookup_mta_sts_domain_options [LookupMtaStsDomainOptions] # @param [Hash] opts the optional parameters # @return [LookupMtaStsDomainResults] def lookup_mta_sts_domain(lookup_mta_sts_domain_options, opts = {}) data, _status_code, _headers = lookup_mta_sts_domain_with_http_info(lookup_mta_sts_domain_options, opts) data end # Lookup a MTA-STS domain policy # @param lookup_mta_sts_domain_options [LookupMtaStsDomainOptions] # @param [Hash] opts the optional parameters # @return [Array<(LookupMtaStsDomainResults, Integer, Hash)>] LookupMtaStsDomainResults data, response status code and response headers def lookup_mta_sts_domain_with_http_info(lookup_mta_sts_domain_options, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ToolsControllerApi.lookup_mta_sts_domain ...' end # verify the required parameter 'lookup_mta_sts_domain_options' is set if @api_client.config.client_side_validation && lookup_mta_sts_domain_options.nil? fail ArgumentError, "Missing the required parameter 'lookup_mta_sts_domain_options' when calling ToolsControllerApi.lookup_mta_sts_domain" end # resource path local_var_path = '/tools/lookup-mta-sts-domain' # 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(lookup_mta_sts_domain_options) # return_type return_type = opts[:return_type] || 'LookupMtaStsDomainResults' # 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: ToolsControllerApi#lookup_mta_sts_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Lookup a TLS reporting domain policy # @param lookup_tls_reporting_domain_options [LookupTlsReportingDomainOptions] # @param [Hash] opts the optional parameters # @return [LookupTlsReportingDomainResults] def lookup_tls_reporting_domain(lookup_tls_reporting_domain_options, opts = {}) data, _status_code, _headers = lookup_tls_reporting_domain_with_http_info(lookup_tls_reporting_domain_options, opts) data end # Lookup a TLS reporting domain policy # @param lookup_tls_reporting_domain_options [LookupTlsReportingDomainOptions] # @param [Hash] opts the optional parameters # @return [Array<(LookupTlsReportingDomainResults, Integer, Hash)>] LookupTlsReportingDomainResults data, response status code and response headers def lookup_tls_reporting_domain_with_http_info(lookup_tls_reporting_domain_options, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ToolsControllerApi.lookup_tls_reporting_domain ...' end # verify the required parameter 'lookup_tls_reporting_domain_options' is set if @api_client.config.client_side_validation && lookup_tls_reporting_domain_options.nil? fail ArgumentError, "Missing the required parameter 'lookup_tls_reporting_domain_options' when calling ToolsControllerApi.lookup_tls_reporting_domain" end # resource path local_var_path = '/tools/lookup-tls-reporting-domain' # 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(lookup_tls_reporting_domain_options) # return_type return_type = opts[:return_type] || 'LookupTlsReportingDomainResults' # 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: ToolsControllerApi#lookup_tls_reporting_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end