Class: SubskribeSandboxClient::AccountsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AccountsApi

Returns a new instance of AccountsApi.



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

def api_client
  @api_client
end

Instance Method Details

#add_account(opts = {}) ⇒ AccountJson

Add a new account Create an account with the specified parameters. On success, the id of the newly created account is returned

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



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

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

#add_account_contact(account_id, opts = {}) ⇒ AccountContactJson

Add a contact for an account Creates and adds a new contact for the specified account and returns the new contact ID

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :body (AccountContactJson)
  • :skip_address_validation (BOOLEAN)

    value = perform basic address validation

  • :strict_validation (BOOLEAN)

    value = require the address to match a canonical address, if it exists

Returns:



80
81
82
83
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 80

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

#add_account_contact_with_http_info(account_id, opts = {}) ⇒ Array<(AccountContactJson, Fixnum, Hash)>

Add a contact for an account Creates and adds a new contact for the specified account and returns the new contact ID

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :body (AccountContactJson)
  • :skip_address_validation (BOOLEAN)

    value &#x3D; perform basic address validation

  • :strict_validation (BOOLEAN)

    value &#x3D; require the address to match a canonical address, if it exists

Returns:

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

    AccountContactJson data, 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
125
126
127
128
129
130
131
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 93

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.add_account_contact ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.add_account_contact"
  end
  # resource path
  local_var_path = '/accounts/{accountId}/contacts'.sub('{' + 'accountId' + '}', .to_s)

  # query parameters
  query_params = {}
  query_params[:'skipAddressValidation'] = opts[:'skip_address_validation'] if !opts[:'skip_address_validation'].nil?
  query_params[:'strictValidation'] = opts[:'strict_validation'] if !opts[:'strict_validation'].nil?

  # 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 = @api_client.object_to_http_body(opts[:'body'])
  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 => 'AccountContactJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#add_account_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_account_payment_method(account_id, opts = {}) ⇒ AccountPaymentMethodJson

Add a payment method to an account Add a payment method to the specified account and return its ID

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



138
139
140
141
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 138

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

#add_account_payment_method_with_http_info(account_id, opts = {}) ⇒ Array<(AccountPaymentMethodJson, Fixnum, Hash)>

