Class: Billabear::CustomersApi

Inherits:
Object
  • Object
show all
Defined in:
lib/billabear/api/customers_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ CustomersApi

Returns a new instance of CustomersApi.



16
17
18
# File 'lib/billabear/api/customers_api.rb', line 16

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/billabear/api/customers_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#add_seats_subscriptions(body, subscription_id, opts = {}) ⇒ InlineResponse20013

Add Seats Adds seats to a per seat subscription
<strong>Since 1.1.4</strong>

Parameters:

  • body
  • subscription_id

    The id of the subscription to retrieve

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

    the optional parameters

Returns:



25
26
27
28
# File 'lib/billabear/api/customers_api.rb', line 25

def add_seats_subscriptions(body, subscription_id, opts = {})
  data, _status_code, _headers = add_seats_subscriptions_with_http_info(body, subscription_id, opts)
  data
end

#add_seats_subscriptions_with_http_info(body, subscription_id, opts = {}) ⇒ Array<(InlineResponse20013, Integer, Hash)>

Add Seats Adds seats to a per seat subscription&lt;br&gt;&lt;br&gt;&lt;strong&gt;Since 1.1.4&lt;/strong&gt;

Parameters:

  • body
  • subscription_id

    The id of the subscription to retrieve

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

    the optional parameters

Returns:

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

    InlineResponse20013 data, response status code and response headers



36
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
80
81
82
# File 'lib/billabear/api/customers_api.rb', line 36

