Class: SubskribeSandboxClient::ImportApi

Inherits:
Object
  • Object
show all
Defined in:
lib/subskribe_sandbox/api/import_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ImportApi

Returns a new instance of ImportApi.



19
20
21
# File 'lib/subskribe_sandbox/api/import_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/subskribe_sandbox/api/import_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_flatfile_workbook(domain, opts = {}) ⇒ FlatfileWorkbookResponse

Create a Flatfile workbook Creates a Flatfile workbook and adds it to a space

Parameters:

  • domain

    the domain to import

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/subskribe_sandbox/api/import_api.rb', line 27

def create_flatfile_workbook(domain, opts = {})
  data, _status_code, _headers = create_flatfile_workbook_with_http_info(domain, opts)
  data
end

#create_flatfile_workbook_with_http_info(domain, opts = {}) ⇒ Array<(FlatfileWorkbookResponse, Fixnum, Hash)>

Create a Flatfile workbook Creates a Flatfile workbook and adds it to a space

Parameters:

  • domain

    the domain to import

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(FlatfileWorkbookResponse, Fixnum, Hash)>)

    FlatfileWorkbookResponse data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
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
# File 'lib/subskribe_sandbox/api/import_api.rb', line 37

def create_flatfile_workbook_with_http_info(domain, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImportApi.create_flatfile_workbook ...'
  end
  # verify the required parameter 'domain' is set
  if @api_client.config.client_side_validation && domain.nil?
    fail ArgumentError, "Missing the required parameter 'domain' when calling ImportApi.create_flatfile_workbook"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['ORDER'].include?(domain)
    fail ArgumentError, "invalid value for 'domain', must be one of ORDER"
  end
  # resource path
  local_var_path = '/import/flatfile/{domain}'.sub('{' + 'domain' + '}', domain.to_s)

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'FlatfileWorkbookResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImportApi#create_flatfile_workbook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_account_contacts_in_import_format(opts = {}) ⇒ nil

Get account contacts for export Gets account contacts in a format appropriate for re-import. On success, the output is a csv containing the account and contacts.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


84
85
86
87
# File 'lib/subskribe_sandbox/api/import_api.rb', line 84

def (opts = {})
  (opts)
  nil
end

#get_account_contacts_in_import_format_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get account contacts for export Gets account contacts in a format appropriate for re-import. On success, the output is a csv containing the account and contacts.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



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
121
122
123
124
# File 'lib/subskribe_sandbox/api/import_api.rb', line 93

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImportApi.get_account_contacts_in_import_format ...'
  end
  # resource path
  local_var_path = '/import/export/accountContact'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImportApi#get_account_contacts_in_import_format\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_amendment_order_export_in_import_format(opts = {}) ⇒ nil

Get amendment orders in import CSV format Gets amendment orders in a format appropriate for re-import for the given generation. On success, the output is a csv containing the orders.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :generation (Integer)

    the generation of amendments to include in the export, generations are defined as 1 based index of number of amendments applied to subscription

  • :use_real_ids (BOOLEAN)

    use the subskribe ID instead of external ID for exported objects

Returns:

  • (nil)


131
132
133
134
# File 'lib/subskribe_sandbox/api/import_api.rb', line 131

def get_amendment_order_export_in_import_format(opts = {})
  get_amendment_order_export_in_import_format_with_http_info(opts)
  nil
end

#get_amendment_order_export_in_import_format_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get amendment orders in import CSV format Gets amendment orders in a format appropriate for re-import for the given generation. On success, the output is a csv containing the orders.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :generation (Integer)

    the generation of amendments to include in the export, generations are defined as 1 based index of number of amendments applied to subscription

  • :use_real_ids (BOOLEAN)

    use the subskribe ID instead of external ID for exported objects

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



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
# File 'lib/subskribe_sandbox/api/import_api.rb', line 142

def get_amendment_order_export_in_import_format_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImportApi.get_amendment_order_export_in_import_format ...'
  end
  # resource path
  local_var_path = '/import/export/amendmentOrders'

  # query parameters
  query_params = {}
  query_params[:'generation'] = opts[:'generation'] if !opts[:'generation'].nil?
  query_params[:'useRealIds'] = opts[:'use_real_ids'] if !opts[:'use_real_ids'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImportApi#get_amendment_order_export_in_import_format\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_available_schemas(opts = {}) ⇒ Hash<String, Array<Object>>

Return available schemas Returns the set of schemas available for import

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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


180
181
182
183
# File 'lib/subskribe_sandbox/api/import_api.rb', line 180

def get_available_schemas(opts = {})
  data, _status_code, _headers = get_available_schemas_with_http_info(opts)
  data
end

#get_available_schemas_with_http_info(opts = {}) ⇒ Array<(Hash<String, Array<Object>>, Fixnum, Hash)>

Return available schemas Returns the set of schemas available for import

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Hash<String, Array<Object>>, Fixnum, Hash)>)

    Hash<String, Array<Object>> data, response status code and response headers



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/subskribe_sandbox/api/import_api.rb', line 189