Add a payment method to an account Add a payment method to the specified account and return its ID

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    AccountPaymentMethodJson data, response status code and response headers



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

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.add_account_payment_method ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.add_account_payment_method"
  end
  # resource path
  local_var_path = '/accounts/{accountId}/paymentMethods'.sub('{' + 'accountId' + '}', .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 = @api_client.object_to_http_body(opts[:'body'])
  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 => 'AccountPaymentMethodJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#add_account_payment_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_account_with_http_info(opts = {}) ⇒ Array<(AccountJson, Fixnum, Hash)>

Add a new account Create an account with the specified parameters. On success, the id of the newly created account is returned

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    AccountJson 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
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 37

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.add_account ...'
  end
  # resource path
  local_var_path = '/accounts'

  # 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 = @api_client.object_to_http_body(opts[:'body'])
  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 => 'AccountJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#add_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_account(id, opts = {}) ⇒ nil

Delete an account Deletes the account associated with the passed ID

Parameters:

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

    the optional parameters

Returns:

  • (nil)


193
194
195
196
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 193

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

#delete_account_contact(contact_id, account_id, opts = {}) ⇒ nil

Delete a contact Deletes the contact specified by the account id and contact id

Parameters:

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

    the optional parameters

Returns:

  • (nil)


245
246
247
248
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 245

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

#delete_account_contact_with_http_info(contact_id, account_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a contact Deletes the contact specified by the account id and contact id

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 256

def (contact_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.delete_account_contact ...'
  end
  # verify the required parameter 'contact_id' is set
  if @api_client.config.client_side_validation && contact_id.nil?
    fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountsApi.delete_account_contact"
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.delete_account_contact"
  end
  # resource path
  local_var_path = '/accounts/{accountId}/contacts/{contactId}'.sub('{' + 'contactId' + '}', contact_id.to_s).sub('{' + 'accountId' + '}', .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(:DELETE, 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: AccountsApi#delete_account_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Delete an account Deletes the account associated with the passed ID

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 203

def (id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.delete_account ...'
  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 AccountsApi.delete_account"
  end
  # resource path
  local_var_path = '/accounts/{id}'.sub('{' + 'id' + '}', 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(:DELETE, 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: AccountsApi#delete_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_account(id, opts = {}) ⇒ AccountJson

Get an account by id Returns the details of the account specified by the passed id

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id_type (String)

Returns:



302
303
304
305
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 302

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

#get_account_contact(account_id, contact_id, opts = {}) ⇒ AccountContactJson

Gets contact details Returns the details of the specified contact

Parameters:

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

    the optional parameters

Returns:



360
361
362
363
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 360

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

#get_account_contact_with_http_info(account_id, contact_id, opts = {}) ⇒ Array<(AccountContactJson, Fixnum, Hash)>

Gets contact details Returns the details of the specified contact

Parameters:

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

    the optional parameters

Returns:

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

    AccountContactJson data, response status code and response headers



371
372
373
374
375
376
377
378
379
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
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 371

def (, contact_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.get_account_contact ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.get_account_contact"
  end
  # verify the required parameter 'contact_id' is set
  if @api_client.config.client_side_validation && contact_id.nil?
    fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountsApi.get_account_contact"
  end
  # resource path
  local_var_path = '/accounts/{accountId}/contacts/{contactId}'.sub('{' + 'accountId' + '}', .to_s).sub('{' + 'contactId' + '}', contact_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 => 'AccountContactJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_account_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_account_contacts(account_id, opts = {}) ⇒ Array<AccountContactJson>

Get contacts for an account Returns a list of contacts associated with the specified account id

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :expand (BOOLEAN)

Returns:



418
419
420
421
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 418

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

#get_account_contacts_with_http_info(account_id, opts = {}) ⇒ Array<(Array<AccountContactJson>, Fixnum, Hash)>

Get contacts for an account Returns a list of contacts associated with the specified account id

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :expand (BOOLEAN)

Returns:

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

    Array<AccountContactJson> data, response status code and response headers



429
430
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
464
465
466
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 429

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.get_account_contacts ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.get_account_contacts"
  end
  # resource path
  local_var_path = '/accounts/{accountId}/contacts'.sub('{' + 'accountId' + '}', .to_s)

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

  # 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 => 'Array<AccountContactJson>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_account_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_account_metrics(id, opts = {}) ⇒ MetricsJson

Returns metrics for the specified account Fetches metrics such as ARR, TCV, etc for the specified account as of the specified target date

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :target_date (Integer)

Returns:



473
474
475
476
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 473

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

#get_account_metrics_with_http_info(id, opts = {}) ⇒ Array<(MetricsJson, Fixnum, Hash)>

Returns metrics for the specified account Fetches metrics such as ARR, TCV, etc for the specified account as of the specified target date

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :target_date (Integer)

Returns:

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

    MetricsJson data, response status code and response headers



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
516
517
518
519
520
521
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 484

def (id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.get_account_metrics ...'
  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 AccountsApi.get_account_metrics"
  end
  # resource path
  local_var_path = '/accounts/{id}/metrics'.sub('{' + 'id' + '}', id.to_s)

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

  # 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 => 'MetricsJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_account_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_account_payment_methods(account_id, opts = {}) ⇒ Array<AccountPaymentMethodJson>

Get the payment methods for an account Returns a list of payment methods for the specified account id

Parameters:

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

    the optional parameters

Returns:



527
528
529
530
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 527

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

#get_account_payment_methods_with_http_info(account_id, opts = {}) ⇒ Array<(Array<AccountPaymentMethodJson>, Fixnum, Hash)>

Get the payment methods for an account Returns a list of payment methods for the specified account id

Parameters:

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

    the optional parameters

Returns:

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

    Array<AccountPaymentMethodJson> data, response status code and response headers



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
567
568
569
570
571
572
573
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 537

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.get_account_payment_methods ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.get_account_payment_methods"
  end
  # resource path
  local_var_path = '/accounts/{accountId}/paymentMethods'.sub('{' + 'accountId' + '}', .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 => 'Array<AccountPaymentMethodJson>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_account_payment_methods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_account_with_http_info(id, opts = {}) ⇒ Array<(AccountJson, Fixnum, Hash)>

Get an account by id Returns the details of the account specified by the passed id

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id_type (String)

Returns:

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

    AccountJson data, response status code and response headers



313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 313

def (id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.get_account ...'
  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 AccountsApi.get_account"
  end
  if @api_client.config.client_side_validation && opts[:'id_type'] && !['ACCOUNT_ID', 'CRM_ID', 'EXTERNAL_ID'].include?(opts[:'id_type'])
    fail ArgumentError, 'invalid value for "id_type", must be one of ACCOUNT_ID, CRM_ID, EXTERNAL_ID'
  end
  # resource path
  local_var_path = '/accounts/{id}'.sub('{' + 'id' + '}', id.to_s)

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

  # 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 => 'AccountJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_accounts(opts = {}) ⇒ PaginatedAccountsResponse

Get all accounts Returns a paginated list of accounts

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)
  • :limit (Integer)
  • :type (String)

Returns:



581
582
583
584
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 581

def get_accounts(opts = {})
  data, _status_code, _headers = get_accounts_with_http_info(opts)
  data
end

#get_accounts_with_http_info(opts = {}) ⇒ Array<(PaginatedAccountsResponse, Fixnum, Hash)>

Get all accounts Returns a paginated list of accounts

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)
  • :limit (Integer)
  • :type (String)

Returns:

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

    PaginatedAccountsResponse data, response status code and response headers



593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 593

def get_accounts_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.get_accounts ...'
  end
  # resource path
  local_var_path = '/accounts'

  # query parameters
  query_params = {}
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?

  # 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 => 'PaginatedAccountsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_payment_method(account_id, id, opts = {}) ⇒ AccountPaymentMethodJson

Get the details of a payment method Returns the details of the payment method for the specified account id and payment method id

Parameters:

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

    the optional parameters

Returns:



635
636
637
638
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 635

def get_payment_method(, id, opts = {})
  data, _status_code, _headers = get_payment_method_with_http_info(, id, opts)
  data
end

#get_payment_method_with_http_info(account_id, id, opts = {}) ⇒ Array<(AccountPaymentMethodJson, Fixnum, Hash)>

Get the details of a payment method Returns the details of the payment method for the specified account id and payment method id

Parameters:

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

    the optional parameters

Returns:

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

    AccountPaymentMethodJson data, response status code and response headers



646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 646

def get_payment_method_with_http_info(, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.get_payment_method ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.get_payment_method"
  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 AccountsApi.get_payment_method"
  end
  # resource path
  local_var_path = '/accounts/{accountId}/paymentMethods/{id}'.sub('{' + 'accountId' + '}', .to_s).sub('{' + 'id' + '}', 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 => 'AccountPaymentMethodJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#get_payment_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#import_crm_account(opts = {}) ⇒ CrmAccountImportResponse

Import an account from a CRM Ensures an account exists which matches the passed details.If an account exists that has a matching CRM Id, it will be updated, if not, it will be created

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



692
693
694
695
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 692

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

#import_crm_account_with_http_info(opts = {}) ⇒ Array<(CrmAccountImportResponse, Fixnum, Hash)>

Import an account from a CRM Ensures an account exists which matches the passed details.If an account exists that has a matching CRM Id, it will be updated, if not, it will be created

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    CrmAccountImportResponse data, response status code and response headers



702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 702

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.import_crm_account ...'
  end
  # resource path
  local_var_path = '/accounts/crm/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(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  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 => 'CrmAccountImportResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#import_crm_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_account(id, opts = {}) ⇒ nil

Update an account Updates an existing account with the specified parameters

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


743
744
745
746
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 743

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

#update_account_contact(account_id, contact_id, opts = {}) ⇒ nil

Update a contact Updates the contact specified by the account id and contact id with the passed information

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :body (AccountContactJson)
  • :skip_address_validation (BOOLEAN)
  • :strict_validation (BOOLEAN)

Returns:

  • (nil)


801
802
803
804
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 801

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

#update_account_contact_with_http_info(account_id, contact_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update a contact Updates the contact specified by the account id and contact id with the passed information

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :body (AccountContactJson)
  • :skip_address_validation (BOOLEAN)
  • :strict_validation (BOOLEAN)

Returns:

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

    nil, response status code and response headers



815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 815

def (, contact_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.update_account_contact ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountsApi.update_account_contact"
  end
  # verify the required parameter 'contact_id' is set
  if @api_client.config.client_side_validation && contact_id.nil?
    fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountsApi.update_account_contact"
  end
  # resource path
  local_var_path = '/accounts/{accountId}/contacts/{contactId}'.sub('{' + 'accountId' + '}', .to_s).sub('{' + 'contactId' + '}', contact_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'skipAddressValidation'] = opts[:'skip_address_validation'] if !opts[:'skip_address_validation'].nil?
  query_params[:'strictValidation'] = opts[:'strict_validation'] if !opts[:'strict_validation'].nil?

  # 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 = @api_client.object_to_http_body(opts[:'body'])
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#update_account_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Update an account Updates an existing account with the specified parameters

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    nil, response status code and response headers



754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
# File 'lib/subskribe_sandbox/api/accounts_api.rb', line 754

def (id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.update_account ...'
  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 AccountsApi.update_account"
  end
  # resource path
  local_var_path = '/accounts/{id}'.sub('{' + 'id' + '}', 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'])
  # 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 = @api_client.object_to_http_body(opts[:'body'])
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#update_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end