class MailSlurpClient::BounceControllerApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/mailslurp_client/api/bounce_controller_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

get_bounced_email(id, opts = {}) click to toggle source

Get a bounced email. Bounced emails are email you have sent that were rejected by a recipient @param id [String] ID of the bounced email to fetch @param [Hash] opts the optional parameters @return [BouncedEmailDto]

# File lib/mailslurp_client/api/bounce_controller_api.rb, line 27
def get_bounced_email(id, opts = {})
  data, _status_code, _headers = get_bounced_email_with_http_info(id, opts)
  data
end
get_bounced_email_with_http_info(id, opts = {}) click to toggle source

Get a bounced email. Bounced emails are email you have sent that were rejected by a recipient @param id [String] ID of the bounced email to fetch @param [Hash] opts the optional parameters @return [Array<(BouncedEmailDto, Integer, Hash)>] BouncedEmailDto data, response status code and response headers

# File lib/mailslurp_client/api/bounce_controller_api.rb, line 37
def get_bounced_email_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BounceControllerApi.get_bounced_email ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling BounceControllerApi.get_bounced_email"
  end
  # resource path
  local_var_path = '/bounce/emails/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'BouncedEmailDto' 

  # 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: BounceControllerApi#get_bounced_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_bounced_emails(opts = {}) click to toggle source

Get paginated list of bounced emails. Bounced emails are email you have sent that were rejected by a recipient @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [Integer] :page Optional page index (default to 0) @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :size Optional page size (default to 20) @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC') @return [PageBouncedEmail]

# File lib/mailslurp_client/api/bounce_controller_api.rb, line 93
def get_bounced_emails(opts = {})
  data, _status_code, _headers = get_bounced_emails_with_http_info(opts)
  data
end
get_bounced_emails_with_http_info(opts = {}) click to toggle source

Get paginated list of bounced emails. Bounced emails are email you have sent that were rejected by a recipient @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [Integer] :page Optional page index @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :size Optional page size @option opts [String] :sort Optional createdAt sort direction ASC or DESC @return [Array<(PageBouncedEmail, Integer, Hash)>] PageBouncedEmail data, response status code and response headers

# File lib/mailslurp_client/api/bounce_controller_api.rb, line 107
def get_bounced_emails_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BounceControllerApi.get_bounced_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 = '/bounce/emails'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'PageBouncedEmail' 

  # 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: BounceControllerApi#get_bounced_emails\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_bounced_recipient(id, opts = {}) click to toggle source

Get a bounced email. Bounced emails are email you have sent that were rejected by a recipient @param id [String] ID of the bounced recipient @param [Hash] opts the optional parameters @return [BouncedRecipientDto]

# File lib/mailslurp_client/api/bounce_controller_api.rb, line 164
def get_bounced_recipient(id, opts = {})
  data, _status_code, _headers = get_bounced_recipient_with_http_info(id, opts)
  data
end
get_bounced_recipient_with_http_info(id, opts = {}) click to toggle source

Get a bounced email. Bounced emails are email you have sent that were rejected by a recipient @param id [String] ID of the bounced recipient @param [Hash] opts the optional parameters @return [Array<(BouncedRecipientDto, Integer, Hash)>] BouncedRecipientDto data, response status code and response headers

# File lib/mailslurp_client/api/bounce_controller_api.rb, line 174
def get_bounced_recipient_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BounceControllerApi.get_bounced_recipient ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling BounceControllerApi.get_bounced_recipient"
  end
  # resource path
  local_var_path = '/bounce/recipients/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'BouncedRecipientDto' 

  # 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: BounceControllerApi#get_bounced_recipient\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_bounced_recipients(opts = {}) click to toggle source

Get paginated list of bounced recipients. Bounced recipients are email addresses that you have sent emails to that did not accept the sent email. Once a recipient is bounced you cannot send emails to that address. @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [Integer] :page Optional page index (default to 0) @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :size Optional page size (default to 20) @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC') @return [PageBouncedRecipients]

# File lib/mailslurp_client/api/bounce_controller_api.rb, line 230
def get_bounced_recipients(opts = {})
  data, _status_code, _headers = get_bounced_recipients_with_http_info(opts)
  data
end
get_bounced_recipients_with_http_info(opts = {}) click to toggle source

Get paginated list of bounced recipients. Bounced recipients are email addresses that you have sent emails to that did not accept the sent email. Once a recipient is bounced you cannot send emails to that address. @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [Integer] :page Optional page index @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :size Optional page size @option opts [String] :sort Optional createdAt sort direction ASC or DESC @return [Array<(PageBouncedRecipients, Integer, Hash)>] PageBouncedRecipients data, response status code and response headers

# File lib/mailslurp_client/api/bounce_controller_api.rb, line 244
def get_bounced_recipients_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BounceControllerApi.get_bounced_recipients ...'
  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 = '/bounce/recipients'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'PageBouncedRecipients' 

  # 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: BounceControllerApi#get_bounced_recipients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end