class MailSlurpClient::InboxForwarderControllerApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

create_new_inbox_forwarder(create_inbox_forwarder_options, opts = {}) click to toggle source

Create an inbox forwarder Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving @param create_inbox_forwarder_options [CreateInboxForwarderOptions] createInboxForwarderOptions @param [Hash] opts the optional parameters @option opts [String] :inbox_id Inbox id to attach forwarder to @return [InboxForwarderDto]

# File lib/mailslurp_client/api/inbox_forwarder_controller_api.rb, line 28
def create_new_inbox_forwarder(create_inbox_forwarder_options, opts = {})
  data, _status_code, _headers = create_new_inbox_forwarder_with_http_info(create_inbox_forwarder_options, opts)
  data
end
create_new_inbox_forwarder_with_http_info(create_inbox_forwarder_options, opts = {}) click to toggle source

Create an inbox forwarder Create a new inbox rule for forwarding, blocking, and allowing emails when sending and receiving @param create_inbox_forwarder_options [CreateInboxForwarderOptions] createInboxForwarderOptions @param [Hash] opts the optional parameters @option opts [String] :inbox_id Inbox id to attach forwarder to @return [Array<(InboxForwarderDto, Integer, Hash)>] InboxForwarderDto data, response status code and response headers

# File lib/mailslurp_client/api/inbox_forwarder_controller_api.rb, line 39
def create_new_inbox_forwarder_with_http_info(create_inbox_forwarder_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxForwarderControllerApi.create_new_inbox_forwarder ...'
  end
  # verify the required parameter 'create_inbox_forwarder_options' is set
  if @api_client.config.client_side_validation && create_inbox_forwarder_options.nil?
    fail ArgumentError, "Missing the required parameter 'create_inbox_forwarder_options' when calling InboxForwarderControllerApi.create_new_inbox_forwarder"
  end
  # resource path
  local_var_path = '/forwarders'

  # 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(['application/json'])
  # 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_forwarder_options) 

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

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

Delete an inbox forwarder Delete inbox forwarder @param id [String] ID of inbox forwarder @param [Hash] opts the optional parameters @return [nil]

# File lib/mailslurp_client/api/inbox_forwarder_controller_api.rb, line 94
def delete_inbox_forwarder(id, opts = {})
  delete_inbox_forwarder_with_http_info(id, opts)
  nil
end
delete_inbox_forwarder_with_http_info(id, opts = {}) click to toggle source

Delete an inbox forwarder Delete inbox forwarder @param id [String] ID of inbox forwarder @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/mailslurp_client/api/inbox_forwarder_controller_api.rb, line 104
def delete_inbox_forwarder_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxForwarderControllerApi.delete_inbox_forwarder ...'
  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 InboxForwarderControllerApi.delete_inbox_forwarder"
  end
  # resource path
  local_var_path = '/forwarders/{id}'.sub('{' + 'id' + '}', CGI.escape(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: InboxForwarderControllerApi#delete_inbox_forwarder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_inbox_forwarders(opts = {}) click to toggle source

Delete inbox forwarders Delete inbox forwarders. Accepts optional inboxId filter. @param [Hash] opts the optional parameters @option opts [String] :inbox_id Optional inbox id to attach forwarder to @return [nil]

# File lib/mailslurp_client/api/inbox_forwarder_controller_api.rb, line 154
def delete_inbox_forwarders(opts = {})
  delete_inbox_forwarders_with_http_info(opts)
  nil
end
delete_inbox_forwarders_with_http_info(opts = {}) click to toggle source

Delete inbox forwarders Delete inbox forwarders. Accepts optional inboxId filter. @param [Hash] opts the optional parameters @option opts [String] :inbox_id Optional inbox id to attach forwarder to @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/mailslurp_client/api/inbox_forwarder_controller_api.rb, line 164
def delete_inbox_forwarders_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxForwarderControllerApi.delete_inbox_forwarders ...'
  end
  # resource path
  local_var_path = '/forwarders'

  # 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] || {}

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

Get an inbox forwarder Get inbox ruleset @param id [String] ID of inbox forwarder @param [Hash] opts the optional parameters @return [InboxForwarderDto]

# File lib/mailslurp_client/api/inbox_forwarder_controller_api.rb, line 211
def get_inbox_forwarder(id, opts = {})
  data, _status_code, _headers = get_inbox_forwarder_with_http_info(id, opts)
  data
end
get_inbox_forwarder_with_http_info(id, opts = {}) click to toggle source

Get an inbox forwarder Get inbox ruleset @param id [String] ID of inbox forwarder @param [Hash] opts the optional parameters @return [Array<(InboxForwarderDto, Integer, Hash)>] InboxForwarderDto data, response status code and response headers

# File lib/mailslurp_client/api/inbox_forwarder_controller_api.rb, line 221
def get_inbox_forwarder_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxForwarderControllerApi.get_inbox_forwarder ...'
  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 InboxForwarderControllerApi.get_inbox_forwarder"
  end
  # resource path
  local_var_path = '/forwarders/{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] || 'InboxForwarderDto' 

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

List inbox forwarders List all forwarders attached to an 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 to get forwarders from @option opts [Integer] :page Optional page index in inbox forwarder 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 inbox forwarder list pagination (default to 20) @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC') @return [PageInboxForwarderDto]

# File lib/mailslurp_client/api/inbox_forwarder_controller_api.rb, line 279
def get_inbox_forwarders(opts = {})
  data, _status_code, _headers = get_inbox_forwarders_with_http_info(opts)
  data
end
get_inbox_forwarders_with_http_info(opts = {}) click to toggle source

List inbox forwarders List all forwarders attached to an 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 to get forwarders from @option opts [Integer] :page Optional page index in inbox forwarder 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 inbox forwarder list pagination @option opts [String] :sort Optional createdAt sort direction ASC or DESC @return [Array<(PageInboxForwarderDto, Integer, Hash)>] PageInboxForwarderDto data, response status code and response headers

# File lib/mailslurp_client/api/inbox_forwarder_controller_api.rb, line 295
def get_inbox_forwarders_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxForwarderControllerApi.get_inbox_forwarders ...'
  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 = '/forwarders'

  # 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] || 'PageInboxForwarderDto' 

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

Test an inbox forwarder Test an inbox forwarder @param id [String] ID of inbox forwarder @param inbox_forwarder_test_options [InboxForwarderTestOptions] inboxForwarderTestOptions @param [Hash] opts the optional parameters @return [InboxForwarderTestResult]

# File lib/mailslurp_client/api/inbox_forwarder_controller_api.rb, line 355
def test_inbox_forwarder(id, inbox_forwarder_test_options, opts = {})
  data, _status_code, _headers = test_inbox_forwarder_with_http_info(id, inbox_forwarder_test_options, opts)
  data
end
test_inbox_forwarder_with_http_info(id, inbox_forwarder_test_options, opts = {}) click to toggle source

Test an inbox forwarder Test an inbox forwarder @param id [String] ID of inbox forwarder @param inbox_forwarder_test_options [InboxForwarderTestOptions] inboxForwarderTestOptions @param [Hash] opts the optional parameters @return [Array<(InboxForwarderTestResult, Integer, Hash)>] InboxForwarderTestResult data, response status code and response headers

# File lib/mailslurp_client/api/inbox_forwarder_controller_api.rb, line 366
def test_inbox_forwarder_with_http_info(id, inbox_forwarder_test_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxForwarderControllerApi.test_inbox_forwarder ...'
  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 InboxForwarderControllerApi.test_inbox_forwarder"
  end
  # verify the required parameter 'inbox_forwarder_test_options' is set
  if @api_client.config.client_side_validation && inbox_forwarder_test_options.nil?
    fail ArgumentError, "Missing the required parameter 'inbox_forwarder_test_options' when calling InboxForwarderControllerApi.test_inbox_forwarder"
  end
  # resource path
  local_var_path = '/forwarders/{id}/test'.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'])
  # 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(inbox_forwarder_test_options) 

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

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

Test inbox forwarders for inbox Test inbox forwarders for inbox @param inbox_id [String] ID of inbox @param inbox_forwarder_test_options [InboxForwarderTestOptions] inboxForwarderTestOptions @param [Hash] opts the optional parameters @return [InboxForwarderTestResult]

# File lib/mailslurp_client/api/inbox_forwarder_controller_api.rb, line 425
def test_inbox_forwarders_for_inbox(inbox_id, inbox_forwarder_test_options, opts = {})
  data, _status_code, _headers = test_inbox_forwarders_for_inbox_with_http_info(inbox_id, inbox_forwarder_test_options, opts)
  data
end
test_inbox_forwarders_for_inbox_with_http_info(inbox_id, inbox_forwarder_test_options, opts = {}) click to toggle source

Test inbox forwarders for inbox Test inbox forwarders for inbox @param inbox_id [String] ID of inbox @param inbox_forwarder_test_options [InboxForwarderTestOptions] inboxForwarderTestOptions @param [Hash] opts the optional parameters @return [Array<(InboxForwarderTestResult, Integer, Hash)>] InboxForwarderTestResult data, response status code and response headers

# File lib/mailslurp_client/api/inbox_forwarder_controller_api.rb, line 436
def test_inbox_forwarders_for_inbox_with_http_info(inbox_id, inbox_forwarder_test_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxForwarderControllerApi.test_inbox_forwarders_for_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 InboxForwarderControllerApi.test_inbox_forwarders_for_inbox"
  end
  # verify the required parameter 'inbox_forwarder_test_options' is set
  if @api_client.config.client_side_validation && inbox_forwarder_test_options.nil?
    fail ArgumentError, "Missing the required parameter 'inbox_forwarder_test_options' when calling InboxForwarderControllerApi.test_inbox_forwarders_for_inbox"
  end
  # resource path
  local_var_path = '/forwarders'

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # 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(inbox_forwarder_test_options) 

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

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

Test new inbox forwarder Test new inbox forwarder @param test_new_inbox_forwarder_options [TestNewInboxForwarderOptions] testNewInboxForwarderOptions @param [Hash] opts the optional parameters @return [InboxForwarderTestResult]

# File lib/mailslurp_client/api/inbox_forwarder_controller_api.rb, line 495
def test_new_inbox_forwarder(test_new_inbox_forwarder_options, opts = {})
  data, _status_code, _headers = test_new_inbox_forwarder_with_http_info(test_new_inbox_forwarder_options, opts)
  data
end
test_new_inbox_forwarder_with_http_info(test_new_inbox_forwarder_options, opts = {}) click to toggle source

Test new inbox forwarder Test new inbox forwarder @param test_new_inbox_forwarder_options [TestNewInboxForwarderOptions] testNewInboxForwarderOptions @param [Hash] opts the optional parameters @return [Array<(InboxForwarderTestResult, Integer, Hash)>] InboxForwarderTestResult data, response status code and response headers

# File lib/mailslurp_client/api/inbox_forwarder_controller_api.rb, line 505
def test_new_inbox_forwarder_with_http_info(test_new_inbox_forwarder_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InboxForwarderControllerApi.test_new_inbox_forwarder ...'
  end
  # verify the required parameter 'test_new_inbox_forwarder_options' is set
  if @api_client.config.client_side_validation && test_new_inbox_forwarder_options.nil?
    fail ArgumentError, "Missing the required parameter 'test_new_inbox_forwarder_options' when calling InboxForwarderControllerApi.test_new_inbox_forwarder"
  end
  # resource path
  local_var_path = '/forwarders'

  # 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'])
  # 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(test_new_inbox_forwarder_options) 

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

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