def get_available_schemas_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImportApi.get_available_schemas ...'
  end
  # resource path
  local_var_path = '/import/schemas'

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Hash<String, Array<Object>>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImportApi#get_available_schemas\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_catalog_data_in_import_format(opts = {}) ⇒ nil

Get catalog data for export Gets catalog data in a format appropriate for re-import. On success, the output is a csv containing the catalog data containing Product, Plan and Charge data.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


226
227
228
229
# File 'lib/subskribe_sandbox/api/import_api.rb', line 226

def get_catalog_data_in_import_format(opts = {})
  get_catalog_data_in_import_format_with_http_info(opts)
  nil
end

#get_catalog_data_in_import_format_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get catalog data for export Gets catalog data in a format appropriate for re-import. On success, the output is a csv containing the catalog data containing Product, Plan and Charge data.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/subskribe_sandbox/api/import_api.rb', line 235

def get_catalog_data_in_import_format_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImportApi.get_catalog_data_in_import_format ...'
  end
  # resource path
  local_var_path = '/import/export/catalog'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImportApi#get_catalog_data_in_import_format\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_data_import_by_id(import_id, opts = {}) ⇒ DataImport

Gets an import item Gets an item that was imported by its ID

Parameters:

  • import_id

    id of the item

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



272
273
274
275
# File 'lib/subskribe_sandbox/api/import_api.rb', line 272

def get_data_import_by_id(import_id, opts = {})
  data, _status_code, _headers = get_data_import_by_id_with_http_info(import_id, opts)
  data
end

#get_data_import_by_id_with_http_info(import_id, opts = {}) ⇒ Array<(DataImport, Fixnum, Hash)>

Gets an import item Gets an item that was imported by its ID

Parameters:

  • import_id

    id of the item

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DataImport, Fixnum, Hash)>)

    DataImport data, response status code and response headers



282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# File 'lib/subskribe_sandbox/api/import_api.rb', line 282

def get_data_import_by_id_with_http_info(import_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImportApi.get_data_import_by_id ...'
  end
  # verify the required parameter 'import_id' is set
  if @api_client.config.client_side_validation && import_id.nil?
    fail ArgumentError, "Missing the required parameter 'import_id' when calling ImportApi.get_data_import_by_id"
  end
  # resource path
  local_var_path = '/import/{importId}'.sub('{' + 'importId' + '}', import_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DataImport')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImportApi#get_data_import_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_data_imports(opts = {}) ⇒ DataImport

Gets all import items Gets all items that was imported

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



323
324
325
326
# File 'lib/subskribe_sandbox/api/import_api.rb', line 323

def get_data_imports(opts = {})
  data, _status_code, _headers = get_data_imports_with_http_info(opts)
  data
end

#get_data_imports_with_http_info(opts = {}) ⇒ Array<(DataImport, Fixnum, Hash)>

Gets all import items Gets all items that was imported

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DataImport, Fixnum, Hash)>)

    DataImport data, response status code and response headers



332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# File 'lib/subskribe_sandbox/api/import_api.rb', line 332

def get_data_imports_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImportApi.get_data_imports ...'
  end
  # resource path
  local_var_path = '/import'

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DataImport')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImportApi#get_data_imports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_import_result1(import_id, opts = {}) ⇒ nil

Get import details Returns the details of an import by its ID

Parameters:

  • import_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


