Class: PulpcoreClient::UsersApi

Inherits:
Object
  • Object
show all
Defined in:
lib/pulpcore_client/api/users_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ UsersApi

Returns a new instance of UsersApi.



19
20
21
# File 'lib/pulpcore_client/api/users_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/pulpcore_client/api/users_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

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

Create an user ViewSet for User.

Parameters:

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/pulpcore_client/api/users_api.rb', line 27

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

#create_with_http_info(user, opts = {}) ⇒ Array<(UserResponse, Integer, Hash)>

Create an user ViewSet for User.

Parameters:

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

    the optional parameters

Returns:

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

    UserResponse data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/pulpcore_client/api/users_api.rb', line 37

def create_with_http_info(user, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.create ...'
  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 UsersApi.create"
  end
  # resource path
  local_var_path = '/pulp/api/v3/users/'

  # 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', 'application/x-www-form-urlencoded', 'multipart/form-data'])

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

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

  # return_type
  return_type = opts[:return_type] || 'UserResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete(auth_user_href, opts = {}) ⇒ nil

Delete an user ViewSet for User.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


91
92
93
94
# File 'lib/pulpcore_client/api/users_api.rb', line 91

def delete(auth_user_href, opts = {})
  delete_with_http_info(auth_user_href, opts)
  nil
end

#delete_with_http_info(auth_user_href, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an user ViewSet for User.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
# File 'lib/pulpcore_client/api/users_api.rb', line 101

def delete_with_http_info(auth_user_href, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.delete ...'
  end
  # verify the required parameter 'auth_user_href' is set
  if @api_client.config.client_side_validation && auth_user_href.nil?
    fail ArgumentError, "Missing the required parameter 'auth_user_href' when calling UsersApi.delete"
  end
  # resource path
  local_var_path = '{auth_user_href}'.sub('{' + 'auth_user_href' + '}', CGI.escape(auth_user_href.to_s).gsub('%2F', '/'))

  # 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
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list(opts = {}) ⇒ PaginatedUserResponseList

List users ViewSet for User.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :email (String)

    Filter results where email matches value

  • :email__contains (String)

    Filter results where email contains value

  • :email__icontains (String)

    Filter results where email contains value

  • :email__iexact (String)

    Filter results where email matches value

  • :email__in (Array<String>)

    Filter results where email is in a comma-separated list of values

  • :first_name (String)

    Filter results where first_name matches value

  • :first_name__contains (String)

    Filter results where first_name contains value

  • :first_name__icontains (String)

    Filter results where first_name contains value

  • :first_name__iexact (String)

    Filter results where first_name matches value

  • :first_name__in (Array<String>)

    Filter results where first_name is in a comma-separated list of values

  • :is_active (Boolean)

    Filter results where is_active matches value

  • :is_staff (Boolean)

    Filter results where is_staff matches value

  • :last_name (String)

    Filter results where last_name matches value

  • :last_name__contains (String)

    Filter results where last_name contains value

  • :last_name__icontains (String)

    Filter results where last_name contains value

  • :last_name__iexact (String)

    Filter results where last_name matches value

  • :last_name__in (Array<String>)

    Filter results where last_name is in a comma-separated list of values

  • :limit (Integer)

    Number of results to return per page.

  • :offset (Integer)

    The initial index from which to return the results.

  • :ordering (Array<String>)

    Ordering * &#x60;id&#x60; - Id * &#x60;-id&#x60; - Id (descending) * &#x60;password&#x60; - Password * &#x60;-password&#x60; - Password (descending) * &#x60;last_login&#x60; - Last login * &#x60;-last_login&#x60; - Last login (descending) * &#x60;is_superuser&#x60; - Is superuser * &#x60;-is_superuser&#x60; - Is superuser (descending) * &#x60;username&#x60; - Username * &#x60;-username&#x60; - Username (descending) * &#x60;first_name&#x60; - First name * &#x60;-first_name&#x60; - First name (descending) * &#x60;last_name&#x60; - Last name * &#x60;-last_name&#x60; - Last name (descending) * &#x60;email&#x60; - Email * &#x60;-email&#x60; - Email (descending) * &#x60;is_staff&#x60; - Is staff * &#x60;-is_staff&#x60; - Is staff (descending) * &#x60;is_active&#x60; - Is active * &#x60;-is_active&#x60; - Is active (descending) * &#x60;date_joined&#x60; - Date joined * &#x60;-date_joined&#x60; - Date joined (descending) * &#x60;pk&#x60; - Pk * &#x60;-pk&#x60; - Pk (descending)

  • :prn__in (Array<String>)

    Multiple values may be separated by commas.

  • :pulp_href__in (Array<String>)

    Multiple values may be separated by commas.

  • :pulp_id__in (Array<String>)

    Multiple values may be separated by commas.

  • :q (String)

    Filter results by using NOT, AND and OR operations on other filters

  • :username (String)

    Filter results where username matches value

  • :username__contains (String)

    Filter results where username contains value

  • :username__icontains (String)

    Filter results where username contains value

  • :username__iexact (String)

    Filter results where username matches value

  • :username__in (Array<String>)

    Filter results where username is in a comma-separated list of values

  • :fields (Array<String>)

    A list of fields to include in the response.

  • :exclude_fields (Array<String>)

    A list of fields to exclude from the response.

Returns:



181
182
183
184
# File 'lib/pulpcore_client/api/users_api.rb', line 181

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

#list_with_http_info(opts = {}) ⇒ Array<(PaginatedUserResponseList, Integer, Hash)>

List users ViewSet for User.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :email (String)

    Filter results where email matches value

  • :email__contains (String)

    Filter results where email contains value

  • :email__icontains (String)

    Filter results where email contains value

  • :email__iexact (String)

    Filter results where email matches value

  • :email__in (Array<String>)

    Filter results where email is in a comma-separated list of values

  • :first_name (String)

    Filter results where first_name matches value

  • :first_name__contains (String)

    Filter results where first_name contains value

  • :first_name__icontains (String)

    Filter results where first_name contains value

  • :first_name__iexact (String)

    Filter results where first_name matches value

  • :first_name__in (Array<String>)

    Filter results where first_name is in a comma-separated list of values

  • :is_active (Boolean)

    Filter results where is_active matches value

  • :is_staff (Boolean)

    Filter results where is_staff matches value

  • :last_name (String)

    Filter results where last_name matches value

  • :last_name__contains (String)

    Filter results where last_name contains value

  • :last_name__icontains (String)

    Filter results where last_name contains value

  • :last_name__iexact (String)

    Filter results where last_name matches value

  • :last_name__in (Array<String>)

    Filter results where last_name is in a comma-separated list of values

  • :limit (Integer)

    Number of results to return per page.

  • :offset (Integer)

    The initial index from which to return the results.

  • :ordering (Array<String>)

    Ordering * &#x60;id&#x60; - Id * &#x60;-id&#x60; - Id (descending) * &#x60;password&#x60; - Password * &#x60;-password&#x60; - Password (descending) * &#x60;last_login&#x60; - Last login * &#x60;-last_login&#x60; - Last login (descending) * &#x60;is_superuser&#x60; - Is superuser * &#x60;-is_superuser&#x60; - Is superuser (descending) * &#x60;username&#x60; - Username * &#x60;-username&#x60; - Username (descending) * &#x60;first_name&#x60; - First name * &#x60;-first_name&#x60; - First name (descending) * &#x60;last_name&#x60; - Last name * &#x60;-last_name&#x60; - Last name (descending) * &#x60;email&#x60; - Email * &#x60;-email&#x60; - Email (descending) * &#x60;is_staff&#x60; - Is staff * &#x60;-is_staff&#x60; - Is staff (descending) * &#x60;is_active&#x60; - Is active * &#x60;-is_active&#x60; - Is active (descending) * &#x60;date_joined&#x60; - Date joined * &#x60;-date_joined&#x60; - Date joined (descending) * &#x60;pk&#x60; - Pk * &#x60;-pk&#x60; - Pk (descending)

  • :prn__in (Array<String>)

    Multiple values may be separated by commas.

  • :pulp_href__in (Array<String>)

    Multiple values may be separated by commas.

  • :pulp_id__in (Array<String>)

    Multiple values may be separated by commas.

  • :q (String)

    Filter results by using NOT, AND and OR operations on other filters

  • :username (String)

    Filter results where username matches value

  • :username__contains (String)

    Filter results where username contains value

  • :username__icontains (String)

    Filter results where username contains value

  • :username__iexact (String)

    Filter results where username matches value

  • :username__in (Array<String>)

    Filter results where username is in a comma-separated list of values

  • :fields (Array<String>)

    A list of fields to include in the response.

  • :exclude_fields (Array<String>)

    A list of fields to exclude from the response.

Returns:

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

    PaginatedUserResponseList data, response status code and response headers



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
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
# File 'lib/pulpcore_client/api/users_api.rb', line 221

def list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.list ...'
  end
  allowable_values = ["-date_joined", "-email", "-first_name", "-id", "-is_active", "-is_staff", "-is_superuser", "-last_login", "-last_name", "-password", "-pk", "-username", "date_joined", "email", "first_name", "id", "is_active", "is_staff", "is_superuser", "last_login", "last_name", "password", "pk", "username"]
  if @api_client.config.client_side_validation && opts[:'ordering'] && !opts[:'ordering'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"ordering\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/pulp/api/v3/users/'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil?
  query_params[:'email__contains'] = opts[:'email__contains'] if !opts[:'email__contains'].nil?
  query_params[:'email__icontains'] = opts[:'email__icontains'] if !opts[:'email__icontains'].nil?
  query_params[:'email__iexact'] = opts[:'email__iexact'] if !opts[:'email__iexact'].nil?
  query_params[:'email__in'] = @api_client.build_collection_param(opts[:'email__in'], :csv) if !opts[:'email__in'].nil?
  query_params[:'first_name'] = opts[:'first_name'] if !opts[:'first_name'].nil?
  query_params[:'first_name__contains'] = opts[:'first_name__contains'] if !opts[:'first_name__contains'].nil?
  query_params[:'first_name__icontains'] = opts[:'first_name__icontains'] if !opts[:'first_name__icontains'].nil?
  query_params[:'first_name__iexact'] = opts[:'first_name__iexact'] if !opts[:'first_name__iexact'].nil?
  query_params[:'first_name__in'] = @api_client.build_collection_param(opts[:'first_name__in'], :csv) if !opts[:'first_name__in'].nil?
  query_params[:'is_active'] = opts[:'is_active'] if !opts[:'is_active'].nil?
  query_params[:'is_staff'] = opts[:'is_staff'] if !opts[:'is_staff'].nil?
  query_params[:'last_name'] = opts[:'last_name'] if !opts[:'last_name'].nil?
  query_params[:'last_name__contains'] = opts[:'last_name__contains'] if !opts[:'last_name__contains'].nil?
  query_params[:'last_name__icontains'] = opts[:'last_name__icontains'] if !opts[:'last_name__icontains'].nil?
  query_params[:'last_name__iexact'] = opts[:'last_name__iexact'] if !opts[:'last_name__iexact'].nil?
  query_params[:'last_name__in'] = @api_client.build_collection_param(opts[:'last_name__in'], :csv) if !opts[:'last_name__in'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'ordering'] = @api_client.build_collection_param(opts[:'ordering'], :csv) if !opts[:'ordering'].nil?
  query_params[:'prn__in'] = @api_client.build_collection_param(opts[:'prn__in'], :csv) if !opts[:'prn__in'].nil?
  query_params[:'pulp_href__in'] = @api_client.build_collection_param(opts[:'pulp_href__in'], :csv) if !opts[:'pulp_href__in'].nil?
  query_params[:'pulp_id__in'] = @api_client.build_collection_param(opts[:'pulp_id__in'], :csv) if !opts[:'pulp_id__in'].nil?
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
  query_params[:'username'] = opts[:'username'] if !opts[:'username'].nil?
  query_params[:'username__contains'] = opts[:'username__contains'] if !opts[:'username__contains'].nil?
  query_params[:'username__icontains'] = opts[:'username__icontains'] if !opts[:'username__icontains'].nil?
  query_params[:'username__iexact'] = opts[:'username__iexact'] if !opts[:'username__iexact'].nil?
  query_params[:'username__in'] = @api_client.build_collection_param(opts[:'username__in'], :csv) if !opts[:'username__in'].nil?
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :multi) if !opts[:'exclude_fields'].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
  return_type = opts[:return_type] || 'PaginatedUserResponseList' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#partial_update(auth_user_href, patched_user, opts = {}) ⇒ UserResponse

Update an user ViewSet for User.

Parameters:

  • auth_user_href (String)
  • patched_user (PatchedUser)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



305
306
307
308
# File 'lib/pulpcore_client/api/users_api.rb', line 305

def partial_update(auth_user_href, patched_user, opts = {})
  data, _status_code, _headers = partial_update_with_http_info(auth_user_href, patched_user, opts)
  data
end

#partial_update_with_http_info(auth_user_href, patched_user, opts = {}) ⇒ Array<(UserResponse, Integer, Hash)>

Update an user ViewSet for User.

Parameters:

  • auth_user_href (String)
  • patched_user (PatchedUser)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    UserResponse data, response status code and response headers



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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# File 'lib/pulpcore_client/api/users_api.rb', line 316

def partial_update_with_http_info(auth_user_href, patched_user, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.partial_update ...'
  end
  # verify the required parameter 'auth_user_href' is set
  if @api_client.config.client_side_validation && auth_user_href.nil?
    fail ArgumentError, "Missing the required parameter 'auth_user_href' when calling UsersApi.partial_update"
  end
  # verify the required parameter 'patched_user' is set
  if @api_client.config.client_side_validation && patched_user.nil?
    fail ArgumentError, "Missing the required parameter 'patched_user' when calling UsersApi.partial_update"
  end
  # resource path
  local_var_path = '{auth_user_href}'.sub('{' + 'auth_user_href' + '}', CGI.escape(auth_user_href.to_s).gsub('%2F', '/'))

  # 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', 'application/x-www-form-urlencoded', 'multipart/form-data'])

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

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

  # return_type
  return_type = opts[:return_type] || 'UserResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#partial_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#read(auth_user_href, opts = {}) ⇒ UserResponse

Inspect an user ViewSet for User.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A list of fields to include in the response.

  • :exclude_fields (Array<String>)

    A list of fields to exclude from the response.

Returns:



376
377
378
379
# File 'lib/pulpcore_client/api/users_api.rb', line 376

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

#read_with_http_info(auth_user_href, opts = {}) ⇒ Array<(UserResponse, Integer, Hash)>

Inspect an user ViewSet for User.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :fields (Array<String>)

    A list of fields to include in the response.

  • :exclude_fields (Array<String>)

    A list of fields to exclude from the response.

Returns:

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

    UserResponse data, response status code and response headers



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
# File 'lib/pulpcore_client/api/users_api.rb', line 388

def read_with_http_info(auth_user_href, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.read ...'
  end
  # verify the required parameter 'auth_user_href' is set
  if @api_client.config.client_side_validation && auth_user_href.nil?
    fail ArgumentError, "Missing the required parameter 'auth_user_href' when calling UsersApi.read"
  end
  # resource path
  local_var_path = '{auth_user_href}'.sub('{' + 'auth_user_href' + '}', CGI.escape(auth_user_href.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :multi) if !opts[:'exclude_fields'].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
  return_type = opts[:return_type] || 'UserResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update(auth_user_href, user, opts = {}) ⇒ UserResponse

Update an user ViewSet for User.

Parameters:

  • auth_user_href (String)
  • user (User)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



443
444
445
446
# File 'lib/pulpcore_client/api/users_api.rb', line 443

def update(auth_user_href, user, opts = {})
  data, _status_code, _headers = update_with_http_info(auth_user_href, user, opts)
  data
end

#update_with_http_info(auth_user_href, user, opts = {}) ⇒ Array<(UserResponse, Integer, Hash)>

Update an user ViewSet for User.

Parameters:

  • auth_user_href (String)
  • user (User)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    UserResponse data, response status code and response headers



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
502
503
504
505
# File 'lib/pulpcore_client/api/users_api.rb', line 454

def update_with_http_info(auth_user_href, user, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.update ...'
  end
  # verify the required parameter 'auth_user_href' is set
  if @api_client.config.client_side_validation && auth_user_href.nil?
    fail ArgumentError, "Missing the required parameter 'auth_user_href' when calling UsersApi.update"
  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 UsersApi.update"
  end
  # resource path
  local_var_path = '{auth_user_href}'.sub('{' + 'auth_user_href' + '}', CGI.escape(auth_user_href.to_s).gsub('%2F', '/'))

  # 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', 'application/x-www-form-urlencoded', 'multipart/form-data'])

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

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

  # return_type
  return_type = opts[:return_type] || 'UserResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end