Class: WalleeRubySdk::CustomersService

Inherits:
Object
  • Object
show all
Defined in:
lib/wallee-ruby-sdk/service/customers_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ CustomersService

Returns a new instance of CustomersService.



28
29
30
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 28

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



25
26
27
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 25

def api_client
  @api_client
end

Instance Method Details

#delete_customers_bulk(space, request_body, opts = {}) ⇒ Array<RestApiBulkOperationResult>

Delete multiple customers

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

  • request_body (Array<Integer>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



36
37
38
39
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 36

def delete_customers_bulk(space, request_body, opts = {})
  data, _status_code, _headers = delete_customers_bulk_with_http_info(space, request_body, opts)
  data
end

#delete_customers_bulk_with_http_info(space, request_body, opts = {}) ⇒ Array<(Array<RestApiBulkOperationResult>, Integer, Hash)>

Returns Array<RestApiBulkOperationResult> data, response status code and response headers.

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

  • request_body (Array<Integer>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

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



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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 47

def delete_customers_bulk_with_http_info(space, request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersService.delete_customers_bulk ...'
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomersService.delete_customers_bulk"
  end
  # verify the required parameter 'request_body' is set
  if @api_client.config.client_side_validation && request_body.nil?
    fail ArgumentError, "Missing the required parameter 'request_body' when calling CustomersService.delete_customers_bulk"
  end
  # resource path
  local_var_path = '/customers/bulk'

  # 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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  unless content_type.nil?
    header_params['Content-Type'] = content_type
  end
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(request_body)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<RestApiBulkOperationResult>'

  new_options = opts.merge(
    :operation => :"CustomersService.delete_customers_bulk",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersService#delete_customers_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#delete_customers_id(id, space, opts = {}) ⇒ nil

Delete a customer Permanently deletes a customer. It cannot be undone.

Parameters:

  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Returns:

  • (nil)


111
112
113
114
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 111

def delete_customers_id(id, space, opts = {})
  delete_customers_id_with_http_info(id, space, opts)
  nil
end

#delete_customers_id_with_http_info(id, space, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Returns nil, response status code and response headers.

Parameters:

  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 123

def delete_customers_id_with_http_info(id, space, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersService.delete_customers_id ...'
  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 CustomersService.delete_customers_id"
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomersService.delete_customers_id"
  end
  # resource path
  local_var_path = '/customers/{id}'.sub('{' + 'id' + '}', CGI.escape(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']) unless header_params['Accept']
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  new_options = opts.merge(
    :operation => :"CustomersService.delete_customers_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersService#delete_customers_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#get_customers(space, opts = {}) ⇒ CustomerListResponse

List all customers

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :after (Integer)

    Set to an object&#39;s ID to retrieve the page of objects coming immediately after the named object.

  • :before (Integer)

    Set to an object&#39;s ID to retrieve the page of objects coming immediately before the named object.

  • :expand (Array<String>)
  • :limit (Integer)

    A limit on the number of objects to be returned, between 1 and 100. Default is 10.

  • :order (SortingOrder)

    Specify to retrieve objects in chronological (ASC) or reverse chronological (DESC) order.

Returns:



185
186
187
188
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 185

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

#get_customers_id(id, space, opts = {}) ⇒ Customer

Retrieve a customer

Parameters:

  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:



276
277
278
279
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 276

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

#get_customers_id_email_addresses(id, space, opts = {}) ⇒ CustomerEmailAddressListResponse

List a customer’s email addresses

Parameters:

  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:



348
349
350
351
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 348

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

#get_customers_id_email_addresses_with_http_info(id, space, opts = {}) ⇒ Array<(CustomerEmailAddressListResponse, Integer, Hash)>

Returns CustomerEmailAddressListResponse data, response status code and response headers.

Parameters:

  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:



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
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/wallee-ruby-sdk/service/customers_service.rb', line 360

def get_customers_id_email_addresses_with_http_info(id, space, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersService.get_customers_id_email_addresses ...'
  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 CustomersService.get_customers_id_email_addresses"
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomersService.get_customers_id_email_addresses"
  end
  # resource path
  local_var_path = '/customers/{id}/email-addresses'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) unless opts[:'expand'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CustomerEmailAddressListResponse'

  new_options = opts.merge(
    :operation => :"CustomersService.get_customers_id_email_addresses",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersService#get_customers_id_email_addresses\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#get_customers_id_with_http_info(id, space, opts = {}) ⇒ Array<(Customer, Integer, Hash)>

Returns Customer data, response status code and response headers.

Parameters:

  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:

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

    Customer data, response status code and response headers



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
329
330
331
332
333
334
335
336
337
338
339
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 288

def get_customers_id_with_http_info(id, space, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersService.get_customers_id ...'
  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 CustomersService.get_customers_id"
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomersService.get_customers_id"
  end
  # resource path
  local_var_path = '/customers/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) unless opts[:'expand'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body]

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

  new_options = opts.merge(
    :operation => :"CustomersService.get_customers_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersService#get_customers_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#get_customers_search(space, opts = {}) ⇒ CustomerSearchResponse

Search customers

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)
  • :limit (Integer)

    A limit on the number of objects to be returned, between 1 and 100. Default is 10.

  • :offset (Integer)

    A cursor for pagination, specifies the number of objects to skip.

  • :order (String)

    The fields and order to sort the objects by.

  • :query (String)

    The search query to filter the objects by.

Returns:



423
424
425
426
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 423

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

#get_customers_search_with_http_info(space, opts = {}) ⇒ Array<(CustomerSearchResponse, Integer, Hash)>

Returns CustomerSearchResponse data, response status code and response headers.

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)
  • :limit (Integer)

    A limit on the number of objects to be returned, between 1 and 100. Default is 10.

  • :offset (Integer)

    A cursor for pagination, specifies the number of objects to skip.

  • :order (String)

    The fields and order to sort the objects by.

  • :query (String)

    The search query to filter the objects by.

Returns:

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

    CustomerSearchResponse data, response status code and response headers



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
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
497
498
499
500
501
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 438

def get_customers_search_with_http_info(space, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersService.get_customers_search ...'
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomersService.get_customers_search"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CustomersService.get_customers_search, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CustomersService.get_customers_search, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] > 10000
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling CustomersService.get_customers_search, must be smaller than or equal to 10000.'
  end

  # resource path
  local_var_path = '/customers/search'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) unless opts[:'expand'].nil?
  query_params[:'limit'] = opts[:'limit'] unless opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] unless opts[:'offset'].nil?
  query_params[:'order'] = opts[:'order'] unless opts[:'order'].nil?
  query_params[:'query'] = opts[:'query'] unless opts[:'query'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CustomerSearchResponse'

  new_options = opts.merge(
    :operation => :"CustomersService.get_customers_search",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersService#get_customers_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#get_customers_with_http_info(space, opts = {}) ⇒ Array<(CustomerListResponse, Integer, Hash)>

Returns CustomerListResponse data, response status code and response headers.

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :after (Integer)

    Set to an object&#39;s ID to retrieve the page of objects coming immediately after the named object.

  • :before (Integer)

    Set to an object&#39;s ID to retrieve the page of objects coming immediately before the named object.

  • :expand (Array<String>)
  • :limit (Integer)

    A limit on the number of objects to be returned, between 1 and 100. Default is 10.

  • :order (SortingOrder)

    Specify to retrieve objects in chronological (ASC) or reverse chronological (DESC) order.

Returns:

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

    CustomerListResponse data, response status code and response headers



200
201
202
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
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
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 200

def get_customers_with_http_info(space, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersService.get_customers ...'
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomersService.get_customers"
  end
  if @api_client.config.client_side_validation && !opts[:'after'].nil? && opts[:'after'] < 1
    fail ArgumentError, 'invalid value for "opts[:"after"]" when calling CustomersService.get_customers, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'before'].nil? && opts[:'before'] < 1
    fail ArgumentError, 'invalid value for "opts[:"before"]" when calling CustomersService.get_customers, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CustomersService.get_customers, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CustomersService.get_customers, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/customers'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'after'] = opts[:'after'] unless opts[:'after'].nil?
  query_params[:'before'] = opts[:'before'] unless opts[:'before'].nil?
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) unless opts[:'expand'].nil?
  query_params[:'limit'] = opts[:'limit'] unless opts[:'limit'].nil?
  query_params[:'order'] = opts[:'order'] unless opts[:'order'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CustomerListResponse'

  new_options = opts.merge(
    :operation => :"CustomersService.get_customers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersService#get_customers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#patch_customers_bulk(space, customer_active, opts = {}) ⇒ Array<RestApiBulkOperationResult>

Update multiple customers

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

  • customer_active (Array<CustomerActive>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



509
510
511
512
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 509

def patch_customers_bulk(space, customer_active, opts = {})
  data, _status_code, _headers = patch_customers_bulk_with_http_info(space, customer_active, opts)
  data
end

#patch_customers_bulk_with_http_info(space, customer_active, opts = {}) ⇒ Array<(Array<RestApiBulkOperationResult>, Integer, Hash)>

Returns Array<RestApiBulkOperationResult> data, response status code and response headers.

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

  • customer_active (Array<CustomerActive>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

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



520
521
522
523
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
568
569
570
571
572
573
574
575
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 520

def patch_customers_bulk_with_http_info(space, customer_active, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersService.patch_customers_bulk ...'
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomersService.patch_customers_bulk"
  end
  # verify the required parameter 'customer_active' is set
  if @api_client.config.client_side_validation && customer_active.nil?
    fail ArgumentError, "Missing the required parameter 'customer_active' when calling CustomersService.patch_customers_bulk"
  end
  # resource path
  local_var_path = '/customers/bulk'

  # 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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  unless content_type.nil?
    header_params['Content-Type'] = content_type
  end
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(customer_active)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<RestApiBulkOperationResult>'

  new_options = opts.merge(
    :operation => :"CustomersService.patch_customers_bulk",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersService#patch_customers_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#patch_customers_id(id, space, customer_active, opts = {}) ⇒ Customer

Update a customer

Parameters:

  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:



585
586
587
588
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 585

def patch_customers_id(id, space, customer_active, opts = {})
  data, _status_code, _headers = patch_customers_id_with_http_info(id, space, customer_active, opts)
  data
end

#patch_customers_id_with_http_info(id, space, customer_active, opts = {}) ⇒ Array<(Customer, Integer, Hash)>

Returns Customer data, response status code and response headers.

Parameters:

  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:

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

    Customer data, response status code and response headers



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
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 598

def patch_customers_id_with_http_info(id, space, customer_active, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersService.patch_customers_id ...'
  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 CustomersService.patch_customers_id"
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomersService.patch_customers_id"
  end
  # verify the required parameter 'customer_active' is set
  if @api_client.config.client_side_validation && customer_active.nil?
    fail ArgumentError, "Missing the required parameter 'customer_active' when calling CustomersService.patch_customers_id"
  end
  # resource path
  local_var_path = '/customers/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) unless opts[:'expand'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  unless content_type.nil?
    header_params['Content-Type'] = content_type
  end
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(customer_active)

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

  new_options = opts.merge(
    :operation => :"CustomersService.patch_customers_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersService#patch_customers_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#post_customers(space, customer_create, opts = {}) ⇒ Customer

Create a customer

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:



667
668
669
670
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 667

def post_customers(space, customer_create, opts = {})
  data, _status_code, _headers = post_customers_with_http_info(space, customer_create, opts)
  data
end

#post_customers_bulk(space, customer_create, opts = {}) ⇒ Array<RestApiBulkOperationResult>

Create multiple customers

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

  • customer_create (Array<CustomerCreate>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



743
744
745
746
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 743

def post_customers_bulk(space, customer_create, opts = {})
  data, _status_code, _headers = post_customers_bulk_with_http_info(space, customer_create, opts)
  data
end

#post_customers_bulk_with_http_info(space, customer_create, opts = {}) ⇒ Array<(Array<RestApiBulkOperationResult>, Integer, Hash)>

Returns Array<RestApiBulkOperationResult> data, response status code and response headers.

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

  • customer_create (Array<CustomerCreate>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    Array<RestApiBulkOperationResult> data, 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
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 754

def post_customers_bulk_with_http_info(space, customer_create, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersService.post_customers_bulk ...'
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomersService.post_customers_bulk"
  end
  # verify the required parameter 'customer_create' is set
  if @api_client.config.client_side_validation && customer_create.nil?
    fail ArgumentError, "Missing the required parameter 'customer_create' when calling CustomersService.post_customers_bulk"
  end
  # resource path
  local_var_path = '/customers/bulk'

  # 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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  unless content_type.nil?
    header_params['Content-Type'] = content_type
  end
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(customer_create)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<RestApiBulkOperationResult>'

  new_options = opts.merge(
    :operation => :"CustomersService.post_customers_bulk",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersService#post_customers_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#post_customers_id_merge_other(id, other, space, opts = {}) ⇒ Customer

Merge two customers

Parameters:

  • id (Integer)
  • other (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:



819
820
821
822
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 819

def post_customers_id_merge_other(id, other, space, opts = {})
  data, _status_code, _headers = post_customers_id_merge_other_with_http_info(id, other, space, opts)
  data
end

#post_customers_id_merge_other_with_http_info(id, other, space, opts = {}) ⇒ Array<(Customer, Integer, Hash)>

Returns Customer data, response status code and response headers.

Parameters:

  • id (Integer)
  • other (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:

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

    Customer data, response status code and response headers



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
857
858
859
860
861
862
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
# File 'lib/wallee-ruby-sdk/service/customers_service.rb', line 832

def post_customers_id_merge_other_with_http_info(id, other, space, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersService.post_customers_id_merge_other ...'
  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 CustomersService.post_customers_id_merge_other"
  end
  # verify the required parameter 'other' is set
  if @api_client.config.client_side_validation && other.nil?
    fail ArgumentError, "Missing the required parameter 'other' when calling CustomersService.post_customers_id_merge_other"
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomersService.post_customers_id_merge_other"
  end
  # resource path
  local_var_path = '/customers/{id}/merge/{other}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'other' + '}', CGI.escape(other.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) unless opts[:'expand'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body]

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

  new_options = opts.merge(
    :operation => :"CustomersService.post_customers_id_merge_other",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersService#post_customers_id_merge_other\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#post_customers_with_http_info(space, customer_create, opts = {}) ⇒ Array<(Customer, Integer, Hash)>

Returns Customer data, response status code and response headers.

Parameters:

  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:

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

    Customer data, response status code and response headers



679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
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/wallee-ruby-sdk/service/customers_service.rb', line 679

def post_customers_with_http_info(space, customer_create, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomersService.post_customers ...'
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomersService.post_customers"
  end
  # verify the required parameter 'customer_create' is set
  if @api_client.config.client_side_validation && customer_create.nil?
    fail ArgumentError, "Missing the required parameter 'customer_create' when calling CustomersService.post_customers"
  end
  # resource path
  local_var_path = '/customers'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) unless opts[:'expand'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  unless content_type.nil?
    header_params['Content-Type'] = content_type
  end
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(customer_create)

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

  new_options = opts.merge(
    :operation => :"CustomersService.post_customers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomersService#post_customers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end