Class: MailSlurpClient::ExportControllerApi

Inherits:
Object
  • Object
show all
Defined in:
lib/mailslurp_client/api/export_controller_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ExportControllerApi

Returns a new instance of ExportControllerApi.



19
20
21
# File 'lib/mailslurp_client/api/export_controller_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/mailslurp_client/api/export_controller_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#export_entities(export_type, api_key, output_format, opts = {}) ⇒ String

Export inboxes link callable via browser

Parameters:

  • export_type (String)
  • api_key (String)
  • output_format (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :filter (String)
  • :list_separator_token (String)
  • :exclude_previously_exported (Boolean)
  • :created_earliest_time (DateTime)
  • :created_oldest_time (DateTime)

Returns:

  • (String)


33
34
35
36
# File 'lib/mailslurp_client/api/export_controller_api.rb', line 33

def export_entities(export_type, api_key, output_format, opts = {})
  data, _status_code, _headers = export_entities_with_http_info(export_type, api_key, output_format, opts)
  data
end

#export_entities_with_http_info(export_type, api_key, output_format, opts = {}) ⇒ Array<(String, Integer, Hash)>

Export inboxes link callable via browser

Parameters:

  • export_type (String)
  • api_key (String)
  • output_format (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :filter (String)
  • :list_separator_token (String)
  • :exclude_previously_exported (Boolean)
  • :created_earliest_time (DateTime)
  • :created_oldest_time (DateTime)

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/mailslurp_client/api/export_controller_api.rb', line 49

def export_entities_with_http_info(export_type, api_key, output_format, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: 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 '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 '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[:'exportType'] = export_type
  query_params[:'apiKey'] = api_key
  query_params[:'outputFormat'] = output_format
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'listSeparatorToken'] = opts[:'list_separator_token'] if !opts[:'list_separator_token'].nil?
  query_params[:'excludePreviouslyExported'] = opts[:'exclude_previously_exported'] if !opts[:'exclude_previously_exported'].nil?
  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?

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

  # 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

Get export link

Parameters:

  • export_type (String)
  • export_options (ExportOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :api_key (String)

Returns:



128
129
130
131
# File 'lib/mailslurp_client/api/export_controller_api.rb', line 128

def get_export_link(export_type, export_options, opts = {})
  data, _status_code, _headers = get_export_link_with_http_info(export_type, export_options, opts)
  data
end

Get export link

Parameters:

  • export_type (String)
  • export_options (ExportOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :api_key (String)

Returns:

  • (Array<(ExportLink, Integer, Hash)>)

    ExportLink data, response status code and response headers



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/mailslurp_client/api/export_controller_api.rb', line 139

def get_export_link_with_http_info(export_type, export_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExportControllerApi.get_export_link ...'
  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.get_export_link"
  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 'export_options' is set
  if @api_client.config.client_side_validation && export_options.nil?
    fail ArgumentError, "Missing the required parameter 'export_options' when calling ExportControllerApi.get_export_link"
  end
  # resource path
  local_var_path = '/export'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'exportType'] = export_type
  query_params[:'apiKey'] = opts[:'api_key'] if !opts[:'api_key'].nil?

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

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

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