Class: InfluxDB2::API::UsersApi

Inherits:
Object
  • Object
show all
Defined in:
apis/lib/influxdb2/apis/generated/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.



18
19
20
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 18

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



16
17
18
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

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

Delete a user

Parameters:

  • user_id (String)

    The ID of the user to delete.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

  • (nil)


26
27
28
29
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 26

def delete_users_id(user_id, opts = {})
  delete_users_id_with_http_info(user_id, opts)
  nil
end

#delete_users_id_with_http_info(user_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a user

Parameters:

  • user_id (String)

    The ID of the user to delete.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    nil, response status code and response headers



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

def delete_users_id_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.delete_users_id ...'
  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 UsersApi.delete_users_id"
  end
  # resource path
  local_var_path = '/users/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_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'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].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] || ['header']

  new_options = opts.merge(
    :operation => :"UsersApi.delete_users_id",
    :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_users_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_flags(opts = {}) ⇒ Hash<String, Object>

Return the feature flags for the currently authenticated user

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

  • (Hash<String, Object>)


89
90
91
92
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 89

def get_flags(opts = {})
  data, _status_code, _headers = get_flags_with_http_info(opts)
  data
end

#get_flags_with_http_info(opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>

Return the feature flags for the currently authenticated user

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>)

    Hash<String, Object> data, response status code and response headers



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 98

