Class: ClerkHttpClient::UsersApi

Inherits:
Object
  • Object
show all
Defined in:
lib/clerk-http-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/clerk-http-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/clerk-http-client/api/users_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#ban_user(user_id, opts = {}) ⇒ User

Ban a user Marks the given user as banned, which means that all their sessions are revoked and they are not allowed to sign in again.

Parameters:

  • user_id (String)

    The ID of the user to ban

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/clerk-http-client/api/users_api.rb', line 28

def ban_user(user_id, opts = {})
  data, _status_code, _headers = ban_user_with_http_info(user_id, opts)
  data
end

#ban_user_with_http_info(user_id, opts = {}) ⇒ Array<(User, Integer, Hash)>

Ban a user Marks the given user as banned, which means that all their sessions are revoked and they are not allowed to sign in again. POST

Parameters:

  • user_id (String)

    The ID of the user to ban

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

    the optional parameters

Returns:

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

    User 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
# File 'lib/clerk-http-client/api/users_api.rb', line 39

def ban_user_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.ban_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 UsersApi.ban_user"
  end
  # resource path
  local_var_path = '/users/{user_id}/ban'.sub('{' + 'user_id' + '}', 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']) unless header_params['Accept']

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

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

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

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

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

#create_user(create_user_request, opts = {}) ⇒ User

Create a new user Creates a new user. Your user management settings determine how you should setup your user model. Any email address and phone number created using this method will be marked as verified. Note: If you are performing a migration, check out our guide on [zero downtime migrations](clerk.com/docs/deployments/migrate-overview). A rate limit rule of 20 requests per 10 seconds is applied to this endpoint.

Parameters:

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

    the optional parameters

Returns:



93
94
95
96
# File 'lib/clerk-http-client/api/users_api.rb', line 93

def create_user(create_user_request, opts = {})
  data, _status_code, _headers = create_user_with_http_info(create_user_request, opts)
  data
end

#create_user_totp(user_id, opts = {}) ⇒ TOTP

Create a TOTP for a user Creates a TOTP (Time-based One-Time Password) for a given user, returning both the TOTP secret and the URI.

Parameters:

  • user_id (String)

    The ID of the user for whom the TOTP is being created.

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

    the optional parameters

Returns:



163
164
165
166
# File 'lib/clerk-http-client/api/users_api.rb', line 163

def create_user_totp(user_id, opts = {})
  data, _status_code, _headers = create_user_totp_with_http_info(user_id, opts)
  data
end

#create_user_totp_with_http_info(user_id, opts = {}) ⇒ Array<(TOTP, Integer, Hash)>

Create a TOTP for a user Creates a TOTP (Time-based One-Time Password) for a given user, returning both the TOTP secret and the URI. POST

Parameters:

  • user_id (String)

    The ID of the user for whom the TOTP is being created.

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

    the optional parameters

Returns:

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

    TOTP data, response status code and response headers



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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/clerk-http-client/api/users_api.rb', line 174

def create_user_totp_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.create_user_totp ...'
  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.create_user_totp"
  end
  # resource path
  local_var_path = '/users/{user_id}/totp'.sub('{' + 'user_id' + '}', 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']) unless header_params['Accept']

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

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

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

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

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

#create_user_with_http_info(create_user_request, opts = {}) ⇒ Array<(User, Integer, Hash)>

Create a new user Creates a new user. Your user management settings determine how you should setup your user model. Any email address and phone number created using this method will be marked as verified. Note: If you are performing a migration, check out our guide on [zero downtime migrations](clerk.com/docs/deployments/migrate-overview). A rate limit rule of 20 requests per 10 seconds is applied to this endpoint. POST

Parameters:

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

    the optional parameters

Returns:

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

    User data, 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
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/clerk-http-client/api/users_api.rb', line 104

def create_user_with_http_info(create_user_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.create_user ...'
  end
  # verify the required parameter 'create_user_request' is set
  if @api_client.config.client_side_validation && create_user_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_user_request' when calling UsersApi.create_user"
  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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

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

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

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

#delete_backup_code(user_id, opts = {}) ⇒ DisableMFA200Response

Disable all user’s Backup codes Disable all of a user’s backup codes.

Parameters:

  • user_id (String)

    The ID of the user whose backup codes are to be deleted.

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

    the optional parameters

Returns:



228
229
230
231
# File 'lib/clerk-http-client/api/users_api.rb', line 228

def delete_backup_code(user_id, opts = {})
  data, _status_code, _headers = delete_backup_code_with_http_info(user_id, opts)
  data
end

#delete_backup_code_with_http_info(user_id, opts = {}) ⇒ Array<(DisableMFA200Response, Integer, Hash)>

Disable all user&#39;s Backup codes Disable all of a user&#39;s backup codes. DELETE

Parameters:

  • user_id (String)

    The ID of the user whose backup codes are to be deleted.

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

    the optional parameters

Returns:

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

    DisableMFA200Response data, response status code and response headers



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
# File 'lib/clerk-http-client/api/users_api.rb', line 239

def delete_backup_code_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.delete_backup_code ...'
  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_backup_code"
  end
  # resource path
  local_var_path = '/users/{user_id}/backup_code'.sub('{' + 'user_id' + '}', 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']) unless header_params['Accept']

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

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

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

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

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

#delete_external_account(user_id, external_account_id, opts = {}) ⇒ DeletedObject

Delete External Account Delete an external account by ID.

Parameters:

  • user_id (String)

    The ID of the user&#39;s external account

  • external_account_id (String)

    The ID of the external account to delete

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

    the optional parameters

Returns:



294
295
296
297
# File 'lib/clerk-http-client/api/users_api.rb', line 294

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

#delete_external_account_with_http_info(user_id, external_account_id, opts = {}) ⇒ Array<(DeletedObject, Integer, Hash)>

Delete External Account Delete an external account by ID. DELETE

Parameters:

  • user_id (String)

    The ID of the user&#39;s external account

  • external_account_id (String)

    The ID of the external account to delete

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

    the optional parameters

Returns:

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

    DeletedObject data, response status code and response headers



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
349
350
351
352
353
354
355
356
# File 'lib/clerk-http-client/api/users_api.rb', line 306

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

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

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

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

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

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

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

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

#delete_totp(user_id, opts = {}) ⇒ DisableMFA200Response

Delete all the user’s TOTPs Deletes all of the user’s TOTPs.

Parameters:

  • user_id (String)

    The ID of the user whose TOTPs are to be deleted

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

    the optional parameters

Returns:



364
365
366
367
# File 'lib/clerk-http-client/api/users_api.rb', line 364

def delete_totp(user_id, opts = {})
  data, _status_code, _headers = delete_totp_with_http_info(user_id, opts)
  data
end

#delete_totp_with_http_info(user_id, opts = {}) ⇒ Array<(DisableMFA200Response, Integer, Hash)>

Delete all the user&#39;s TOTPs Deletes all of the user&#39;s TOTPs. DELETE

Parameters:

  • user_id (String)

    The ID of the user whose TOTPs are to be deleted

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

    the optional parameters

Returns:

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

    DisableMFA200Response data, response status code and response headers



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
421
# File 'lib/clerk-http-client/api/users_api.rb', line 375

def delete_totp_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.delete_totp ...'
  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_totp"
  end
  # resource path
  local_var_path = '/users/{user_id}/totp'.sub('{' + 'user_id' + '}', 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']) unless header_params['Accept']

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

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

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

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

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

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

Delete a user Delete the specified user

Parameters:

  • user_id (String)

    The ID of the user to delete

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

    the optional parameters

Returns:



429
430
431
432
# File 'lib/clerk-http-client/api/users_api.rb', line 429

def delete_user(user_id, opts = {})
  data, _status_code, _headers = delete_user_with_http_info(user_id, opts)
  data
end

#delete_user_profile_image(user_id, opts = {}) ⇒ User

Delete user profile image Delete a user’s profile image

Parameters:

  • user_id (String)

    The ID of the user to delete the profile image for

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

    the optional parameters

Returns:



494
495
496
497
# File 'lib/clerk-http-client/api/users_api.rb', line 494

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

#delete_user_profile_image_with_http_info(user_id, opts = {}) ⇒ Array<(User, Integer, Hash)>

Delete user profile image Delete a user&#39;s profile image DELETE

Parameters:

  • user_id (String)

    The ID of the user to delete the profile image for

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

    the optional parameters

Returns:

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

    User data, 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
# File 'lib/clerk-http-client/api/users_api.rb', line 505

def (user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.delete_user_profile_image ...'
  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_user_profile_image"
  end
  # resource path
  local_var_path = '/users/{user_id}/profile_image'.sub('{' + 'user_id' + '}', 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']) unless header_params['Accept']

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

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

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

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

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

#delete_user_with_http_info(user_id, opts = {}) ⇒ Array<(DeletedObject, Integer, Hash)>

Delete a user Delete the specified user DELETE

Parameters:

  • user_id (String)

    The ID of the user to delete

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

    the optional parameters

Returns:

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

    DeletedObject data, response status code and response headers



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 'lib/clerk-http-client/api/users_api.rb', line 440

def delete_user_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.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 UsersApi.delete_user"
  end
  # resource path
  local_var_path = '/users/{user_id}'.sub('{' + 'user_id' + '}', 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']) unless header_params['Accept']

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

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

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

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

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

#disable_mfa(user_id, opts = {}) ⇒ DisableMFA200Response

Disable a user’s MFA methods Disable all of a user’s MFA methods (e.g. OTP sent via SMS, TOTP on their authenticator app) at once.

Parameters:

  • user_id (String)

    The ID of the user whose MFA methods are to be disabled

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

    the optional parameters

Returns:



559
560
561
562
# File 'lib/clerk-http-client/api/users_api.rb', line 559

def disable_mfa(user_id, opts = {})
  data, _status_code, _headers = disable_mfa_with_http_info(user_id, opts)
  data
end

#disable_mfa_with_http_info(user_id, opts = {}) ⇒ Array<(DisableMFA200Response, Integer, Hash)>

Disable a user&#39;s MFA methods Disable all of a user&#39;s MFA methods (e.g. OTP sent via SMS, TOTP on their authenticator app) at once. DELETE

Parameters:

  • user_id (String)

    The ID of the user whose MFA methods are to be disabled

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

    the optional parameters

Returns:

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

    DisableMFA200Response data, response status code and response headers



570
571
572
573
574
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
# File 'lib/clerk-http-client/api/users_api.rb', line 570

def disable_mfa_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.disable_mfa ...'
  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.disable_mfa"
  end
  # resource path
  local_var_path = '/users/{user_id}/mfa'.sub('{' + 'user_id' + '}', 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']) unless header_params['Accept']

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

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

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

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

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

#get_oauth_access_token(user_id, provider, opts = {}) ⇒ Array<GetOAuthAccessToken200ResponseInner>

Retrieve the OAuth access token of a user Fetch the corresponding OAuth access token for a user that has previously authenticated with a particular OAuth provider. For OAuth 2.0, if the access token has expired and we have a corresponding refresh token, the access token will be refreshed transparently the new one will be returned.

Parameters:

  • user_id (String)

    The ID of the user for which to retrieve the OAuth access token

  • provider (String)

    The ID of the OAuth provider (e.g. &#x60;oauth_google&#x60;)

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

    the optional parameters

Returns:



625
626
627
628
# File 'lib/clerk-http-client/api/users_api.rb', line 625

def get_oauth_access_token(user_id, provider, opts = {})
  data, _status_code, _headers = get_oauth_access_token_with_http_info(user_id, provider, opts)
  data
end

#get_oauth_access_token_with_http_info(user_id, provider, opts = {}) ⇒ Array<(Array<GetOAuthAccessToken200ResponseInner>, Integer, Hash)>

Retrieve the OAuth access token of a user Fetch the corresponding OAuth access token for a user that has previously authenticated with a particular OAuth provider. For OAuth 2.0, if the access token has expired and we have a corresponding refresh token, the access token will be refreshed transparently the new one will be returned. GET array

Parameters:

  • user_id (String)

    The ID of the user for which to retrieve the OAuth access token

  • provider (String)

    The ID of the OAuth provider (e.g. &#x60;oauth_google&#x60;)

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

    the optional parameters

Returns:



637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
# File 'lib/clerk-http-client/api/users_api.rb', line 637

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

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

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

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

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

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

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

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

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

Retrieve a user Retrieve the details of a user

Parameters:

  • user_id (String)

    The ID of the user to retrieve

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

    the optional parameters

Returns:



695
696
697
698
# File 'lib/clerk-http-client/api/users_api.rb', line 695

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

#get_user_list(opts = {}) ⇒ Array<User>

List all users Returns a list of all users. The users are returned sorted by creation date, with the newest users appearing first.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :email_address (Array<String>)

    Returns users with the specified email addresses. Accepts up to 100 email addresses. Any email addresses not found are ignored.

  • :phone_number (Array<String>)

    Returns users with the specified phone numbers. Accepts up to 100 phone numbers. Any phone numbers not found are ignored.

  • :external_id (Array<String>)

    Returns users with the specified external ids. For each external id, the &#x60;+&#x60; and &#x60;-&#x60; can be prepended to the id, which denote whether the respective external id should be included or excluded from the result set. Accepts up to 100 external ids. Any external ids not found are ignored.

  • :username (Array<String>)

    Returns users with the specified usernames. Accepts up to 100 usernames. Any usernames not found are ignored.

  • :web3_wallet (Array<String>)

    Returns users with the specified web3 wallet addresses. Accepts up to 100 web3 wallet addresses. Any web3 wallet addressed not found are ignored.

  • :user_id (Array<String>)

    Returns users with the user ids specified. For each user id, the &#x60;+&#x60; and &#x60;-&#x60; can be prepended to the id, which denote whether the respective user id should be included or excluded from the result set. Accepts up to 100 user ids. Any user ids not found are ignored.

  • :organization_id (Array<String>)

    Returns users that have memberships to the given organizations. For each organization id, the &#x60;+&#x60; and &#x60;-&#x60; can be prepended to the id, which denote whether the respective organization should be included or excluded from the result set. Accepts up to 100 organization ids.

  • :query (String)

    Returns users that match the given query. For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names. The query value doesn&#39;t need to match the exact value you are looking for, it is capable of partial matches as well.

  • :email_address_query (String)

    Returns users with emails that match the given query, via case-insensitive partial match. For example, &#x60;email_address_query&#x3D;ello&#x60; will match a user with the email &#x60;[email protected]&#x60;.

  • :phone_number_query (String)

    Returns users with phone numbers that match the given query, via case-insensitive partial match. For example, &#x60;phone_number_query&#x3D;555&#x60; will match a user with the phone number &#x60;+1555xxxxxxx&#x60;.

  • :username_query (String)

    Returns users with usernames that match the given query, via case-insensitive partial match. For example, &#x60;username_query&#x3D;CoolUser&#x60; will match a user with the username &#x60;SomeCoolUser&#x60;.

  • :name_query (String)

    Returns users with names that match the given query, via case-insensitive partial match.

  • :last_active_at_before (Integer)

    Returns users whose last session activity was before the given date (with millisecond precision). Example: use 1700690400000 to retrieve users whose last session activity was before 2023-11-23.

  • :last_active_at_after (Integer)

    Returns users whose last session activity was after the given date (with millisecond precision). Example: use 1700690400000 to retrieve users whose last session activity was after 2023-11-23.

  • :last_active_at_since (Integer)

    Returns users that had session activity since the given date. Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day. Deprecated in favor of &#x60;last_active_at_after&#x60;.

  • :created_at_before (Integer)

    Returns users who have been created before the given date (with millisecond precision). Example: use 1730160000000 to retrieve users who have been created before 2024-10-29.

  • :created_at_after (Integer)

    Returns users who have been created after the given date (with millisecond precision). Example: use 1730160000000 to retrieve users who have been created after 2024-10-29.

  • :limit (Float)

    Applies a limit to the number of results returned. Can be used for paginating the results together with &#x60;offset&#x60;. (default to 10)

  • :offset (Float)

    Skip the first &#x60;offset&#x60; results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with &#x60;limit&#x60;. (default to 0)

  • :order_by (String)

    Allows to return users in a particular order. At the moment, you can order the returned users by their &#x60;created_at&#x60;,&#x60;updated_at&#x60;,&#x60;email_address&#x60;,&#x60;web3wallet&#x60;,&#x60;first_name&#x60;,&#x60;last_name&#x60;,&#x60;phone_number&#x60;,&#x60;username&#x60;,&#x60;last_active_at&#x60;,&#x60;last_sign_in_at&#x60;. In order to specify the direction, you can use the &#x60;+/-&#x60; symbols prepended in the property to order by. For example, if you want users to be returned in descending order according to their &#x60;created_at&#x60; property, you can use &#x60;-created_at&#x60;. If you don&#39;t use &#x60;+&#x60; or &#x60;-&#x60;, then &#x60;+&#x60; is implied. We only support one &#x60;order_by&#x60; parameter, and if multiple &#x60;order_by&#x60; parameters are provided, we will only keep the first one. For example, if you pass &#x60;order_by&#x3D;username&amp;order_by&#x3D;created_at&#x60;, we will consider only the first &#x60;order_by&#x60; parameter, which is &#x60;username&#x60;. The &#x60;created_at&#x60; parameter will be ignored in this case. (default to ‘-created_at’)

Returns:



779
780
781
782
# File 'lib/clerk-http-client/api/users_api.rb', line 779

def get_user_list(opts = {})
  data, _status_code, _headers = get_user_list_with_http_info(opts)
  data
end

#get_user_list_with_http_info(opts = {}) ⇒ Array<(Array<User>, Integer, Hash)>

List all users Returns a list of all users. The users are returned sorted by creation date, with the newest users appearing first. GET array

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :email_address (Array<String>)

    Returns users with the specified email addresses. Accepts up to 100 email addresses. Any email addresses not found are ignored.

  • :phone_number (Array<String>)

    Returns users with the specified phone numbers. Accepts up to 100 phone numbers. Any phone numbers not found are ignored.

  • :external_id (Array<String>)

    Returns users with the specified external ids. For each external id, the &#x60;+&#x60; and &#x60;-&#x60; can be prepended to the id, which denote whether the respective external id should be included or excluded from the result set. Accepts up to 100 external ids. Any external ids not found are ignored.

  • :username (Array<String>)

    Returns users with the specified usernames. Accepts up to 100 usernames. Any usernames not found are ignored.

  • :web3_wallet (Array<String>)

    Returns users with the specified web3 wallet addresses. Accepts up to 100 web3 wallet addresses. Any web3 wallet addressed not found are ignored.

  • :user_id (Array<String>)

    Returns users with the user ids specified. For each user id, the &#x60;+&#x60; and &#x60;-&#x60; can be prepended to the id, which denote whether the respective user id should be included or excluded from the result set. Accepts up to 100 user ids. Any user ids not found are ignored.

  • :organization_id (Array<String>)

    Returns users that have memberships to the given organizations. For each organization id, the &#x60;+&#x60; and &#x60;-&#x60; can be prepended to the id, which denote whether the respective organization should be included or excluded from the result set. Accepts up to 100 organization ids.

  • :query (String)

    Returns users that match the given query. For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names. The query value doesn&#39;t need to match the exact value you are looking for, it is capable of partial matches as well.

  • :email_address_query (String)

    Returns users with emails that match the given query, via case-insensitive partial match. For example, &#x60;email_address_query&#x3D;ello&#x60; will match a user with the email &#x60;[email protected]&#x60;.

  • :phone_number_query (String)

    Returns users with phone numbers that match the given query, via case-insensitive partial match. For example, &#x60;phone_number_query&#x3D;555&#x60; will match a user with the phone number &#x60;+1555xxxxxxx&#x60;.

  • :username_query (String)

    Returns users with usernames that match the given query, via case-insensitive partial match. For example, &#x60;username_query&#x3D;CoolUser&#x60; will match a user with the username &#x60;SomeCoolUser&#x60;.

  • :name_query (String)

    Returns users with names that match the given query, via case-insensitive partial match.

  • :last_active_at_before (Integer)

    Returns users whose last session activity was before the given date (with millisecond precision). Example: use 1700690400000 to retrieve users whose last session activity was before 2023-11-23.

  • :last_active_at_after (Integer)

    Returns users whose last session activity was after the given date (with millisecond precision). Example: use 1700690400000 to retrieve users whose last session activity was after 2023-11-23.

  • :last_active_at_since (Integer)

    Returns users that had session activity since the given date. Example: use 1700690400000 to retrieve users that had session activity from 2023-11-23 until the current day. Deprecated in favor of &#x60;last_active_at_after&#x60;.

  • :created_at_before (Integer)

    Returns users who have been created before the given date (with millisecond precision). Example: use 1730160000000 to retrieve users who have been created before 2024-10-29.

  • :created_at_after (Integer)

    Returns users who have been created after the given date (with millisecond precision). Example: use 1730160000000 to retrieve users who have been created after 2024-10-29.

  • :limit (Float)

    Applies a limit to the number of results returned. Can be used for paginating the results together with &#x60;offset&#x60;. (default to 10)

  • :offset (Float)

    Skip the first &#x60;offset&#x60; results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with &#x60;limit&#x60;. (default to 0)

  • :order_by (String)

    Allows to return users in a particular order. At the moment, you can order the returned users by their &#x60;created_at&#x60;,&#x60;updated_at&#x60;,&#x60;email_address&#x60;,&#x60;web3wallet&#x60;,&#x60;first_name&#x60;,&#x60;last_name&#x60;,&#x60;phone_number&#x60;,&#x60;username&#x60;,&#x60;last_active_at&#x60;,&#x60;last_sign_in_at&#x60;. In order to specify the direction, you can use the &#x60;+/-&#x60; symbols prepended in the property to order by. For example, if you want users to be returned in descending order according to their &#x60;created_at&#x60; property, you can use &#x60;-created_at&#x60;. If you don&#39;t use &#x60;+&#x60; or &#x60;-&#x60;, then &#x60;+&#x60; is implied. We only support one &#x60;order_by&#x60; parameter, and if multiple &#x60;order_by&#x60; parameters are provided, we will only keep the first one. For example, if you pass &#x60;order_by&#x3D;username&amp;order_by&#x3D;created_at&#x60;, we will consider only the first &#x60;order_by&#x60; parameter, which is &#x60;username&#x60;. The &#x60;created_at&#x60; parameter will be ignored in this case. (default to ‘-created_at’)

Returns:

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

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



809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
# File 'lib/clerk-http-client/api/users_api.rb', line 809

def get_user_list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.get_user_list ...'
  end
  if @api_client.config.client_side_validation && !opts[:'query'].nil? && opts[:'query'].to_s.length < 3
    fail ArgumentError, 'invalid value for "opts[:"query"]" when calling UsersApi.get_user_list, the character length must be great than or equal to 3.'
  end

  if @api_client.config.client_side_validation && !opts[:'email_address_query'].nil? && opts[:'email_address_query'].to_s.length < 3
    fail ArgumentError, 'invalid value for "opts[:"email_address_query"]" when calling UsersApi.get_user_list, the character length must be great than or equal to 3.'
  end

  if @api_client.config.client_side_validation && !opts[:'phone_number_query'].nil? && opts[:'phone_number_query'].to_s.length < 3
    fail ArgumentError, 'invalid value for "opts[:"phone_number_query"]" when calling UsersApi.get_user_list, the character length must be great than or equal to 3.'
  end

  if @api_client.config.client_side_validation && !opts[:'username_query'].nil? && opts[:'username_query'].to_s.length < 3
    fail ArgumentError, 'invalid value for "opts[:"username_query"]" when calling UsersApi.get_user_list, the character length must be great than or equal to 3.'
  end

  if @api_client.config.client_side_validation && !opts[:'name_query'].nil? && opts[:'name_query'].to_s.length < 3
    fail ArgumentError, 'invalid value for "opts[:"name_query"]" when calling UsersApi.get_user_list, the character length must be great than or equal to 3.'
  end

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

  # resource path
  local_var_path = '/users'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'email_address'] = @api_client.build_collection_param(opts[:'email_address'], :multi) if !opts[:'email_address'].nil?
  query_params[:'phone_number'] = @api_client.build_collection_param(opts[:'phone_number'], :multi) if !opts[:'phone_number'].nil?
  query_params[:'external_id'] = @api_client.build_collection_param(opts[:'external_id'], :multi) if !opts[:'external_id'].nil?
  query_params[:'username'] = @api_client.build_collection_param(opts[:'username'], :multi) if !opts[:'username'].nil?
  query_params[:'web3_wallet'] = @api_client.build_collection_param(opts[:'web3_wallet'], :multi) if !opts[:'web3_wallet'].nil?
  query_params[:'user_id'] = @api_client.build_collection_param(opts[:'user_id'], :multi) if !opts[:'user_id'].nil?
  query_params[:'organization_id'] = @api_client.build_collection_param(opts[:'organization_id'], :multi) if !opts[:'organization_id'].nil?
  query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
  query_params[:'email_address_query'] = opts[:'email_address_query'] if !opts[:'email_address_query'].nil?
  query_params[:'phone_number_query'] = opts[:'phone_number_query'] if !opts[:'phone_number_query'].nil?
  query_params[:'username_query'] = opts[:'username_query'] if !opts[:'username_query'].nil?
  query_params[:'name_query'] = opts[:'name_query'] if !opts[:'name_query'].nil?
  query_params[:'last_active_at_before'] = opts[:'last_active_at_before'] if !opts[:'last_active_at_before'].nil?
  query_params[:'last_active_at_after'] = opts[:'last_active_at_after'] if !opts[:'last_active_at_after'].nil?
  query_params[:'last_active_at_since'] = opts[:'last_active_at_since'] if !opts[:'last_active_at_since'].nil?
  query_params[:'created_at_before'] = opts[:'created_at_before'] if !opts[:'created_at_before'].nil?
  query_params[:'created_at_after'] = opts[:'created_at_after'] if !opts[:'created_at_after'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].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']

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

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

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

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

  new_options = opts.merge(
    :operation => :"UsersApi.get_user_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#get_user_list\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<(User, Integer, Hash)>

Retrieve a user Retrieve the details of a user GET

Parameters:

  • user_id (String)

    The ID of the user to retrieve

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

    the optional parameters

Returns:

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

    User data, response status code and response headers



706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
# File 'lib/clerk-http-client/api/users_api.rb', line 706

def get_user_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.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 UsersApi.get_user"
  end
  # resource path
  local_var_path = '/users/{user_id}'.sub('{' + 'user_id' + '}', 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']) unless header_params['Accept']

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

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

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

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

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

#get_users_count(opts = {}) ⇒ TotalCount

Count users Returns a total count of all users that match the given filtering criteria.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :email_address (Array<String>)

    Counts users with the specified email addresses. Accepts up to 100 email addresses. Any email addresses not found are ignored.

  • :phone_number (Array<String>)

    Counts users with the specified phone numbers. Accepts up to 100 phone numbers. Any phone numbers not found are ignored.

  • :external_id (Array<String>)

    Counts users with the specified external ids. Accepts up to 100 external ids. Any external ids not found are ignored.

  • :username (Array<String>)

    Counts users with the specified usernames. Accepts up to 100 usernames. Any usernames not found are ignored.

  • :web3_wallet (Array<String>)

    Counts users with the specified web3 wallet addresses. Accepts up to 100 web3 wallet addresses. Any web3 wallet addressed not found are ignored.

  • :user_id (Array<String>)

    Counts users with the user ids specified. Accepts up to 100 user ids. Any user ids not found are ignored.

  • :query (String)

    Counts users that match the given query. For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names. The query value doesn&#39;t need to match the exact value you are looking for, it is capable of partial matches as well.

  • :email_address_query (String)

    Counts users with emails that match the given query, via case-insensitive partial match. For example, &#x60;email_address_query&#x3D;ello&#x60; will match a user with the email &#x60;[email protected]&#x60;, and will be included in the resulting count.

  • :phone_number_query (String)

    Counts users with phone numbers that match the given query, via case-insensitive partial match. For example, &#x60;phone_number_query&#x3D;555&#x60; will match a user with the phone number &#x60;+1555xxxxxxx&#x60;, and will be included in the resulting count.

  • :username_query (String)

    Counts users with usernames that match the given query, via case-insensitive partial match. For example, &#x60;username_query&#x3D;CoolUser&#x60; will match a user with the username &#x60;SomeCoolUser&#x60;, and will be included in the resulting count.

Returns:



920
921
922
923
# File 'lib/clerk-http-client/api/users_api.rb', line 920

def get_users_count(opts = {})
  data, _status_code, _headers = get_users_count_with_http_info(opts)
  data
end

#get_users_count_with_http_info(opts = {}) ⇒ Array<(TotalCount, Integer, Hash)>

Count users Returns a total count of all users that match the given filtering criteria. GET

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :email_address (Array<String>)

    Counts users with the specified email addresses. Accepts up to 100 email addresses. Any email addresses not found are ignored.

  • :phone_number (Array<String>)

    Counts users with the specified phone numbers. Accepts up to 100 phone numbers. Any phone numbers not found are ignored.

  • :external_id (Array<String>)

    Counts users with the specified external ids. Accepts up to 100 external ids. Any external ids not found are ignored.

  • :username (Array<String>)

    Counts users with the specified usernames. Accepts up to 100 usernames. Any usernames not found are ignored.

  • :web3_wallet (Array<String>)

    Counts users with the specified web3 wallet addresses. Accepts up to 100 web3 wallet addresses. Any web3 wallet addressed not found are ignored.

  • :user_id (Array<String>)

    Counts users with the user ids specified. Accepts up to 100 user ids. Any user ids not found are ignored.

  • :query (String)

    Counts users that match the given query. For possible matches, we check the email addresses, phone numbers, usernames, web3 wallets, user ids, first and last names. The query value doesn&#39;t need to match the exact value you are looking for, it is capable of partial matches as well.

  • :email_address_query (String)

    Counts users with emails that match the given query, via case-insensitive partial match. For example, &#x60;email_address_query&#x3D;ello&#x60; will match a user with the email &#x60;[email protected]&#x60;, and will be included in the resulting count.

  • :phone_number_query (String)

    Counts users with phone numbers that match the given query, via case-insensitive partial match. For example, &#x60;phone_number_query&#x3D;555&#x60; will match a user with the phone number &#x60;+1555xxxxxxx&#x60;, and will be included in the resulting count.

  • :username_query (String)

    Counts users with usernames that match the given query, via case-insensitive partial match. For example, &#x60;username_query&#x3D;CoolUser&#x60; will match a user with the username &#x60;SomeCoolUser&#x60;, and will be included in the resulting count.

Returns:

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

    TotalCount data, response status code and response headers



940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
# File 'lib/clerk-http-client/api/users_api.rb', line 940

def get_users_count_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.get_users_count ...'
  end
  if @api_client.config.client_side_validation && !opts[:'query'].nil? && opts[:'query'].to_s.length < 3
    fail ArgumentError, 'invalid value for "opts[:"query"]" when calling UsersApi.get_users_count, the character length must be great than or equal to 3.'
  end

  if @api_client.config.client_side_validation && !opts[:'email_address_query'].nil? && opts[:'email_address_query'].to_s.length < 3
    fail ArgumentError, 'invalid value for "opts[:"email_address_query"]" when calling UsersApi.get_users_count, the character length must be great than or equal to 3.'
  end

  if @api_client.config.client_side_validation && !opts[:'phone_number_query'].nil? && opts[:'phone_number_query'].to_s.length < 3
    fail ArgumentError, 'invalid value for "opts[:"phone_number_query"]" when calling UsersApi.get_users_count, the character length must be great than or equal to 3.'
  end

  if @api_client.config.client_side_validation && !opts[:'username_query'].nil? && opts[:'username_query'].to_s.length < 3
    fail ArgumentError, 'invalid value for "opts[:"username_query"]" when calling UsersApi.get_users_count, the character length must be great than or equal to 3.'
  end

  # resource path
  local_var_path = '/users/count'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'email_address'] = @api_client.build_collection_param(opts[:'email_address'], :multi) if !opts[:'email_address'].nil?
  query_params[:'phone_number'] = @api_client.build_collection_param(opts[:'phone_number'], :multi) if !opts[:'phone_number'].nil?
  query_params[:'external_id'] = @api_client.build_collection_param(opts[:'external_id'], :multi) if !opts[:'external_id'].nil?
  query_params[:'username'] = @api_client.build_collection_param(opts[:'username'], :multi) if !opts[:'username'].nil?
  query_params[:'web3_wallet'] = @api_client.build_collection_param(opts[:'web3_wallet'], :multi) if !opts[:'web3_wallet'].nil?
  query_params[:'user_id'] = @api_client.build_collection_param(opts[:'user_id'], :multi) if !opts[:'user_id'].nil?
  query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
  query_params[:'email_address_query'] = opts[:'email_address_query'] if !opts[:'email_address_query'].nil?
  query_params[:'phone_number_query'] = opts[:'phone_number_query'] if !opts[:'phone_number_query'].nil?
  query_params[:'username_query'] = opts[:'username_query'] if !opts[:'username_query'].nil?

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

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

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

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

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

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

#lock_user(user_id, opts = {}) ⇒ User

Lock a user Marks the given user as locked, which means they are not allowed to sign in again until the lock expires. Lock duration can be configured in the instance’s restrictions settings.

Parameters:

  • user_id (String)

    The ID of the user to lock

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

    the optional parameters

Returns:



1016
1017
1018
1019
# File 'lib/clerk-http-client/api/users_api.rb', line 1016

def lock_user(user_id, opts = {})
  data, _status_code, _headers = lock_user_with_http_info(user_id, opts)
  data
end

#lock_user_with_http_info(user_id, opts = {}) ⇒ Array<(User, Integer, Hash)>

Lock a user Marks the given user as locked, which means they are not allowed to sign in again until the lock expires. Lock duration can be configured in the instance&#39;s restrictions settings. POST

Parameters:

  • user_id (String)

    The ID of the user to lock

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

    the optional parameters

Returns:

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

    User data, response status code and response headers



1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
# File 'lib/clerk-http-client/api/users_api.rb', line 1027

def lock_user_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.lock_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 UsersApi.lock_user"
  end
  # resource path
  local_var_path = '/users/{user_id}/lock'.sub('{' + 'user_id' + '}', 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']) unless header_params['Accept']

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

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

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

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

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

#set_user_profile_image(user_id, opts = {}) ⇒ User

Set user profile image Update a user’s profile image

Parameters:

  • user_id (String)

    The ID of the user to update the profile image for

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

    the optional parameters

Options Hash (opts):

  • :file (File)

Returns:



1082
1083
1084
1085
# File 'lib/clerk-http-client/api/users_api.rb', line 1082

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

#set_user_profile_image_with_http_info(user_id, opts = {}) ⇒ Array<(User, Integer, Hash)>

Set user profile image Update a user&#39;s profile image POST

Parameters:

  • user_id (String)

    The ID of the user to update the profile image for

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

    the optional parameters

Options Hash (opts):

  • :file (File)

Returns:

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

    User data, response status code and response headers



1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
# File 'lib/clerk-http-client/api/users_api.rb', line 1094

def (user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.set_user_profile_image ...'
  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.set_user_profile_image"
  end
  # resource path
  local_var_path = '/users/{user_id}/profile_image'.sub('{' + 'user_id' + '}', 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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['multipart/form-data'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['file'] = opts[:'file'] if !opts[:'file'].nil?

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

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

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

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

#unban_user(user_id, opts = {}) ⇒ User

Unban a user Removes the ban mark from the given user.

Parameters:

  • user_id (String)

    The ID of the user to unban

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

    the optional parameters

Returns:



1154
1155
1156
1157
# File 'lib/clerk-http-client/api/users_api.rb', line 1154

def unban_user(user_id, opts = {})
  data, _status_code, _headers = unban_user_with_http_info(user_id, opts)
  data
end

#unban_user_with_http_info(user_id, opts = {}) ⇒ Array<(User, Integer, Hash)>

Unban a user Removes the ban mark from the given user. POST

Parameters:

  • user_id (String)

    The ID of the user to unban

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

    the optional parameters

Returns:

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

    User data, response status code and response headers



1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
# File 'lib/clerk-http-client/api/users_api.rb', line 1165

def unban_user_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.unban_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 UsersApi.unban_user"
  end
  # resource path
  local_var_path = '/users/{user_id}/unban'.sub('{' + 'user_id' + '}', 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']) unless header_params['Accept']

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

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

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

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

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

#unlock_user(user_id, opts = {}) ⇒ User

Unlock a user Removes the lock from the given user.

Parameters:

  • user_id (String)

    The ID of the user to unlock

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

    the optional parameters

Returns:



1219
1220
1221
1222
# File 'lib/clerk-http-client/api/users_api.rb', line 1219

def unlock_user(user_id, opts = {})
  data, _status_code, _headers = unlock_user_with_http_info(user_id, opts)
  data
end

#unlock_user_with_http_info(user_id, opts = {}) ⇒ Array<(User, Integer, Hash)>

Unlock a user Removes the lock from the given user. POST

Parameters:

  • user_id (String)

    The ID of the user to unlock

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

    the optional parameters

Returns:

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

    User data, response status code and response headers



1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
# File 'lib/clerk-http-client/api/users_api.rb', line 1230

def unlock_user_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.unlock_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 UsersApi.unlock_user"
  end
  # resource path
  local_var_path = '/users/{user_id}/unlock'.sub('{' + 'user_id' + '}', 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']) unless header_params['Accept']

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

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

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

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

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

#update_user(user_id, update_user_request, opts = {}) ⇒ User

Update a user Update a user’s attributes. You can set the user’s primary contact identifiers (email address and phone numbers) by updating the ‘primary_email_address_id` and `primary_phone_number_id` attributes respectively. Both IDs should correspond to verified identifications that belong to the user. You can remove a user’s username by setting the username attribute to null or the blank string "". This is a destructive action; the identification will be deleted forever. Usernames can be removed only if they are optional in your instance settings and there’s at least one other identifier which can be used for authentication. This endpoint allows changing a user’s password. When passing the ‘password` parameter directly you have two further options. You can ignore the password policy checks for your instance by setting the `skip_password_checks` parameter to `true`. You can also choose to sign the user out of all their active sessions on any device once the password is updated. Just set `sign_out_of_other_sessions` to `true`.

Parameters:

  • user_id (String)

    The ID of the user to update

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

    the optional parameters

Returns:



1285
1286
1287
1288
# File 'lib/clerk-http-client/api/users_api.rb', line 1285

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

#update_user_metadata(user_id, opts = {}) ⇒ User

Merge and update a user’s metadata Update a user’s metadata attributes by merging existing values with the provided parameters. This endpoint behaves differently than the *Update a user* endpoint. Metadata values will not be replaced entirely. Instead, a deep merge will be performed. Deep means that any nested JSON objects will be merged as well. You can remove metadata keys at any level by setting their value to ‘null`.

Parameters:

  • user_id (String)

    The ID of the user whose metadata will be updated and merged

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

    the optional parameters

Options Hash (opts):

Returns:



1361
1362
1363
1364
# File 'lib/clerk-http-client/api/users_api.rb', line 1361

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

#update_user_metadata_with_http_info(user_id, opts = {}) ⇒ Array<(User, Integer, Hash)>

Merge and update a user&#39;s metadata Update a user&#39;s metadata attributes by merging existing values with the provided parameters. This endpoint behaves differently than the *Update a user* endpoint. Metadata values will not be replaced entirely. Instead, a deep merge will be performed. Deep means that any nested JSON objects will be merged as well. You can remove metadata keys at any level by setting their value to &#x60;null&#x60;. PATCH

Parameters:

  • user_id (String)

    The ID of the user whose metadata will be updated and merged

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

    the optional parameters

Options Hash (opts):

Returns:

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

    User data, response status code and response headers



1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
# File 'lib/clerk-http-client/api/users_api.rb', line 1373

def (user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.update_user_metadata ...'
  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.update_user_metadata"
  end
  # resource path
  local_var_path = '/users/{user_id}/metadata'.sub('{' + 'user_id' + '}', 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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

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

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

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

#update_user_with_http_info(user_id, update_user_request, opts = {}) ⇒ Array<(User, Integer, Hash)>

Update a user Update a user&#39;s attributes. You can set the user&#39;s primary contact identifiers (email address and phone numbers) by updating the &#x60;primary_email_address_id&#x60; and &#x60;primary_phone_number_id&#x60; attributes respectively. Both IDs should correspond to verified identifications that belong to the user. You can remove a user&#39;s username by setting the username attribute to null or the blank string &quot;&quot;. This is a destructive action; the identification will be deleted forever. Usernames can be removed only if they are optional in your instance settings and there&#39;s at least one other identifier which can be used for authentication. This endpoint allows changing a user&#39;s password. When passing the &#x60;password&#x60; parameter directly you have two further options. You can ignore the password policy checks for your instance by setting the &#x60;skip_password_checks&#x60; parameter to &#x60;true&#x60;. You can also choose to sign the user out of all their active sessions on any device once the password is updated. Just set &#x60;sign_out_of_other_sessions&#x60; to &#x60;true&#x60;. PATCH

Parameters:

  • user_id (String)

    The ID of the user to update

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

    the optional parameters

Returns:

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

    User data, response status code and response headers



1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
# File 'lib/clerk-http-client/api/users_api.rb', line 1297

def update_user_with_http_info(user_id, update_user_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.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 UsersApi.update_user"
  end
  # verify the required parameter 'update_user_request' is set
  if @api_client.config.client_side_validation && update_user_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_user_request' when calling UsersApi.update_user"
  end
  # resource path
  local_var_path = '/users/{user_id}'.sub('{' + 'user_id' + '}', 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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

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

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

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

#user_passkey_delete(user_id, passkey_identification_id, opts = {}) ⇒ DeletedObject

Delete a user passkey Delete the passkey identification for a given user and notify them through email.

Parameters:

  • user_id (String)

    The ID of the user that owns the passkey identity

  • passkey_identification_id (String)

    The ID of the passkey identity to be deleted

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

    the optional parameters

Returns:



1433
1434
1435
1436
# File 'lib/clerk-http-client/api/users_api.rb', line 1433

def user_passkey_delete(user_id, passkey_identification_id, opts = {})
  data, _status_code, _headers = user_passkey_delete_with_http_info(user_id, passkey_identification_id, opts)
  data
end

#user_passkey_delete_with_http_info(user_id, passkey_identification_id, opts = {}) ⇒ Array<(DeletedObject, Integer, Hash)>

Delete a user passkey Delete the passkey identification for a given user and notify them through email. DELETE

Parameters:

  • user_id (String)

    The ID of the user that owns the passkey identity

  • passkey_identification_id (String)

    The ID of the passkey identity to be deleted

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

    the optional parameters

Returns:

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

    DeletedObject data, response status code and response headers



1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
# File 'lib/clerk-http-client/api/users_api.rb', line 1445

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

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

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

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

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

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

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

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

#user_web3_wallet_delete(user_id, web3_wallet_identification_id, opts = {}) ⇒ DeletedObject

Delete a user web3 wallet Delete the web3 wallet identification for a given user.

Parameters:

  • user_id (String)

    The ID of the user that owns the web3 wallet

  • web3_wallet_identification_id (String)

    The ID of the web3 wallet identity to be deleted

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

    the optional parameters

Returns:



1504
1505
1506
1507
# File 'lib/clerk-http-client/api/users_api.rb', line 1504

def user_web3_wallet_delete(user_id, web3_wallet_identification_id, opts = {})
  data, _status_code, _headers = user_web3_wallet_delete_with_http_info(user_id, web3_wallet_identification_id, opts)
  data
end

#user_web3_wallet_delete_with_http_info(user_id, web3_wallet_identification_id, opts = {}) ⇒ Array<(DeletedObject, Integer, Hash)>

Delete a user web3 wallet Delete the web3 wallet identification for a given user. DELETE

Parameters:

  • user_id (String)

    The ID of the user that owns the web3 wallet

  • web3_wallet_identification_id (String)

    The ID of the web3 wallet identity to be deleted

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

    the optional parameters

Returns:

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

    DeletedObject data, response status code and response headers



1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
# File 'lib/clerk-http-client/api/users_api.rb', line 1516

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

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

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

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

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

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

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

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

#users_get_organization_invitations(user_id, opts = {}) ⇒ OrganizationInvitationsWithPublicOrganizationData

Retrieve all invitations for a user Retrieve a paginated list of the user’s organization invitations

Parameters:

  • user_id (String)

    The ID of the user whose organization invitations we want to retrieve

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

    the optional parameters

Options Hash (opts):

  • :limit (Float)

    Applies a limit to the number of results returned. Can be used for paginating the results together with &#x60;offset&#x60;. (default to 10)

  • :offset (Float)

    Skip the first &#x60;offset&#x60; results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with &#x60;limit&#x60;. (default to 0)

  • :status (String)

    Filter organization invitations based on their status

Returns:



1577
1578
1579
1580
# File 'lib/clerk-http-client/api/users_api.rb', line 1577

def users_get_organization_invitations(user_id, opts = {})
  data, _status_code, _headers = users_get_organization_invitations_with_http_info(user_id, opts)
  data
end

#users_get_organization_invitations_with_http_info(user_id, opts = {}) ⇒ Array<(OrganizationInvitationsWithPublicOrganizationData, Integer, Hash)>

Retrieve all invitations for a user Retrieve a paginated list of the user&#39;s organization invitations GET

Parameters:

  • user_id (String)

    The ID of the user whose organization invitations we want to retrieve

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

    the optional parameters

Options Hash (opts):

  • :limit (Float)

    Applies a limit to the number of results returned. Can be used for paginating the results together with &#x60;offset&#x60;. (default to 10)

  • :offset (Float)

    Skip the first &#x60;offset&#x60; results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with &#x60;limit&#x60;. (default to 0)

  • :status (String)

    Filter organization invitations based on their status

Returns:



1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
# File 'lib/clerk-http-client/api/users_api.rb', line 1591

def users_get_organization_invitations_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_get_organization_invitations ...'
  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.users_get_organization_invitations"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UsersApi.users_get_organization_invitations, must be smaller than or equal to 500.'
  end

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

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

  allowable_values = ["pending", "accepted", "revoked"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/users/{user_id}/organization_invitations'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].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']

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

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

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

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

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

#users_get_organization_memberships(user_id, opts = {}) ⇒ OrganizationMemberships

Retrieve all memberships for a user Retrieve a paginated list of the user’s organization memberships

Parameters:

  • user_id (String)

    The ID of the user whose organization memberships we want to retrieve

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

    the optional parameters

Options Hash (opts):

  • :limit (Float)

    Applies a limit to the number of results returned. Can be used for paginating the results together with &#x60;offset&#x60;. (default to 10)

  • :offset (Float)

    Skip the first &#x60;offset&#x60; results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with &#x60;limit&#x60;. (default to 0)

Returns:



1666
1667
1668
1669
# File 'lib/clerk-http-client/api/users_api.rb', line 1666

def users_get_organization_memberships(user_id, opts = {})
  data, _status_code, _headers = users_get_organization_memberships_with_http_info(user_id, opts)
  data
end

#users_get_organization_memberships_with_http_info(user_id, opts = {}) ⇒ Array<(OrganizationMemberships, Integer, Hash)>

Retrieve all memberships for a user Retrieve a paginated list of the user&#39;s organization memberships GET

Parameters:

  • user_id (String)

    The ID of the user whose organization memberships we want to retrieve

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

    the optional parameters

Options Hash (opts):

  • :limit (Float)

    Applies a limit to the number of results returned. Can be used for paginating the results together with &#x60;offset&#x60;. (default to 10)

  • :offset (Float)

    Skip the first &#x60;offset&#x60; results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with &#x60;limit&#x60;. (default to 0)

Returns:

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

    OrganizationMemberships data, response status code and response headers



1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
# File 'lib/clerk-http-client/api/users_api.rb', line 1679

def users_get_organization_memberships_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_get_organization_memberships ...'
  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.users_get_organization_memberships"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UsersApi.users_get_organization_memberships, must be smaller than or equal to 500.'
  end

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

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

  # resource path
  local_var_path = '/users/{user_id}/organization_memberships'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].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']

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

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

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

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

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

#verify_password(user_id, opts = {}) ⇒ VerifyPassword200Response

Verify the password of a user Check that the user’s password matches the supplied input. Useful for custom auth flows and re-verification.

Parameters:

  • user_id (String)

    The ID of the user for whom to verify the password

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

    the optional parameters

Options Hash (opts):

Returns:



1748
1749
1750
1751
# File 'lib/clerk-http-client/api/users_api.rb', line 1748

def verify_password(user_id, opts = {})
  data, _status_code, _headers = verify_password_with_http_info(user_id, opts)
  data
end

#verify_password_with_http_info(user_id, opts = {}) ⇒ Array<(VerifyPassword200Response, Integer, Hash)>

Verify the password of a user Check that the user&#39;s password matches the supplied input. Useful for custom auth flows and re-verification. POST

Parameters:

  • user_id (String)

    The ID of the user for whom to verify the password

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

    the optional parameters

Options Hash (opts):

Returns:

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

    VerifyPassword200Response data, response status code and response headers



1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
# File 'lib/clerk-http-client/api/users_api.rb', line 1760

def verify_password_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.verify_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.verify_password"
  end
  # resource path
  local_var_path = '/users/{user_id}/verify_password'.sub('{' + 'user_id' + '}', 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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

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

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

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

#verify_totp(user_id, opts = {}) ⇒ VerifyTOTP200Response

Verify a TOTP or backup code for a user Verify that the provided TOTP or backup code is valid for the user. Verifying a backup code will result it in being consumed (i.e. it will become invalid). Useful for custom auth flows and re-verification.

Parameters:

  • user_id (String)

    The ID of the user for whom to verify the TOTP

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

    the optional parameters

Options Hash (opts):

Returns:



1820
1821
1822
1823
# File 'lib/clerk-http-client/api/users_api.rb', line 1820

def verify_totp(user_id, opts = {})
  data, _status_code, _headers = verify_totp_with_http_info(user_id, opts)
  data
end

#verify_totp_with_http_info(user_id, opts = {}) ⇒ Array<(VerifyTOTP200Response, Integer, Hash)>

Verify a TOTP or backup code for a user Verify that the provided TOTP or backup code is valid for the user. Verifying a backup code will result it in being consumed (i.e. it will become invalid). Useful for custom auth flows and re-verification. POST

Parameters:

  • user_id (String)

    The ID of the user for whom to verify the TOTP

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

    the optional parameters

Options Hash (opts):

Returns:

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

    VerifyTOTP200Response data, response status code and response headers



1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
# File 'lib/clerk-http-client/api/users_api.rb', line 1832

def verify_totp_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.verify_totp ...'
  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.verify_totp"
  end
  # resource path
  local_var_path = '/users/{user_id}/verify_totp'.sub('{' + 'user_id' + '}', 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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

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

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

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