Class: UltracartClient::UserApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ultracart_api/api/user_api.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ UserApi

Returns a new instance of UserApi.



19
20
21
# File 'lib/ultracart_api/api/user_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/ultracart_api/api/user_api.rb', line 17

def api_client
  @api_client
end

Class Method Details

.new_using_api_key(simple_key, verify_ssl = true, debugging = false) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ultracart_api/api/user_api.rb', line 23

def self.new_using_api_key(simple_key, verify_ssl = true, debugging = false)
  api_config = Configuration.new
  api_config.api_key_prefix['x-ultracart-simple-key'] = simple_key
  api_config.api_version = '2017-03-01'
  api_config.verify_ssl = verify_ssl

  api_client = ApiClient.new(api_config)
  api_client.config.debugging = debugging

  UltracartClient::UserApi.new(api_client)
end

Instance Method Details

#delete_group(group_oid, opts = {}) ⇒ nil

Delete a group Delete a group on the UltraCart account.

Parameters:

  • group_oid

    The group_oid to delete.

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

    the optional parameters

Returns:

  • (nil)


40
41
42
43
# File 'lib/ultracart_api/api/user_api.rb', line 40

def delete_group(group_oid, opts = {})
  delete_group_with_http_info(group_oid, opts)
  nil
end

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

Delete a group Delete a group on the UltraCart account.

Parameters:

  • group_oid

    The group_oid to delete.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
# File 'lib/ultracart_api/api/user_api.rb', line 50

