Class: Mudbase::UsersApi

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

def api_client
  @api_client
end

Instance Method Details

#users_change_password(change_password_request, opts = {}) ⇒ MessageResponse

Change password Change the current user’s password. Accepts JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

  • change_password_request (ChangePasswordRequest)

    Current password and new password.

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

    the optional parameters

Returns:



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

def users_change_password(change_password_request, opts = {})
  data, _status_code, _headers = users_change_password_with_http_info(change_password_request, opts)
  data
end

#users_change_password_with_http_info(change_password_request, opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Change password Change the current user&#39;s password. Accepts JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

  • change_password_request (ChangePasswordRequest)

    Current password and new password.

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

    the optional parameters

Returns:

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

    MessageResponse data, response status code and response headers



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

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

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) 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(change_password_request)

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

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

  new_options = opts.merge(
    :operation => :"UsersApi.users_change_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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#users_change_password\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#users_disable2fa(users_disable2fa_request, opts = {}) ⇒ MessageResponse

Disable 2FA Disable two-factor authentication for the current user. Requires JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

  • users_disable2fa_request (UsersDisable2faRequest)

    Current password and one-time code to confirm disable.

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

    the optional parameters

Returns:



95
96
97
98
# File 'lib/mudbase/api/users_api.rb', line 95

def users_disable2fa(users_disable2fa_request, opts = {})
  data, _status_code, _headers = users_disable2fa_with_http_info(users_disable2fa_request, opts)
  data
end

#users_disable2fa_with_http_info(users_disable2fa_request, opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Disable 2FA Disable two-factor authentication for the current user. Requires JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

  • users_disable2fa_request (UsersDisable2faRequest)

    Current password and one-time code to confirm disable.

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

    the optional parameters

Returns:

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

    MessageResponse data, response status code and response headers



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
156
# File 'lib/mudbase/api/users_api.rb', line 105

def users_disable2fa_with_http_info(users_disable2fa_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_disable2fa ...'
  end
  # verify the required parameter 'users_disable2fa_request' is set
  if @api_client.config.client_side_validation && users_disable2fa_request.nil?
    fail ArgumentError, "Missing the required parameter 'users_disable2fa_request' when calling UsersApi.users_disable2fa"
  end
  # resource path
  local_var_path = '/api/users/2fa/disable'

  # 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(users_disable2fa_request)

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

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

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

#users_erase_data(users_erase_data_request, opts = {}) ⇒ UsersEraseData200Response

Delete user data (GDPR Article 17) Request account erasure (right to be forgotten). Anonymizes PII and deactivates account with 7-day grace period. Accepts JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

  • users_erase_data_request (UsersEraseDataRequest)

    Confirmation string (DELETE_MY_ACCOUNT) and optional reason for erasure.

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

    the optional parameters

Returns:



163
164
165
166
# File 'lib/mudbase/api/users_api.rb', line 163

def users_erase_data(users_erase_data_request, opts = {})
  data, _status_code, _headers = users_erase_data_with_http_info(users_erase_data_request, opts)
  data
end

#users_erase_data_with_http_info(users_erase_data_request, opts = {}) ⇒ Array<(UsersEraseData200Response, Integer, Hash)>

Delete user data (GDPR Article 17) Request account erasure (right to be forgotten). Anonymizes PII and deactivates account with 7-day grace period. Accepts JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

  • users_erase_data_request (UsersEraseDataRequest)

    Confirmation string (DELETE_MY_ACCOUNT) and optional reason for erasure.

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

    the optional parameters

Returns:

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

    UsersEraseData200Response data, response status code and response headers



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/mudbase/api/users_api.rb', line 173

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

  # 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(users_erase_data_request)

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

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

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

#users_export_data(opts = {}) ⇒ UsersExportData200Response

Export user data (GDPR Article 15) Export all user data in JSON format for GDPR data portability compliance. Accepts JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

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

    the optional parameters

Returns:



230
231
232
233
# File 'lib/mudbase/api/users_api.rb', line 230

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

#users_export_data_with_http_info(opts = {}) ⇒ Array<(UsersExportData200Response, Integer, Hash)>

Export user data (GDPR Article 15) Export all user data in JSON format for GDPR data portability compliance. Accepts JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

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

    the optional parameters

Returns:

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

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

def users_export_data_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_export_data ...'
  end
  # resource path
  local_var_path = '/api/users/me/export'

  # 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] || 'UsersExportData200Response'

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

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

#users_get(opts = {}) ⇒ UsersGet200Response

Get current user profile Get the current authenticated user’s profile. Accepts JWT Bearer token (BearerToken).

Parameters:

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

    the optional parameters

Returns:



287
288
289
290
# File 'lib/mudbase/api/users_api.rb', line 287

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

#users_get_with_http_info(opts = {}) ⇒ Array<(UsersGet200Response, Integer, Hash)>

Get current user profile Get the current authenticated user&#39;s profile. Accepts JWT Bearer token (BearerToken).

Parameters:

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

    the optional parameters

Returns:

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

    UsersGet200Response data, response status code and response headers



296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
# File 'lib/mudbase/api/users_api.rb', line 296

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

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) 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] || 'UsersGet200Response'

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

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