def get_flags_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.get_flags ...'
  end
  # resource path
  local_var_path = '/flags'

  # 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'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

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

  new_options = opts.merge(
    :operation => :"UsersApi.get_flags",
    :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#get_flags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_me(opts = {}) ⇒ UserResponse

Retrieve the currently authenticated user

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



147
148
149
150
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 147

def get_me(opts = {})
  data, _status_code, _headers = get_me_with_http_info(opts)
  data
end

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

Retrieve the currently authenticated user

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    UserResponse data, response status code and response headers



156
157
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
197
198
199
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 156

def get_me_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.get_me ...'
  end
  # resource path
  local_var_path = '/me'

  # 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'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].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] || ['header']

  new_options = opts.merge(
    :operation => :"UsersApi.get_me",
    :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#get_me\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_users(opts = {}) ⇒ Users

List all users

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

  • :offset (Integer)
  • :limit (Integer) — default: default to 20
  • :after (String)

    Resource ID to seek from. Results are not inclusive of this ID. Use &#x60;after&#x60; instead of &#x60;offset&#x60;.

  • :name (String)
  • :id (String)

Returns:



210
211
212
213
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 210

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

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

Retrieve a user

Parameters:

  • user_id (String)

    The user ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



291
292
293
294
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 291

def get_users_id(user_id, opts = {})
  data, _status_code, _headers = get_users_id_with_http_info(user_id, opts)
  data
end

#get_users_id_with_http_info(user_id, opts = {}) ⇒ Array<(UserResponse, Integer, Hash)>

Retrieve a user

Parameters:

  • user_id (String)

    The user ID.

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    UserResponse data, response status code and response headers



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
340
341
342
343
344
345
346
347
348
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 301

def get_users_id_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.get_users_id ...'
  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 UsersApi.get_users_id"
  end
  # resource path
  local_var_path = '/users/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_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'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].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] || ['header']

  new_options = opts.merge(
    :operation => :"UsersApi.get_users_id",
    :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#get_users_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_users_with_http_info(opts = {}) ⇒ Array<(Users, Integer, Hash)>

List all users

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

  • :offset (Integer)
  • :limit (Integer)
  • :after (String)

    Resource ID to seek from. Results are not inclusive of this ID. Use &#x60;after&#x60; instead of &#x60;offset&#x60;.

  • :name (String)
  • :id (String)

Returns:

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

    Users data, response status code and response headers



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
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 224

def get_users_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.get_users ...'
  end
  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling UsersApi.get_users, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UsersApi.get_users, 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 UsersApi.get_users, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/users'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?

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

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

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

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

  new_options = opts.merge(
    :operation => :"UsersApi.get_users",
    :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#get_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Update a user

Parameters:

  • user_id (String)

    The ID of the user to update.

  • user (User)

    User update to apply

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



356
357
358
359
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 356

def patch_users_id(user_id, user, opts = {})
  data, _status_code, _headers = patch_users_id_with_http_info(user_id, user, opts)
  data
end

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

Update a user

Parameters:

  • user_id (String)

    The ID of the user to update.

  • user (User)

    User update to apply

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    UserResponse data, response status code and response headers



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
412
413
414
415
416
417
418
419
420
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 367

def patch_users_id_with_http_info(user_id, user, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.patch_users_id ...'
  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 UsersApi.patch_users_id"
  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.patch_users_id"
  end
  # resource path
  local_var_path = '/users/{userID}'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].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] || ['header']

  new_options = opts.merge(
    :operation => :"UsersApi.patch_users_id",
    :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#patch_users_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Create a user

Parameters:

  • user (User)

    User to create

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:



427
428
429
430
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 427

def post_users(user, opts = {})
  data, _status_code, _headers = post_users_with_http_info(user, opts)
  data
end

#post_users_id_password(user_id, password_reset_body, opts = {}) ⇒ nil

Update a password

Parameters:

  • user_id (String)

    The user ID.

  • password_reset_body (PasswordResetBody)

    New password

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

  • (nil)


494
495
496
497
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 494

def post_users_id_password(user_id, password_reset_body, opts = {})
  post_users_id_password_with_http_info(user_id, password_reset_body, opts)
  nil
end

#post_users_id_password_with_http_info(user_id, password_reset_body, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update a password

Parameters:

  • user_id (String)

    The user ID.

  • password_reset_body (PasswordResetBody)

    New password

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    nil, response status code and response headers



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
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 505

def post_users_id_password_with_http_info(user_id, password_reset_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.post_users_id_password ...'
  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 UsersApi.post_users_id_password"
  end
  # verify the required parameter 'password_reset_body' is set
  if @api_client.config.client_side_validation && password_reset_body.nil?
    fail ArgumentError, "Missing the required parameter 'password_reset_body' when calling UsersApi.post_users_id_password"
  end
  # resource path
  local_var_path = '/users/{userID}/password'.sub('{' + 'userID' + '}', CGI.escape(user_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"UsersApi.post_users_id_password",
    :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#post_users_id_password\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Create a user

Parameters:

  • user (User)

    User to create

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    UserResponse data, response status code and response headers



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
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
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 437

def post_users_with_http_info(user, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.post_users ...'
  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.post_users"
  end
  # resource path
  local_var_path = '/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'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].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] || ['header']

  new_options = opts.merge(
    :operation => :"UsersApi.post_users",
    :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#post_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_me_password(password_reset_body, opts = {}) ⇒ nil

Update a password

Parameters:

  • password_reset_body (PasswordResetBody)

    New password

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

  • (nil)


565
566
567
568
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 565

def put_me_password(password_reset_body, opts = {})
  put_me_password_with_http_info(password_reset_body, opts)
  nil
end

#put_me_password_with_http_info(password_reset_body, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update a password

Parameters:

  • password_reset_body (PasswordResetBody)

    New password

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

    the optional parameters

Options Hash (opts):

  • :zap_trace_span (String)

    OpenTracing span context

Returns:

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

    nil, response status code and response headers



575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
# File 'apis/lib/influxdb2/apis/generated/api/users_api.rb', line 575

def put_me_password_with_http_info(password_reset_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.put_me_password ...'
  end
  # verify the required parameter 'password_reset_body' is set
  if @api_client.config.client_side_validation && password_reset_body.nil?
    fail ArgumentError, "Missing the required parameter 'password_reset_body' when calling UsersApi.put_me_password"
  end
  # resource path
  local_var_path = '/me/password'

  # 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'])
  header_params[:'Zap-Trace-Span'] = opts[:'zap_trace_span'] if !opts[:'zap_trace_span'].nil?

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"UsersApi.put_me_password",
    :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#put_me_password\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end