def delete_group_with_http_info(group_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.delete_group ...'
  end
  # verify the required parameter 'group_oid' is set
  if @api_client.config.client_side_validation && group_oid.nil?
    fail ArgumentError, "Missing the required parameter 'group_oid' when calling UserApi.delete_group"
  end
  # resource path
  local_var_path = '/user/groups/{group_oid}'.sub('{' + 'group_oid' + '}', group_oid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

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

#delete_user(user_id, opts = {}) ⇒ nil

Delete a user Delete a user on the UltraCart account.

Parameters:

  • user_id

    The user_id to delete.

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

    the optional parameters

Returns:

  • (nil)


94
95
96
97
# File 'lib/ultracart_api/api/user_api.rb', line 94

def delete_user(user_id, opts = {})
  delete_user_with_http_info(user_id, opts)
  nil
end

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

Delete a user Delete a user on the UltraCart account.

Parameters:

  • user_id

    The user_id to delete.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
# File 'lib/ultracart_api/api/user_api.rb', line 104

def delete_user_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.delete_user ...'
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling UserApi.delete_user"
  end
  # resource path
  local_var_path = '/user/users/{user_id}'.sub('{' + 'user_id' + '}', user_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

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

#get_group(group_oid, opts = {}) ⇒ nil

Retrieve a group Retrieves a single group using the specified group id.

Parameters:

  • group_oid

    The group id to retrieve.

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

    the optional parameters

Returns:

  • (nil)


148
149
150
151
# File 'lib/ultracart_api/api/user_api.rb', line 148

def get_group(group_oid, opts = {})
  get_group_with_http_info(group_oid, opts)
  nil
end

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

Retrieve a group Retrieves a single group using the specified group id.

Parameters:

  • group_oid

    The group id to retrieve.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/ultracart_api/api/user_api.rb', line 158

def get_group_with_http_info(group_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.get_group ...'
  end
  # verify the required parameter 'group_oid' is set
  if @api_client.config.client_side_validation && group_oid.nil?
    fail ArgumentError, "Missing the required parameter 'group_oid' when calling UserApi.get_group"
  end
  # resource path
  local_var_path = '/user/groups/{group_oid}'.sub('{' + 'group_oid' + '}', group_oid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

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

#get_groups(opts = {}) ⇒ GroupsResponse

Get groups

Parameters:

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

    the optional parameters

Returns:



200
201
202
203
# File 'lib/ultracart_api/api/user_api.rb', line 200

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

#get_groups_with_http_info(opts = {}) ⇒ Array<(GroupsResponse, Fixnum, Hash)>

Get groups

Parameters:

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

    the optional parameters

Returns:

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

    GroupsResponse data, response status code and response headers



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
# File 'lib/ultracart_api/api/user_api.rb', line 208

def get_groups_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.get_groups ...'
  end
  # resource path
  local_var_path = '/user/groups'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'GroupsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserApi#get_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_user(user_id, opts = {}) ⇒ UserResponse

Retrieve a user Retrieves a single user using the specified user id.

Parameters:

  • user_id

    The user id to retrieve.

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

    the optional parameters

Returns:



249
250
251
252
# File 'lib/ultracart_api/api/user_api.rb', line 249

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

#get_user_logins(user_id, opts = {}) ⇒ UserLoginsResponse

Retrieve a user’s login history Retrieves logins for a single user using the specified user id.

Parameters:

  • user_id

    The user id to retrieve.

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

    the optional parameters

Returns:



304
305
306
307
# File 'lib/ultracart_api/api/user_api.rb', line 304

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

#get_user_logins_with_http_info(user_id, opts = {}) ⇒ Array<(UserLoginsResponse, Fixnum, Hash)>

Retrieve a user&#39;s login history Retrieves logins for a single user using the specified user id.

Parameters:

  • user_id

    The user id to retrieve.

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

    the optional parameters

Returns:

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

    UserLoginsResponse data, response status code and response headers



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

def get_user_logins_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.get_user_logins ...'
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling UserApi.get_user_logins"
  end
  # resource path
  local_var_path = '/user/users/{user_id}/logins'.sub('{' + 'user_id' + '}', user_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'UserLoginsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserApi#get_user_logins\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_user_with_http_info(user_id, opts = {}) ⇒ Array<(UserResponse, Fixnum, Hash)>

Retrieve a user Retrieves a single user using the specified user id.

Parameters:

  • user_id

    The user id to retrieve.

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

    the optional parameters

Returns:

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

    UserResponse data, response status code and response headers



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

def get_user_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.get_user ...'
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling UserApi.get_user"
  end
  # resource path
  local_var_path = '/user/users/{user_id}'.sub('{' + 'user_id' + '}', user_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'UserResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserApi#get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_users(opts = {}) ⇒ UsersResponse

Get users

Parameters:

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

    the optional parameters

Returns:



357
358
359
360
# File 'lib/ultracart_api/api/user_api.rb', line 357

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

#get_users_with_http_info(opts = {}) ⇒ Array<(UsersResponse, Fixnum, Hash)>

Get users

Parameters:

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

    the optional parameters

Returns:

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

    UsersResponse data, response status code and response headers



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
# File 'lib/ultracart_api/api/user_api.rb', line 365

def get_users_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.get_users ...'
  end
  # resource path
  local_var_path = '/user/users'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'UsersResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserApi#get_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#insert_group(group, opts = {}) ⇒ GroupResponse

Insert a group Insert a group on the UltraCart account.

Parameters:

  • group

    Group to insert

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

    the optional parameters

Returns:



406
407
408
409
# File 'lib/ultracart_api/api/user_api.rb', line 406

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

#insert_group_with_http_info(group, opts = {}) ⇒ Array<(GroupResponse, Fixnum, Hash)>

Insert a group Insert a group on the UltraCart account.

Parameters:

  • group

    Group to insert

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

    the optional parameters

Returns:

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

    GroupResponse data, response status code and response headers



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
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/ultracart_api/api/user_api.rb', line 416

def insert_group_with_http_info(group, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.insert_group ...'
  end
  # verify the required parameter 'group' is set
  if @api_client.config.client_side_validation && group.nil?
    fail ArgumentError, "Missing the required parameter 'group' when calling UserApi.insert_group"
  end
  # resource path
  local_var_path = '/user/groups'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # 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; charset=UTF-8'])

  # form parameters
  form_params = {}

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

#insert_user(user, opts = {}) ⇒ UserResponse

Insert a user Insert a user on the UltraCart account.

Parameters:

  • user

    User to insert

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

    the optional parameters

Returns:



461
462
463
464
# File 'lib/ultracart_api/api/user_api.rb', line 461

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

#insert_user_with_http_info(user, opts = {}) ⇒ Array<(UserResponse, Fixnum, Hash)>

Insert a user Insert a user on the UltraCart account.

Parameters:

  • user

    User to insert

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

    the optional parameters

Returns:

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

    UserResponse data, response status code and response headers



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
502
503
504
505
506
507
508
509
510
# File 'lib/ultracart_api/api/user_api.rb', line 471

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

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # 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; charset=UTF-8'])

  # form parameters
  form_params = {}

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

#update_group(group, group_oid, opts = {}) ⇒ GroupResponse

Update a group Update a group on the UltraCart account.

Parameters:

  • group

    Group to update

  • group_oid

    The group_oid to update.

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

    the optional parameters

Returns:



517
518
519
520
# File 'lib/ultracart_api/api/user_api.rb', line 517

def update_group(group, group_oid, opts = {})
  data, _status_code, _headers = update_group_with_http_info(group, group_oid, opts)
  data
end

#update_group_with_http_info(group, group_oid, opts = {}) ⇒ Array<(GroupResponse, Fixnum, Hash)>

Update a group Update a group on the UltraCart account.

Parameters:

  • group

    Group to update

  • group_oid

    The group_oid to update.

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

    the optional parameters

Returns:

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

    GroupResponse data, response status code and response headers



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
# File 'lib/ultracart_api/api/user_api.rb', line 528

def update_group_with_http_info(group, group_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.update_group ...'
  end
  # verify the required parameter 'group' is set
  if @api_client.config.client_side_validation && group.nil?
    fail ArgumentError, "Missing the required parameter 'group' when calling UserApi.update_group"
  end
  # verify the required parameter 'group_oid' is set
  if @api_client.config.client_side_validation && group_oid.nil?
    fail ArgumentError, "Missing the required parameter 'group_oid' when calling UserApi.update_group"
  end
  # resource path
  local_var_path = '/user/groups/{group_oid}'.sub('{' + 'group_oid' + '}', group_oid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # 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; charset=UTF-8'])

  # form parameters
  form_params = {}

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

#update_user(user, user_id, opts = {}) ⇒ UserResponse

Update a user Update a user on the UltraCart account.

Parameters:

  • user

    User to update

  • user_id

    The user_id to update.

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

    the optional parameters

Returns:



578
579
580
581
# File 'lib/ultracart_api/api/user_api.rb', line 578

def update_user(user, user_id, opts = {})
  data, _status_code, _headers = update_user_with_http_info(user, user_id, opts)
  data
end

#update_user_with_http_info(user, user_id, opts = {}) ⇒ Array<(UserResponse, Fixnum, Hash)>

Update a user Update a user on the UltraCart account.

Parameters:

  • user

    User to update

  • user_id

    The user_id to update.

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

    the optional parameters

Returns:

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

    UserResponse data, response status code and response headers



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
624
625
626
627
628
629
630
631
632
# File 'lib/ultracart_api/api/user_api.rb', line 589

def update_user_with_http_info(user, user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.update_user ...'
  end
  # verify the required parameter 'user' is set
  if @api_client.config.client_side_validation && user.nil?
    fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.update_user"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling UserApi.update_user"
  end
  # resource path
  local_var_path = '/user/users/{user_id}'.sub('{' + 'user_id' + '}', user_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # 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; charset=UTF-8'])

  # form parameters
  form_params = {}

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