=begin #Mailchimp Transactional API #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 1.0.5 Contact: apihelp@mandrill.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.12 =end require 'uri' module MailchimpTransactional class WhitelistsApi attr_accessor :api_client attr_accessor :api_key def initialize(api_key = '', api_client = ApiClient.default) @api_key = api_key @api_client = api_client end # /whitelists/add # Adds an email to your email rejection whitelist. If the address is currently on your blacklist, that blacklist entry will be removed automatically. # @param body # @param [Hash] opts the optional parameters # @return [InlineResponse20076] def add(body = {}, opts = {}) data, _status_code, _headers = add_with_http_info(body, opts) data end # /whitelists/add # Adds an email to your email rejection whitelist. If the address is currently on your blacklist, that blacklist entry will be removed automatically. # @param body # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse20076, Fixnum, Hash)>] InlineResponse20076 data, response status code and response headers def add_with_http_info(body, opts = {}) # add api key to request body body[:key] = @api_key # resource path local_var_path = '/whitelists/add' # http body (model) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :body => body, :auth_names => auth_names, :return_type => 'InlineResponse20076') return data, status_code, headers end # /whitelists/delete # Removes an email address from the whitelist. # @param body # @param [Hash] opts the optional parameters # @return [InlineResponse20078] def delete(body = {}, opts = {}) data, _status_code, _headers = delete_with_http_info(body, opts) data end # /whitelists/delete # Removes an email address from the whitelist. # @param body # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse20078, Fixnum, Hash)>] InlineResponse20078 data, response status code and response headers def delete_with_http_info(body, opts = {}) # add api key to request body body[:key] = @api_key # resource path local_var_path = '/whitelists/delete' # http body (model) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :body => body, :auth_names => auth_names, :return_type => 'InlineResponse20078') return data, status_code, headers end # /whitelists/list # Retrieves your email rejection whitelist. You can provide an email address or search prefix to limit the results. Returns up to 1000 results. # @param body # @param [Hash] opts the optional parameters # @return [Array] def list(body = {}, opts = {}) data, _status_code, _headers = list_with_http_info(body, opts) data end # /whitelists/list # Retrieves your email rejection whitelist. You can provide an email address or search prefix to limit the results. Returns up to 1000 results. # @param body # @param [Hash] opts the optional parameters # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def list_with_http_info(body, opts = {}) # add api key to request body body[:key] = @api_key # resource path local_var_path = '/whitelists/list' # http body (model) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :body => body, :auth_names => auth_names, :return_type => 'Array') return data, status_code, headers end end end