370
371
372
373
# File 'lib/subskribe_sandbox/api/import_api.rb', line 370

def get_import_result1(import_id, opts = {})
  get_import_result1_with_http_info(import_id, opts)
  nil
end

#get_import_result1_with_http_info(import_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get import details Returns the details of an import by its ID

Parameters:

  • import_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/subskribe_sandbox/api/import_api.rb', line 380

def get_import_result1_with_http_info(import_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImportApi.get_import_result1 ...'
  end
  # verify the required parameter 'import_id' is set
  if @api_client.config.client_side_validation && import_id.nil?
    fail ArgumentError, "Missing the required parameter 'import_id' when calling ImportApi.get_import_result1"
  end
  # resource path
  local_var_path = '/import/{importId}/result'.sub('{' + 'importId' + '}', import_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImportApi#get_import_result1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_new_order_export_in_import_format(opts = {}) ⇒ nil

Get new orders in import CSV format Gets new orders in a format appropriate for re-import. On success, the output is a csv containing the orders.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :use_real_ids (BOOLEAN)

    use the subskribe ID instead of external ID for exported objects

Returns:

  • (nil)


421
422
423
424
# File 'lib/subskribe_sandbox/api/import_api.rb', line 421

def get_new_order_export_in_import_format(opts = {})
  get_new_order_export_in_import_format_with_http_info(opts)
  nil
end

#get_new_order_export_in_import_format_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get new orders in import CSV format Gets new orders in a format appropriate for re-import. On success, the output is a csv containing the orders.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :use_real_ids (BOOLEAN)

    use the subskribe ID instead of external ID for exported objects

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
# File 'lib/subskribe_sandbox/api/import_api.rb', line 431

def get_new_order_export_in_import_format_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImportApi.get_new_order_export_in_import_format ...'
  end
  # resource path
  local_var_path = '/import/export/newOrders'

  # query parameters
  query_params = {}
  query_params[:'useRealIds'] = opts[:'use_real_ids'] if !opts[:'use_real_ids'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImportApi#get_new_order_export_in_import_format\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#process_import(import_id, opts = {}) ⇒ DataImport

Process an import by ID Processes the import specified.

Parameters:

  • import_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



469
470
471
472
# File 'lib/subskribe_sandbox/api/import_api.rb', line 469

def process_import(import_id, opts = {})
  data, _status_code, _headers = process_import_with_http_info(import_id, opts)
  data
end

#process_import_with_http_info(import_id, opts = {}) ⇒ Array<(DataImport, Fixnum, Hash)>

Process an import by ID Processes the import specified.

Parameters:

  • import_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DataImport, Fixnum, Hash)>)

    DataImport data, response status code and response headers



479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# File 'lib/subskribe_sandbox/api/import_api.rb', line 479

def process_import_with_http_info(import_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImportApi.process_import ...'
  end
  # verify the required parameter 'import_id' is set
  if @api_client.config.client_side_validation && import_id.nil?
    fail ArgumentError, "Missing the required parameter 'import_id' when calling ImportApi.process_import"
  end
  # resource path
  local_var_path = '/import/{importId}/process'.sub('{' + 'importId' + '}', import_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DataImport')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImportApi#process_import\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#validate_multi_part_file_import(opts = {}) ⇒ String

Validate import file Validates a multi-part import file. Returns an import ID on success.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :file (File)

Returns:

  • (String)


521
522
523
524
# File 'lib/subskribe_sandbox/api/import_api.rb', line 521

def validate_multi_part_file_import(opts = {})
  data, _status_code, _headers = validate_multi_part_file_import_with_http_info(opts)
  data
end

#validate_multi_part_file_import_with_http_info(opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Validate import file Validates a multi-part import file. Returns an import ID on success.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :file (File)

Returns:

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

    String data, response status code and response headers



531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
# File 'lib/subskribe_sandbox/api/import_api.rb', line 531

def validate_multi_part_file_import_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ImportApi.validate_multi_part_file_import ...'
  end
  # resource path
  local_var_path = '/import'

  # query parameters
  query_params = {}

  # header parameters
  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(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params['file'] = opts[:'file'] if !opts[:'file'].nil?

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ImportApi#validate_multi_part_file_import\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end