Link OAuth provider to account Initiate OAuth flow to link a new provider to the current account. Accepts JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

  • provider (String)

    OAuth provider to link (e.g. google, github).

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

    the optional parameters

Options Hash (opts):

  • :project_id (String)

    Project ID for the OAuth link context.

Returns:



346
347
348
349
# File 'lib/mudbase/api/users_api.rb', line 346

def users_link_o_auth_provider(provider, opts = {})
  data, _status_code, _headers = users_link_o_auth_provider_with_http_info(provider, opts)
  data
end

Link OAuth provider to account Initiate OAuth flow to link a new provider to the current account. Accepts JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

  • provider (String)

    OAuth provider to link (e.g. google, github).

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

    the optional parameters

Options Hash (opts):

  • :project_id (String)

    Project ID for the OAuth link context.

Returns:



357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
# File 'lib/mudbase/api/users_api.rb', line 357

def users_link_o_auth_provider_with_http_info(provider, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_link_o_auth_provider ...'
  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.users_link_o_auth_provider"
  end
  # verify enum value
  allowable_values = ["google", "github", "facebook", "microsoft", "apple", "twitter", "discord", "linkedin"]
  if @api_client.config.client_side_validation && !allowable_values.include?(provider)
    fail ArgumentError, "invalid value for \"provider\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/users/me/oauth-providers/link/{provider}'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'projectId'] = opts[:'project_id'] if !opts[:'project_id'].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] || 'UsersLinkOAuthProvider200Response'

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

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

#users_list_o_auth_providers(opts = {}) ⇒ UsersListOAuthProviders200Response

List linked OAuth providers Get all OAuth providers linked to the current user’s account. Accepts JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

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

    the optional parameters

Returns:



415
416
417
418
# File 'lib/mudbase/api/users_api.rb', line 415

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

#users_list_o_auth_providers_with_http_info(opts = {}) ⇒ Array<(UsersListOAuthProviders200Response, Integer, Hash)>

List linked OAuth providers Get all OAuth providers linked to the current user&#39;s account. Accepts JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

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

    the optional parameters

Returns:



424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
# File 'lib/mudbase/api/users_api.rb', line 424

def users_list_o_auth_providers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_list_o_auth_providers ...'
  end
  # resource path
  local_var_path = '/api/users/me/oauth-providers'

  # 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] || 'UsersListOAuthProviders200Response'

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

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

#users_resend_verification(opts = {}) ⇒ MessageResponse

Resend verification email Sends a new verification email to the authenticated user. Rate limited (e.g. 3 requests per 15 minutes per user). For app users the link includes project context.

Parameters:

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

    the optional parameters

Returns:



472
473
474
475
# File 'lib/mudbase/api/users_api.rb', line 472

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

#users_resend_verification_with_http_info(opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Resend verification email Sends a new verification email to the authenticated user. Rate limited (e.g. 3 requests per 15 minutes per user). For app users the link includes project context.

Parameters:

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

    the optional parameters

Returns:

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

    MessageResponse data, response status code and response headers



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
# File 'lib/mudbase/api/users_api.rb', line 481

def users_resend_verification_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_resend_verification ...'
  end
  # resource path
  local_var_path = '/api/users/resend-verification'

  # 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] || 'MessageResponse'

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

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

#users_setup2fa(opts = {}) ⇒ TwoFASetupResponse

Initiate two-factor authentication setup (secret, QR code, backup codes) Initiates two-factor authentication setup for the current user. Returns a secret, QR code, and manual entry key for the user to add to an authenticator app. Requires JWT Bearer token (BearerToken). API keys are not supported.

Parameters:

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

    the optional parameters

Returns:



529
530
531
532
# File 'lib/mudbase/api/users_api.rb', line 529

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

#users_setup2fa_with_http_info(opts = {}) ⇒ Array<(TwoFASetupResponse, Integer, Hash)>

Initiate two-factor authentication setup (secret, QR code, backup codes) Initiates two-factor authentication setup for the current user. Returns a secret, QR code, and manual entry key for the user to add to an authenticator app. Requires JWT Bearer token (BearerToken). API keys are not supported.

Parameters:

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

    the optional parameters

Returns:

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

    TwoFASetupResponse data, response status code and response headers



538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
# File 'lib/mudbase/api/users_api.rb', line 538

def users_setup2fa_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_setup2fa ...'
  end
  # resource path
  local_var_path = '/api/users/2fa/setup'

  # 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] || 'TwoFASetupResponse'

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

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

Unlink OAuth provider Remove an OAuth provider from the current account. Cannot unlink if it’s the only authentication method. Requires JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

  • provider (String)

    OAuth provider to unlink (e.g. google, github).

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

    the optional parameters

Returns:



587
588
589
590
# File 'lib/mudbase/api/users_api.rb', line 587

def users_unlink_o_auth_provider(provider, opts = {})
  data, _status_code, _headers = users_unlink_o_auth_provider_with_http_info(provider, opts)
  data
end

Unlink OAuth provider Remove an OAuth provider from the current account. Cannot unlink if it&#39;s the only authentication method. Requires JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

  • provider (String)

    OAuth provider to unlink (e.g. google, github).

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

    the optional parameters

Returns:



597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
# File 'lib/mudbase/api/users_api.rb', line 597

def users_unlink_o_auth_provider_with_http_info(provider, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_unlink_o_auth_provider ...'
  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.users_unlink_o_auth_provider"
  end
  # verify enum value
  allowable_values = ["google", "github", "facebook", "microsoft", "apple", "twitter", "discord", "linkedin"]
  if @api_client.config.client_side_validation && !allowable_values.include?(provider)
    fail ArgumentError, "invalid value for \"provider\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/users/me/oauth-providers/{provider}'.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] || 'UsersUnlinkOAuthProvider200Response'

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

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

#users_update(update_user_request, opts = {}) ⇒ UsersUpdate200Response

Update user profile Update the current user’s profile. Requires JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

  • update_user_request (UpdateUserRequest)

    Profile fields to update (firstName, lastName, avatar).

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

    the optional parameters

Returns:



655
656
657
658
# File 'lib/mudbase/api/users_api.rb', line 655

def users_update(update_user_request, opts = {})
  data, _status_code, _headers = users_update_with_http_info(update_user_request, opts)
  data
end

#users_update_with_http_info(update_user_request, opts = {}) ⇒ Array<(UsersUpdate200Response, Integer, Hash)>

Update user profile Update the current user&#39;s profile. Requires JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

  • update_user_request (UpdateUserRequest)

    Profile fields to update (firstName, lastName, avatar).

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

    the optional parameters

Returns:

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

    UsersUpdate200Response data, response status code and response headers



665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
# File 'lib/mudbase/api/users_api.rb', line 665

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

  # 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] || 'UsersUpdate200Response'

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

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

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

#users_verify2fa(users_verify2fa_request, opts = {}) ⇒ MessageResponse

Verify and enable 2FA Verify and enable two-factor authentication for the current user. Accepts JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

  • users_verify2fa_request (UsersVerify2faRequest)

    One-time code from the authenticator app.

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

    the optional parameters

Returns:



723
724
725
726
# File 'lib/mudbase/api/users_api.rb', line 723

def users_verify2fa(users_verify2fa_request, opts = {})
  data, _status_code, _headers = users_verify2fa_with_http_info(users_verify2fa_request, opts)
  data
end

#users_verify2fa_with_http_info(users_verify2fa_request, opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Verify and enable 2FA Verify and enable two-factor authentication for the current user. Accepts JWT Bearer token (BearerToken). API keys are not supported for this endpoint.

Parameters:

  • users_verify2fa_request (UsersVerify2faRequest)

    One-time code from the authenticator app.

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

    the optional parameters

Returns:

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

    MessageResponse data, response status code and response headers



733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
# File 'lib/mudbase/api/users_api.rb', line 733

def users_verify2fa_with_http_info(users_verify2fa_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_verify2fa ...'
  end
  # verify the required parameter 'users_verify2fa_request' is set
  if @api_client.config.client_side_validation && users_verify2fa_request.nil?
    fail ArgumentError, "Missing the required parameter 'users_verify2fa_request' when calling UsersApi.users_verify2fa"
  end
  # resource path
  local_var_path = '/api/users/2fa/verify'

  # 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(users_verify2fa_request)

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

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

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

#users_verify_email(users_verify_email_request, opts = {}) ⇒ MessageResponse

Verify email address (organization and project) Verifies the user’s email using the token from the link sent at signup. Works for both organization (platform) and app signups; the token is from the verification link (e.g. verify-email?token=… for org, or verify-email?token=…&project=… for project).

Parameters:

  • users_verify_email_request (UsersVerifyEmailRequest)

    Verification token from the email link; optional projectId for project context.

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

    the optional parameters

Returns:



791
792
793
794
# File 'lib/mudbase/api/users_api.rb', line 791

def users_verify_email(users_verify_email_request, opts = {})
  data, _status_code, _headers = users_verify_email_with_http_info(users_verify_email_request, opts)
  data
end

#users_verify_email_with_http_info(users_verify_email_request, opts = {}) ⇒ Array<(MessageResponse, Integer, Hash)>

Verify email address (organization and project) Verifies the user&#39;s email using the token from the link sent at signup. Works for both organization (platform) and app signups; the token is from the verification link (e.g. verify-email?token&#x3D;… for org, or verify-email?token&#x3D;…&amp;project&#x3D;… for project).

Parameters:

  • users_verify_email_request (UsersVerifyEmailRequest)

    Verification token from the email link; optional projectId for project context.

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

    the optional parameters

Returns:

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

    MessageResponse data, response status code and response headers



801
802
803
804
805
806
807
808
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
# File 'lib/mudbase/api/users_api.rb', line 801

def users_verify_email_with_http_info(users_verify_email_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.users_verify_email ...'
  end
  # verify the required parameter 'users_verify_email_request' is set
  if @api_client.config.client_side_validation && users_verify_email_request.nil?
    fail ArgumentError, "Missing the required parameter 'users_verify_email_request' when calling UsersApi.users_verify_email"
  end
  # resource path
  local_var_path = '/api/users/verify-email'

  # 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(users_verify_email_request)

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

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

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