class MailSlurpClient::MissedEmailControllerApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

get_all_missed_emails(opts = {}) click to toggle source

Get all MissedEmails in paginated format @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [String] :inbox_id Optional inbox ID filter @option opts [Integer] :page Optional page index in list pagination (default to 0) @option opts [String] :search_filter Optional search filter @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :size Optional page size in list pagination (default to 20) @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC') @return [PageMissedEmailProjection]

# File lib/mailslurp_client/api/missed_email_controller_api.rb, line 32
def get_all_missed_emails(opts = {})
  data, _status_code, _headers = get_all_missed_emails_with_http_info(opts)
  data
end
get_all_missed_emails_with_http_info(opts = {}) click to toggle source

Get all MissedEmails in paginated format @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [String] :inbox_id Optional inbox ID filter @option opts [Integer] :page Optional page index in list pagination @option opts [String] :search_filter Optional search filter @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :size Optional page size in list pagination @option opts [String] :sort Optional createdAt sort direction ASC or DESC @return [Array<(PageMissedEmailProjection, Integer, Hash)>] PageMissedEmailProjection data, response status code and response headers

# File lib/mailslurp_client/api/missed_email_controller_api.rb, line 47
def get_all_missed_emails_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MissedEmailControllerApi.get_all_missed_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 = '/missed-emails'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].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] || 'PageMissedEmailProjection' 

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

Get all unknown missed emails in paginated format Unknown missed emails are emails that were sent to MailSlurp but could not be assigned to an existing inbox. @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [String] :inbox_id Optional inbox ID filter @option opts [Integer] :page Optional page index in list pagination (default to 0) @option opts [String] :search_filter Optional search filter @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :size Optional page size in list pagination (default to 20) @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC') @return [PageUnknownMissedEmailProjection]

# File lib/mailslurp_client/api/missed_email_controller_api.rb, line 112
def get_all_unknown_missed_emails(opts = {})
  data, _status_code, _headers = get_all_unknown_missed_emails_with_http_info(opts)
  data
end
get_all_unknown_missed_emails_with_http_info(opts = {}) click to toggle source

Get all unknown missed emails in paginated format Unknown missed emails are emails that were sent to MailSlurp but could not be assigned to an existing inbox. @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [String] :inbox_id Optional inbox ID filter @option opts [Integer] :page Optional page index in list pagination @option opts [String] :search_filter Optional search filter @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :size Optional page size in list pagination @option opts [String] :sort Optional createdAt sort direction ASC or DESC @return [Array<(PageUnknownMissedEmailProjection, Integer, Hash)>] PageUnknownMissedEmailProjection data, response status code and response headers

# File lib/mailslurp_client/api/missed_email_controller_api.rb, line 128
def get_all_unknown_missed_emails_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MissedEmailControllerApi.get_all_unknown_missed_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 = '/missed-emails/unknown'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].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] || 'PageUnknownMissedEmailProjection' 

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

Get MissedEmail @param missed_email_id [String] missedEmailId @param [Hash] opts the optional parameters @return [MissedEmail]

# File lib/mailslurp_client/api/missed_email_controller_api.rb, line 186
def get_missed_email(missed_email_id, opts = {})
  data, _status_code, _headers = get_missed_email_with_http_info(missed_email_id, opts)
  data
end
get_missed_email_with_http_info(missed_email_id, opts = {}) click to toggle source

Get MissedEmail @param missed_email_id [String] missedEmailId @param [Hash] opts the optional parameters @return [Array<(MissedEmail, Integer, Hash)>] MissedEmail data, response status code and response headers

# File lib/mailslurp_client/api/missed_email_controller_api.rb, line 195
def get_missed_email_with_http_info(missed_email_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MissedEmailControllerApi.get_missed_email ...'
  end
  # verify the required parameter 'missed_email_id' is set
  if @api_client.config.client_side_validation && missed_email_id.nil?
    fail ArgumentError, "Missing the required parameter 'missed_email_id' when calling MissedEmailControllerApi.get_missed_email"
  end
  # resource path
  local_var_path = '/missed-emails/{missedEmailId}'.sub('{' + 'missedEmailId' + '}', CGI.escape(missed_email_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] || 'MissedEmail' 

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

Wait for Nth missed email Wait for 0 based index missed email @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [String] :inbox_id Optional inbox ID filter @option opts [Integer] :index Zero based index of the email to wait for. If 1 missed email already and you want to wait for the 2nd email pass index&#x3D;1 @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :timeout Optional timeout milliseconds @return [MissedEmail]

# File lib/mailslurp_client/api/missed_email_controller_api.rb, line 251
def wait_for_nth_missed_email(opts = {})
  data, _status_code, _headers = wait_for_nth_missed_email_with_http_info(opts)
  data
end
wait_for_nth_missed_email_with_http_info(opts = {}) click to toggle source

Wait for Nth missed email Wait for 0 based index missed email @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [String] :inbox_id Optional inbox ID filter @option opts [Integer] :index Zero based index of the email to wait for. If 1 missed email already and you want to wait for the 2nd email pass index&#x3D;1 @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :timeout Optional timeout milliseconds @return [Array<(MissedEmail, Integer, Hash)>] MissedEmail data, response status code and response headers

# File lib/mailslurp_client/api/missed_email_controller_api.rb, line 265
def wait_for_nth_missed_email_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MissedEmailControllerApi.wait_for_nth_missed_email ...'
  end
  # resource path
  local_var_path = '/missed-emails/waitForNthMissedEmail'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
  query_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'timeout'] = opts[:'timeout'] if !opts[:'timeout'].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] || 'MissedEmail' 

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