class MailSlurpClient::ExportControllerApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

export_entities(api_key, export_type, output_format, opts = {}) click to toggle source

Export inboxes link callable via browser @param api_key [String] apiKey @param export_type [String] exportType @param output_format [String] outputFormat @param [Hash] opts the optional parameters @option opts [DateTime] :created_earliest_time createdEarliestTime @option opts [DateTime] :created_oldest_time createdOldestTime @option opts [Boolean] :exclude_previously_exported excludePreviouslyExported @option opts [String] :filter filter @option opts [String] :list_separator_token listSeparatorToken @return [String]

# File lib/mailslurp_client/api/export_controller_api.rb, line 33
def export_entities(api_key, export_type, output_format, opts = {})
  data, _status_code, _headers = export_entities_with_http_info(api_key, export_type, output_format, opts)
  data
end
export_entities_with_http_info(api_key, export_type, output_format, opts = {}) click to toggle source

Export inboxes link callable via browser @param api_key [String] apiKey @param export_type [String] exportType @param output_format [String] outputFormat @param [Hash] opts the optional parameters @option opts [DateTime] :created_earliest_time createdEarliestTime @option opts [DateTime] :created_oldest_time createdOldestTime @option opts [Boolean] :exclude_previously_exported excludePreviouslyExported @option opts [String] :filter filter @option opts [String] :list_separator_token listSeparatorToken @return [Array<(String, Integer, Hash)>] String data, response status code and response headers

# File lib/mailslurp_client/api/export_controller_api.rb, line 49
def export_entities_with_http_info(api_key, export_type, output_format, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExportControllerApi.export_entities ...'
  end
  # verify the required parameter 'api_key' is set
  if @api_client.config.client_side_validation && api_key.nil?
    fail ArgumentError, "Missing the required parameter 'api_key' when calling ExportControllerApi.export_entities"
  end
  # verify the required parameter 'export_type' is set
  if @api_client.config.client_side_validation && export_type.nil?
    fail ArgumentError, "Missing the required parameter 'export_type' when calling ExportControllerApi.export_entities"
  end
  # verify enum value
  allowable_values = ["INBOXES", "CONTACTS", "ATTACHMENTS", "EMAILS"]
  if @api_client.config.client_side_validation && !allowable_values.include?(export_type)
    fail ArgumentError, "invalid value for \"export_type\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'output_format' is set
  if @api_client.config.client_side_validation && output_format.nil?
    fail ArgumentError, "Missing the required parameter 'output_format' when calling ExportControllerApi.export_entities"
  end
  # verify enum value
  allowable_values = ["CSV_DEFAULT", "CSV_EXCEL"]
  if @api_client.config.client_side_validation && !allowable_values.include?(output_format)
    fail ArgumentError, "invalid value for \"output_format\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/export'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'apiKey'] = api_key
  query_params[:'exportType'] = export_type
  query_params[:'outputFormat'] = output_format
  query_params[:'createdEarliestTime'] = opts[:'created_earliest_time'] if !opts[:'created_earliest_time'].nil?
  query_params[:'createdOldestTime'] = opts[:'created_oldest_time'] if !opts[:'created_oldest_time'].nil?
  query_params[:'excludePreviouslyExported'] = opts[:'exclude_previously_exported'] if !opts[:'exclude_previously_exported'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'listSeparatorToken'] = opts[:'list_separator_token'] if !opts[:'list_separator_token'].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] || 'String' 

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