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

Options Hash (opts):

  • :x_task_diagnostics (Array<String>)

    List of profilers to use on tasks.

Returns:



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

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

Options Hash (opts):

  • :x_task_diagnostics (Array<String>)

    List of profilers to use on tasks.

Returns:

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

    UserResponse data, response status code and response headers



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
85
86
87
88
89
90
91
# File 'lib/pulpcore_client/api/users_api.rb', line 39

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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?

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

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

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

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

  new_options = opts.merge(
    :operation => :"UsersApi.create",
    :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

Options Hash (opts):

  • :x_task_diagnostics (Array<String>)

    List of profilers to use on tasks.

Returns:

  • (nil)


99
100
101
102
# File 'lib/pulpcore_client/api/users_api.rb', line 99

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

Options Hash (opts):

  • :x_task_diagnostics (Array<String>)

    List of profilers to use on tasks.

Returns:

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

    nil, response status code and response headers



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/pulpcore_client/api/users_api.rb', line 110

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] || {}
  header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"UsersApi.delete",
    :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):

  • :x_task_diagnostics (Array<String>)

    List of profilers to use on tasks.

  • :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:



193
194
195
196
# File 'lib/pulpcore_client/api/users_api.rb', line 193

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):

  • :x_task_diagnostics (Array<String>)

    List of profilers to use on tasks.

  • :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



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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/pulpcore_client/api/users_api.rb', line 234

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']) unless header_params['Accept']
  header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?

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

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

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

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

  new_options = opts.merge(
    :operation => :"UsersApi.list",
    :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

Options Hash (opts):

  • :x_task_diagnostics (Array<String>)

    List of profilers to use on tasks.

Returns:



321
322
323
324
# File 'lib/pulpcore_client/api/users_api.rb', line 321

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

Options Hash (opts):

  • :x_task_diagnostics (Array<String>)

    List of profilers to use on tasks.

Returns:

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

    UserResponse data, response status code and response headers



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
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
# File 'lib/pulpcore_client/api/users_api.rb', line 333

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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?

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

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

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

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

  new_options = opts.merge(
    :operation => :"UsersApi.partial_update",
    :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):

  • :x_task_diagnostics (Array<String>)

    List of profilers to use on tasks.

  • :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:



399
400
401
402
# File 'lib/pulpcore_client/api/users_api.rb', line 399

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):

  • :x_task_diagnostics (Array<String>)

    List of profilers to use on tasks.

  • :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



412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# File 'lib/pulpcore_client/api/users_api.rb', line 412

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']) unless header_params['Accept']
  header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?

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

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

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

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

  new_options = opts.merge(
    :operation => :"UsersApi.read",
    :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

Options Hash (opts):

  • :x_task_diagnostics (Array<String>)

    List of profilers to use on tasks.

Returns:



470
471
472
473
# File 'lib/pulpcore_client/api/users_api.rb', line 470

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

Options Hash (opts):

  • :x_task_diagnostics (Array<String>)

    List of profilers to use on tasks.

Returns:

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

    UserResponse data, response status code and response headers



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
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
# File 'lib/pulpcore_client/api/users_api.rb', line 482

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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?

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

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

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

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

  new_options = opts.merge(
    :operation => :"UsersApi.update",
    :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