def add_seats_subscriptions_with_http_info(body, subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.add_seats_subscriptions ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CustomersApi.add_seats_subscriptions"
  end
  # verify the required parameter 'subscription_id' is set
  if @api_client.config.client_side_validation && subscription_id.nil?
    fail ArgumentError, "Missing the required parameter 'subscription_id' when calling CustomersApi.add_seats_subscriptions"
  end
  # resource path
  local_var_path = '/subscription/{subscriptionId}/seats/add'.sub('{' + 'subscriptionId' + '}', subscription_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(body) 

  return_type = opts[:return_type] || 'InlineResponse20013' 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#add_seats_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#apply_voucher_to_customer(body, customer_id, opts = {}) ⇒ nil

Apply voucher Apply Voucher to Customer

Parameters:

  • body
  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:

  • (nil)


89
90
91
92
# File 'lib/billabear/api/customers_api.rb', line 89

def apply_voucher_to_customer(body, customer_id, opts = {})
  apply_voucher_to_customer_with_http_info(body, customer_id, opts)
  nil
end

#apply_voucher_to_customer_with_http_info(body, customer_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Apply voucher Apply Voucher to Customer

Parameters:

  • body
  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/billabear/api/customers_api.rb', line 100

def apply_voucher_to_customer_with_http_info(body, customer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.apply_voucher_to_customer ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CustomersApi.apply_voucher_to_customer"
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.apply_voucher_to_customer"
  end
  # resource path
  local_var_path = '/customer/{customerId}/voucher'.sub('{' + 'customerId' + '}', customer_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(body) 

  return_type = opts[:return_type] 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#apply_voucher_to_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_customer(body, opts = {}) ⇒ Customer

Create Create a customer

Parameters:

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

    the optional parameters

Returns:



152
153
154
155
# File 'lib/billabear/api/customers_api.rb', line 152

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

#create_customer_usage_limit(body, customer_id, opts = {}) ⇒ UsageLimit

Create Usage Limit Create Usage Limit for the custoemr

Parameters:

  • body
  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:



211
212
213
214
# File 'lib/billabear/api/customers_api.rb', line 211

def create_customer_usage_limit(body, customer_id, opts = {})
  data, _status_code, _headers = create_customer_usage_limit_with_http_info(body, customer_id, opts)
  data
end

#create_customer_usage_limit_with_http_info(body, customer_id, opts = {}) ⇒ Array<(UsageLimit, Integer, Hash)>

Create Usage Limit Create Usage Limit for the custoemr

Parameters:

  • body
  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:

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

    UsageLimit data, response status code and response headers



222
223
224
225
226
227
228
229
230
231
232
233
234
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
267
268
# File 'lib/billabear/api/customers_api.rb', line 222

def create_customer_usage_limit_with_http_info(body, customer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.create_customer_usage_limit ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CustomersApi.create_customer_usage_limit"
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.create_customer_usage_limit"
  end
  # resource path
  local_var_path = '/customer/{customerId}/uasge-limit'.sub('{' + 'customerId' + '}', customer_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(body) 

  return_type = opts[:return_type] || 'UsageLimit' 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#create_customer_usage_limit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_customer_with_http_info(body, opts = {}) ⇒ Array<(Customer, Integer, Hash)>

Create Create a customer

Parameters:

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

    the optional parameters

Returns:

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

    Customer data, response status code and response headers



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
198
199
200
201
202
203
204
# File 'lib/billabear/api/customers_api.rb', line 162

def create_customer_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.create_customer ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CustomersApi.create_customer"
  end
  # resource path
  local_var_path = '/customer'

  # 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(body) 

  return_type = opts[:return_type] || 'Customer' 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#create_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#customer_customer_id_uasge_limit_limit_id_delete(customer_id, usage_limit_id, opts = {}) ⇒ nil

Delete Usage Limit Delete Usage Limit for the custoemr

Parameters:

  • customer_id

    The id of the customer to retrieve

  • usage_limit_id

    The id of the usage limit

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

    the optional parameters

Returns:

  • (nil)


275
276
277
278
# File 'lib/billabear/api/customers_api.rb', line 275

def customer_customer_id_uasge_limit_limit_id_delete(customer_id, usage_limit_id, opts = {})
  customer_customer_id_uasge_limit_limit_id_delete_with_http_info(customer_id, usage_limit_id, opts)
  nil
end

#customer_customer_id_uasge_limit_limit_id_delete_with_http_info(customer_id, usage_limit_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete Usage Limit Delete Usage Limit for the custoemr

Parameters:

  • customer_id

    The id of the customer to retrieve

  • usage_limit_id

    The id of the usage limit

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
319
320
321
322
323
324
325
326
327
328
# File 'lib/billabear/api/customers_api.rb', line 286

def customer_customer_id_uasge_limit_limit_id_delete_with_http_info(customer_id, usage_limit_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.customer_customer_id_uasge_limit_limit_id_delete ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.customer_customer_id_uasge_limit_limit_id_delete"
  end
  # verify the required parameter 'usage_limit_id' is set
  if @api_client.config.client_side_validation && usage_limit_id.nil?
    fail ArgumentError, "Missing the required parameter 'usage_limit_id' when calling CustomersApi.customer_customer_id_uasge_limit_limit_id_delete"
  end
  # resource path
  local_var_path = '/customer/{customerId}/uasge-limit/{limitId}'.sub('{' + 'customerId' + '}', customer_id.to_s).sub('{' + 'usageLimitId' + '}', usage_limit_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 = opts[:return_type] 

  auth_names = opts[: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,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#customer_customer_id_uasge_limit_limit_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#disable_customer(customer_id, opts = {}) ⇒ nil

Disable Customer Disable customer

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:

  • (nil)


334
335
336
337
# File 'lib/billabear/api/customers_api.rb', line 334

def disable_customer(customer_id, opts = {})
  disable_customer_with_http_info(customer_id, opts)
  nil
end

#disable_customer_with_http_info(customer_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Disable Customer Disable customer

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/billabear/api/customers_api.rb', line 344

def disable_customer_with_http_info(customer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.disable_customer ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.disable_customer"
  end
  # resource path
  local_var_path = '/customer/{customerId}/disable'.sub('{' + 'customerId' + '}', customer_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 = opts[:return_type] 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#disable_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#enable_customer(customer_id, opts = {}) ⇒ nil

Enable Customer Enable a customer

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:

  • (nil)


390
391
392
393
# File 'lib/billabear/api/customers_api.rb', line 390

def enable_customer(customer_id, opts = {})
  enable_customer_with_http_info(customer_id, opts)
  nil
end

#enable_customer_with_http_info(customer_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Enable Customer Enable a customer

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'lib/billabear/api/customers_api.rb', line 400

def enable_customer_with_http_info(customer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.enable_customer ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.enable_customer"
  end
  # resource path
  local_var_path = '/customer/{customerId}/enable'.sub('{' + 'customerId' + '}', customer_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 = opts[:return_type] 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#enable_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_active_for_customer(customer_id, opts = {}) ⇒ InlineResponse2008

List Customer Active Subscriptions List all Active customer subscriptions

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:



446
447
448
449
# File 'lib/billabear/api/customers_api.rb', line 446

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

#get_active_for_customer_with_http_info(customer_id, opts = {}) ⇒ Array<(InlineResponse2008, Integer, Hash)>

List Customer Active Subscriptions List all Active customer subscriptions

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:

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

    InlineResponse2008 data, response status code and response headers



456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
# File 'lib/billabear/api/customers_api.rb', line 456

def get_active_for_customer_with_http_info(customer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.get_active_for_customer ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.get_active_for_customer"
  end
  # resource path
  local_var_path = '/customer/{customerId}/subscription/active'.sub('{' + 'customerId' + '}', customer_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 = opts[:return_type] || 'InlineResponse2008' 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#get_active_for_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_customers(opts = {}) ⇒ InlineResponse200

List List all customers

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    How many items to return at one time (max 100)

  • :last_key (String)

    The key to be used in pagination to say what the last key of the previous page was

  • :email (String)

    The email to search for

  • :country (String)

    The country code to search for

  • :reference (String)

    The reference to search for

  • :external_reference (String)

    The external reference to search for

  • :company_name (String)

    The company name to search for

Returns:



508
509
510
511
# File 'lib/billabear/api/customers_api.rb', line 508

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

#get_all_customers_with_http_info(opts = {}) ⇒ Array<(InlineResponse200, Integer, Hash)>

List List all customers

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    How many items to return at one time (max 100)

  • :last_key (String)

    The key to be used in pagination to say what the last key of the previous page was

  • :email (String)

    The email to search for

  • :country (String)

    The country code to search for

  • :reference (String)

    The reference to search for

  • :external_reference (String)

    The external reference to search for

  • :company_name (String)

    The company name to search for

Returns:

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

    InlineResponse200 data, response status code and response headers



524
525
526
527
528
529
530
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
567
# File 'lib/billabear/api/customers_api.rb', line 524

def get_all_customers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.get_all_customers ...'
  end
  # resource path
  local_var_path = '/customer'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'last_key'] = opts[:'last_key'] if !opts[:'last_key'].nil?
  query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil?
  query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
  query_params[:'reference'] = opts[:'reference'] if !opts[:'reference'].nil?
  query_params[:'external_reference'] = opts[:'external_reference'] if !opts[:'external_reference'].nil?
  query_params[:'company_name'] = opts[:'company_name'] if !opts[:'company_name'].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 = opts[:return_type] || 'InlineResponse200' 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#get_all_customers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_customer_by_id(customer_id, opts = {}) ⇒ Customer

Detail Info for a specific customer

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:



573
574
575
576
# File 'lib/billabear/api/customers_api.rb', line 573

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

#get_customer_by_id_with_http_info(customer_id, opts = {}) ⇒ Array<(Customer, Integer, Hash)>

Detail Info for a specific customer

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:

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

    Customer data, response status code and response headers



583
584
585
586
587
588
589
590
591
592
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
# File 'lib/billabear/api/customers_api.rb', line 583

def get_customer_by_id_with_http_info(customer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.get_customer_by_id ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.get_customer_by_id"
  end
  # resource path
  local_var_path = '/customer/{customerId}'.sub('{' + 'customerId' + '}', customer_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 = opts[:return_type] || 'Customer' 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#get_customer_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_customer_costs(customer_id, opts = {}) ⇒ InlineResponse2001

Usage Cost Estimate The estimated costs from usage based billing for a customer

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:



629
630
631
632
# File 'lib/billabear/api/customers_api.rb', line 629

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

#get_customer_costs_with_http_info(customer_id, opts = {}) ⇒ Array<(InlineResponse2001, Integer, Hash)>

Usage Cost Estimate The estimated costs from usage based billing for a customer

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:

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

    InlineResponse2001 data, response status code and response headers



639
640
641
642
643
644
645
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
# File 'lib/billabear/api/customers_api.rb', line 639

def get_customer_costs_with_http_info(customer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.get_customer_costs ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.get_customer_costs"
  end
  # resource path
  local_var_path = '/customer/{customerId}/costs'.sub('{' + 'customerId' + '}', customer_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 = opts[:return_type] || 'InlineResponse2001' 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#get_customer_costs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_customer_limits_by_id(customer_id, opts = {}) ⇒ InlineResponse2002

Fetch Customer Limits Limits for a specific customer

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:



685
686
687
688
# File 'lib/billabear/api/customers_api.rb', line 685

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

#get_customer_limits_by_id_with_http_info(customer_id, opts = {}) ⇒ Array<(InlineResponse2002, Integer, Hash)>

Fetch Customer Limits Limits for a specific customer

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:

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

    InlineResponse2002 data, response status code and response headers



695
696
697
698
699
700
701
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
# File 'lib/billabear/api/customers_api.rb', line 695

def get_customer_limits_by_id_with_http_info(customer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.get_customer_limits_by_id ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.get_customer_limits_by_id"
  end
  # resource path
  local_var_path = '/customer/{customerId}/limits'.sub('{' + 'customerId' + '}', customer_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 = opts[:return_type] || 'InlineResponse2002' 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#get_customer_limits_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_customer_usage_limits_by_id(customer_id, opts = {}) ⇒ InlineResponse2005

Fetch Customer Usage Limits Usage Limits for a specific customer

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:



741
742
743
744
# File 'lib/billabear/api/customers_api.rb', line 741

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

#get_customer_usage_limits_by_id_with_http_info(customer_id, opts = {}) ⇒ Array<(InlineResponse2005, Integer, Hash)>

Fetch Customer Usage Limits Usage Limits for a specific customer

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:

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

    InlineResponse2005 data, response status code and response headers



751
752
753
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/billabear/api/customers_api.rb', line 751

def get_customer_usage_limits_by_id_with_http_info(customer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.get_customer_usage_limits_by_id ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.get_customer_usage_limits_by_id"
  end
  # resource path
  local_var_path = '/customer/{customerId}/uasge-limit'.sub('{' + 'customerId' + '}', customer_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 = opts[:return_type] || 'InlineResponse2005' 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#get_customer_usage_limits_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_for_customer(customer_id, opts = {}) ⇒ InlineResponse2008

List Customer Subscriptions List all customer subscriptions
<strong>Since 1.1</strong>

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:



797
798
799
800
# File 'lib/billabear/api/customers_api.rb', line 797

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

#get_for_customer_with_http_info(customer_id, opts = {}) ⇒ Array<(InlineResponse2008, Integer, Hash)>

List Customer Subscriptions List all customer subscriptions&lt;br&gt;&lt;br&gt;&lt;strong&gt;Since 1.1&lt;/strong&gt;

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:

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

    InlineResponse2008 data, response status code and response headers



807
808
809
810
811
812
813
814
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
# File 'lib/billabear/api/customers_api.rb', line 807

def get_for_customer_with_http_info(customer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.get_for_customer ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.get_for_customer"
  end
  # resource path
  local_var_path = '/customer/{customerId}/subscription'.sub('{' + 'customerId' + '}', customer_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 = opts[:return_type] || 'InlineResponse2008' 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#get_for_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoices_for_customer(customer_id, opts = {}) ⇒ InlineResponse2006

List Customer Invoices List Customer Invoices

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:



853
854
855
856
# File 'lib/billabear/api/customers_api.rb', line 853

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

#get_invoices_for_customer_with_http_info(customer_id, opts = {}) ⇒ Array<(InlineResponse2006, Integer, Hash)>

List Customer Invoices List Customer Invoices

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:

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

    InlineResponse2006 data, response status code and response headers



863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
# File 'lib/billabear/api/customers_api.rb', line 863

def get_invoices_for_customer_with_http_info(customer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.get_invoices_for_customer ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.get_invoices_for_customer"
  end
  # resource path
  local_var_path = '/customer/{customerId}/invoices'.sub('{' + 'customerId' + '}', customer_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 = opts[:return_type] || 'InlineResponse2006' 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#get_invoices_for_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_payments_for_customer(customer_id, opts = {}) ⇒ InlineResponse2004

List Customer Payments List Customer Payment

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    How many items to return at one time (max 100)

  • :last_key (String)

    The key to be used in pagination to say what the last key of the previous page was

  • :name (String)

    The name to search for

Returns:



912
913
914
915
# File 'lib/billabear/api/customers_api.rb', line 912

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

#get_payments_for_customer_with_http_info(customer_id, opts = {}) ⇒ Array<(InlineResponse2004, Integer, Hash)>

List Customer Payments List Customer Payment

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    How many items to return at one time (max 100)

  • :last_key (String)

    The key to be used in pagination to say what the last key of the previous page was

  • :name (String)

    The name to search for

Returns:

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

    InlineResponse2004 data, response status code and response headers



925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
# File 'lib/billabear/api/customers_api.rb', line 925

def get_payments_for_customer_with_http_info(customer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.get_payments_for_customer ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.get_payments_for_customer"
  end
  # resource path
  local_var_path = '/customer/{customerId}/payment'.sub('{' + 'customerId' + '}', customer_id.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'last_key'] = opts[:'last_key'] if !opts[:'last_key'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].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 = opts[:return_type] || 'InlineResponse2004' 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#get_payments_for_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_refunds_for_customer(customer_id, opts = {}) ⇒ InlineResponse2003

List Customer Refunds List Customer Refund

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    How many items to return at one time (max 100)

  • :last_key (String)

    The key to be used in pagination to say what the last key of the previous page was

  • :name (String)

    The name to search for

Returns:



977
978
979
980
# File 'lib/billabear/api/customers_api.rb', line 977

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

#get_refunds_for_customer_with_http_info(customer_id, opts = {}) ⇒ Array<(InlineResponse2003, Integer, Hash)>

List Customer Refunds List Customer Refund

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    How many items to return at one time (max 100)

  • :last_key (String)

    The key to be used in pagination to say what the last key of the previous page was

  • :name (String)

    The name to search for

Returns:

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

    InlineResponse2003 data, response status code and response headers



990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
# File 'lib/billabear/api/customers_api.rb', line 990

def get_refunds_for_customer_with_http_info(customer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.get_refunds_for_customer ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.get_refunds_for_customer"
  end
  # resource path
  local_var_path = '/customer/{customerId}/refund'.sub('{' + 'customerId' + '}', customer_id.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'last_key'] = opts[:'last_key'] if !opts[:'last_key'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].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 = opts[:return_type] || 'InlineResponse2003' 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#get_refunds_for_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_payment_details(customer_id, opts = {}) ⇒ InlineResponse2007

List Customer’s Payment Details List all customers
Added in version 1.1

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:



1039
1040
1041
1042
# File 'lib/billabear/api/customers_api.rb', line 1039

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

#list_payment_details_with_http_info(customer_id, opts = {}) ⇒ Array<(InlineResponse2007, Integer, Hash)>

List Customer&#x27;s Payment Details List all customers &lt;br&gt;&lt;br&gt;Added in version 1.1

Parameters:

  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:

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

    InlineResponse2007 data, response status code and response headers



1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
# File 'lib/billabear/api/customers_api.rb', line 1049

def list_payment_details_with_http_info(customer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.list_payment_details ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.list_payment_details"
  end
  # resource path
  local_var_path = '/customer/{customerId}/payment-methods'.sub('{' + 'customerId' + '}', customer_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 = opts[:return_type] || 'InlineResponse2007' 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#list_payment_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_seats_subscriptions(body, subscription_id, opts = {}) ⇒ InlineResponse20013

Remove Seats Remove seats to a per seat subscription
<strong>Since 1.1.4</strong>

Parameters:

  • body
  • subscription_id

    The id of the subscription to retrieve

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

    the optional parameters

Returns:



1096
1097
1098
1099
# File 'lib/billabear/api/customers_api.rb', line 1096

def remove_seats_subscriptions(body, subscription_id, opts = {})
  data, _status_code, _headers = remove_seats_subscriptions_with_http_info(body, subscription_id, opts)
  data
end

#remove_seats_subscriptions_with_http_info(body, subscription_id, opts = {}) ⇒ Array<(InlineResponse20013, Integer, Hash)>

Remove Seats Remove seats to a per seat subscription&lt;br&gt;&lt;br&gt;&lt;strong&gt;Since 1.1.4&lt;/strong&gt;

Parameters:

  • body
  • subscription_id

    The id of the subscription to retrieve

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

    the optional parameters

Returns:

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

    InlineResponse20013 data, response status code and response headers



1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
# File 'lib/billabear/api/customers_api.rb', line 1107

def remove_seats_subscriptions_with_http_info(body, subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.remove_seats_subscriptions ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CustomersApi.remove_seats_subscriptions"
  end
  # verify the required parameter 'subscription_id' is set
  if @api_client.config.client_side_validation && subscription_id.nil?
    fail ArgumentError, "Missing the required parameter 'subscription_id' when calling CustomersApi.remove_seats_subscriptions"
  end
  # resource path
  local_var_path = '/subscription/{subscriptionId}/seats/remove'.sub('{' + 'subscriptionId' + '}', subscription_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(body) 

  return_type = opts[:return_type] || 'InlineResponse20013' 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#remove_seats_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_customer(body, customer_id, opts = {}) ⇒ Customer

Update Update a customer

Parameters:

  • body
  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:



1160
1161
1162
1163
# File 'lib/billabear/api/customers_api.rb', line 1160

def update_customer(body, customer_id, opts = {})
  data, _status_code, _headers = update_customer_with_http_info(body, customer_id, opts)
  data
end

#update_customer_with_http_info(body, customer_id, opts = {}) ⇒ Array<(Customer, Integer, Hash)>

Update Update a customer

Parameters:

  • body
  • customer_id

    The id of the customer to retrieve

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

    the optional parameters

Returns:

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

    Customer data, response status code and response headers



1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
# File 'lib/billabear/api/customers_api.rb', line 1171

def update_customer_with_http_info(body, customer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersApi.update_customer ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling CustomersApi.update_customer"
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.update_customer"
  end
  # resource path
  local_var_path = '/customer/{customerId}'.sub('{' + 'customerId' + '}', customer_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(body) 

  return_type = opts[:return_type] || 'Customer' 

  auth_names = opts[: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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersApi#update_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end