stytch 5.0.2 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/stytch/users.rb CHANGED
@@ -1,170 +1,497 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # !!!
4
+ # WARNING: This file is autogenerated
5
+ # Only modify code within MANUAL() sections
6
+ # or your changes may be overwritten later!
7
+ # !!!
8
+
3
9
  require_relative 'request_helper'
4
10
 
5
11
  module Stytch
6
12
  class Users
7
13
  include Stytch::RequestHelper
8
14
 
9
- PATH = '/v1/users'
10
-
11
15
  def initialize(connection)
12
16
  @connection = connection
13
17
  end
14
18
 
15
- def search(query, limit: 100, cursor: nil)
16
- request = {
17
- query: query,
18
- limit: limit
19
- }
20
- request[:cursor] = cursor if cursor
21
- post_request("#{PATH}/search", request)
22
- end
23
-
24
- def search_all(query, limit: 100)
25
- Enumerator.new do |enum|
26
- cursor = nil
27
- loop do
28
- resp = search(query, limit: limit, cursor: cursor)
29
- resp['results'].each do |user|
30
- enum << user
31
- end
32
-
33
- cursor = resp['results_metadata']['next_cursor']
34
- break if cursor.nil?
35
- end
36
- end
37
- end
19
+ # Add a User to Stytch. A `user_id` is returned in the response that can then be used to perform other operations within Stytch. An `email` or a `phone_number` is required.
20
+ #
21
+ # == Parameters:
22
+ # email::
23
+ # The email address of the end user.
24
+ # The type of this field is nilable +String+.
25
+ # name::
26
+ # The name of the user. Each field in the name object is optional.
27
+ # The type of this field is nilable +Name+ (+object+).
28
+ # attributes::
29
+ # Provided attributes help with fraud detection.
30
+ # The type of this field is nilable +Attributes+ (+object+).
31
+ # phone_number::
32
+ # The phone number to use for one-time passcodes. The phone number should be in E.164 format. The phone number should be in E.164 format (i.e. +1XXXXXXXXXX). You may use +10000000000 to test this endpoint, see [Testing](https://stytch.com/docs/home#resources_testing) for more detail.
33
+ # The type of this field is nilable +String+.
34
+ # create_user_as_pending::
35
+ # Flag for whether or not to save a user as pending vs active in Stytch. Defaults to false.
36
+ # If true, users will be saved with status pending in Stytch's backend until authenticated.
37
+ # If false, users will be created as active. An example usage of
38
+ # a true flag would be to require users to verify their phone by entering the OTP code before creating
39
+ # an account for them.
40
+ # The type of this field is nilable +Boolean+.
41
+ # trusted_metadata::
42
+ # The `trusted_metadata` field contains an arbitrary JSON object of application-specific data. See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details.
43
+ # The type of this field is nilable +object+.
44
+ # untrusted_metadata::
45
+ # The `untrusted_metadata` field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and **cannot be used to store critical information.** See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details.
46
+ # The type of this field is nilable +object+.
47
+ #
48
+ # == Returns:
49
+ # An object with the following fields:
50
+ # request_id::
51
+ # Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
52
+ # The type of this field is +String+.
53
+ # user_id::
54
+ # The unique ID of the affected User.
55
+ # The type of this field is +String+.
56
+ # email_id::
57
+ # The unique ID of a specific email address.
58
+ # The type of this field is +String+.
59
+ # status::
60
+ # The status of the User. The possible values are `pending` and `active`.
61
+ # The type of this field is +String+.
62
+ # phone_id::
63
+ # The unique ID for the phone number.
64
+ # The type of this field is +String+.
65
+ # user::
66
+ # The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details.
67
+ # The type of this field is +User+ (+object+).
68
+ # status_code::
69
+ # The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
70
+ # The type of this field is +Integer+.
71
+ def create(
72
+ email: nil,
73
+ name: nil,
74
+ attributes: nil,
75
+ phone_number: nil,
76
+ create_user_as_pending: nil,
77
+ trusted_metadata: nil,
78
+ untrusted_metadata: nil
79
+ )
80
+ request = {}
81
+ request[:email] = email unless email.nil?
82
+ request[:name] = name unless name.nil?
83
+ request[:attributes] = attributes unless attributes.nil?
84
+ request[:phone_number] = phone_number unless phone_number.nil?
85
+ request[:create_user_as_pending] = create_user_as_pending unless create_user_as_pending.nil?
86
+ request[:trusted_metadata] = trusted_metadata unless trusted_metadata.nil?
87
+ request[:untrusted_metadata] = untrusted_metadata unless untrusted_metadata.nil?
38
88
 
39
- def get(user_id:)
40
- get_request("#{PATH}/#{user_id}")
89
+ post_request('/v1/users', request)
41
90
  end
42
91
 
43
- def get_pending(
44
- limit: nil,
45
- starting_after_id: nil
92
+ # Get information about a specific User.
93
+ #
94
+ # == Parameters:
95
+ # user_id::
96
+ # The unique ID of a specific User.
97
+ # The type of this field is +String+.
98
+ #
99
+ # == Returns:
100
+ # An object with the following fields:
101
+ # request_id::
102
+ # Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
103
+ # The type of this field is +String+.
104
+ # user_id::
105
+ # The unique ID of the returned User.
106
+ # The type of this field is +String+.
107
+ # emails::
108
+ # An array of email objects for the User.
109
+ # The type of this field is list of +Email+ (+object+).
110
+ # status::
111
+ # The status of the User. The possible values are `pending` and `active`.
112
+ # The type of this field is +String+.
113
+ # phone_numbers::
114
+ # An array of phone number objects linked to the User.
115
+ # The type of this field is list of +PhoneNumber+ (+object+).
116
+ # webauthn_registrations::
117
+ # An array that contains a list of all WebAuthn registrations for a given User in the Stytch API.
118
+ # The type of this field is list of +WebAuthnRegistration+ (+object+).
119
+ # providers::
120
+ # An array of OAuth `provider` objects linked to the User.
121
+ # The type of this field is list of +OAuthProvider+ (+object+).
122
+ # totps::
123
+ # An array containing a list of all TOTP instances for a given User in the Stytch API.
124
+ # The type of this field is list of +TOTP+ (+object+).
125
+ # crypto_wallets::
126
+ # An array contains a list of all crypto wallets for a given User in the Stytch API.
127
+ # The type of this field is list of +CryptoWallet+ (+object+).
128
+ # biometric_registrations::
129
+ # An array that contains a list of all biometric registrations for a given User in the Stytch API.
130
+ # The type of this field is list of +BiometricRegistration+ (+object+).
131
+ # status_code::
132
+ # The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
133
+ # The type of this field is +Integer+.
134
+ # name::
135
+ # The name of the User. Each field in the `name` object is optional.
136
+ # The type of this field is nilable +Name+ (+object+).
137
+ # created_at::
138
+ # The timestamp of the User's creation. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`.
139
+ # The type of this field is nilable +String+.
140
+ # password::
141
+ # The password object is returned for users with a password.
142
+ # The type of this field is nilable +Password+ (+object+).
143
+ # trusted_metadata::
144
+ # The `trusted_metadata` field contains an arbitrary JSON object of application-specific data. See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details.
145
+ # The type of this field is nilable +object+.
146
+ # untrusted_metadata::
147
+ # The `untrusted_metadata` field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and **cannot be used to store critical information.** See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details.
148
+ # The type of this field is nilable +object+.
149
+ def get(
150
+ user_id:
46
151
  )
47
- query_params = {
48
- limit: limit,
49
- starting_after_id: starting_after_id
50
- }
51
-
52
- request = request_with_query_params("#{PATH}/pending", query_params)
53
-
152
+ query_params = {}
153
+ request = request_with_query_params("/v1/users/#{user_id}", query_params)
54
154
  get_request(request)
55
155
  end
56
156
 
57
- def create(
58
- email: nil,
59
- phone_number: nil,
60
- name: {},
61
- create_user_as_pending: false,
62
- attributes: {},
63
- trusted_metadata: {},
64
- untrusted_metadata: {}
157
+ # Search for Users within your Stytch Project. Submit an empty `query` in the request to return all Users.
158
+ #
159
+ # == Parameters:
160
+ # cursor::
161
+ # The `cursor` field allows you to paginate through your results. Each result array is limited to 1000 results. If your query returns more than 1000 results, you will need to paginate the responses using the `cursor`. If you receive a response that includes a non-null `next_cursor` in the `results_metadata` object, repeat the search call with the `next_cursor` value set to the `cursor` field to retrieve the next page of results. Continue to make search calls until the `next_cursor` in the response is null.
162
+ # The type of this field is nilable +String+.
163
+ # limit::
164
+ # The number of search results to return per page. The default limit is 100. A maximum of 1000 results can be returned by a single search request. If the total size of your result set is greater than one page size, you must paginate the response. See the `cursor` field.
165
+ # The type of this field is nilable +Integer+.
166
+ # query::
167
+ # The optional query object contains the operator, i.e. `AND` or `OR`, and the operands that will filter your results. Only an operator is required. If you include no operands, no filtering will be applied. If you include no query object, it will return all results with no filtering applied.
168
+ # The type of this field is nilable +SearchUsersQuery+ (+object+).
169
+ #
170
+ # == Returns:
171
+ # An object with the following fields:
172
+ # request_id::
173
+ # Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
174
+ # The type of this field is +String+.
175
+ # results::
176
+ # An array of results that match your search query.
177
+ # The type of this field is list of +User+ (+object+).
178
+ # results_metadata::
179
+ # The search `results_metadata` object contains metadata relevant to your specific query like total and `next_cursor`.
180
+ # The type of this field is +ResultsMetadata+ (+object+).
181
+ # status_code::
182
+ # The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
183
+ # The type of this field is +Integer+.
184
+ def search(
185
+ cursor: nil,
186
+ limit: nil,
187
+ query: nil
65
188
  )
66
- request = {
67
- email: email,
68
- phone_number: phone_number,
69
- create_user_as_pending: create_user_as_pending
70
- }
71
-
72
- request[:name] = name if name != {}
73
- request[:attributes] = attributes if attributes != {}
74
- request[:trusted_metadata] = trusted_metadata if trusted_metadata != {}
75
- request[:untrusted_metadata] = untrusted_metadata if untrusted_metadata != {}
76
-
77
- post_request(PATH, request)
189
+ request = {}
190
+ request[:cursor] = cursor unless cursor.nil?
191
+ request[:limit] = limit unless limit.nil?
192
+ request[:query] = query unless query.nil?
193
+
194
+ post_request('/v1/users/search', request)
78
195
  end
79
196
 
197
+ # Update a User's attributes.
198
+ #
199
+ # **Note:** In order to add a new email address or phone number to an existing User object, pass the new email address or phone number into the respective `/send` endpoint for the authentication method of your choice. If you specify the existing User's `user_id` while calling the `/send` endpoint, the new email address or phone number will be added to the existing User object upon successful authentication. We require this process to guard against an account takeover vulnerability.
200
+ #
201
+ # == Parameters:
202
+ # user_id::
203
+ # The unique ID of a specific User.
204
+ # The type of this field is +String+.
205
+ # name::
206
+ # The name of the user. Each field in the name object is optional.
207
+ # The type of this field is nilable +Name+ (+object+).
208
+ # attributes::
209
+ # Provided attributes help with fraud detection.
210
+ # The type of this field is nilable +Attributes+ (+object+).
211
+ # trusted_metadata::
212
+ # The `trusted_metadata` field contains an arbitrary JSON object of application-specific data. See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details.
213
+ # The type of this field is nilable +object+.
214
+ # untrusted_metadata::
215
+ # The `untrusted_metadata` field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and **cannot be used to store critical information.** See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details.
216
+ # The type of this field is nilable +object+.
217
+ #
218
+ # == Returns:
219
+ # An object with the following fields:
220
+ # request_id::
221
+ # Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
222
+ # The type of this field is +String+.
223
+ # user_id::
224
+ # The unique ID of the updated User.
225
+ # The type of this field is +String+.
226
+ # emails::
227
+ # An array of email objects for the User.
228
+ # The type of this field is list of +Email+ (+object+).
229
+ # phone_numbers::
230
+ # An array of phone number objects linked to the User.
231
+ # The type of this field is list of +PhoneNumber+ (+object+).
232
+ # crypto_wallets::
233
+ # An array contains a list of all crypto wallets for a given User in the Stytch API.
234
+ # The type of this field is list of +CryptoWallet+ (+object+).
235
+ # user::
236
+ # The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details.
237
+ # The type of this field is +User+ (+object+).
238
+ # status_code::
239
+ # The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
240
+ # The type of this field is +Integer+.
80
241
  def update(
81
242
  user_id:,
82
- name: {},
83
- emails: [],
84
- phone_numbers: [],
85
- crypto_wallets: [],
86
- attributes: {},
87
- trusted_metadata: {},
88
- untrusted_metadata: {}
243
+ name: nil,
244
+ attributes: nil,
245
+ trusted_metadata: nil,
246
+ untrusted_metadata: nil
89
247
  )
90
- request = {
91
- emails: format_emails(emails),
92
- phone_numbers: format_phone_numbers(phone_numbers),
93
- crypto_wallets: crypto_wallets
94
- }
95
-
96
- request[:name] = name if name != {}
97
- request[:attributes] = attributes if attributes != {}
98
- request[:trusted_metadata] = trusted_metadata if trusted_metadata != {}
99
- request[:untrusted_metadata] = untrusted_metadata if untrusted_metadata != {}
100
-
101
- put_request("#{PATH}/#{user_id}", request)
248
+ request = {}
249
+ request[:name] = name unless name.nil?
250
+ request[:attributes] = attributes unless attributes.nil?
251
+ request[:trusted_metadata] = trusted_metadata unless trusted_metadata.nil?
252
+ request[:untrusted_metadata] = untrusted_metadata unless untrusted_metadata.nil?
253
+
254
+ put_request("/v1/users/#{user_id}", request)
102
255
  end
103
256
 
104
- def delete(user_id:)
105
- delete_request("#{PATH}/#{user_id}")
257
+ # Delete a User from Stytch.
258
+ #
259
+ # == Parameters:
260
+ # user_id::
261
+ # The unique ID of a specific User.
262
+ # The type of this field is +String+.
263
+ #
264
+ # == Returns:
265
+ # An object with the following fields:
266
+ # request_id::
267
+ # Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
268
+ # The type of this field is +String+.
269
+ # user_id::
270
+ # The unique ID of the deleted User.
271
+ # The type of this field is +String+.
272
+ # status_code::
273
+ # The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
274
+ # The type of this field is +Integer+.
275
+ def delete(
276
+ user_id:
277
+ )
278
+ delete_request("/v1/users/#{user_id}")
106
279
  end
107
280
 
281
+ # Delete an email from a User.
282
+ #
283
+ # == Parameters:
284
+ # email_id::
285
+ # The `email_id` to be deleted.
286
+ # The type of this field is +String+.
287
+ #
288
+ # == Returns:
289
+ # An object with the following fields:
290
+ # request_id::
291
+ # Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
292
+ # The type of this field is +String+.
293
+ # user_id::
294
+ # The unique ID of the affected User.
295
+ # The type of this field is +String+.
296
+ # user::
297
+ # The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details.
298
+ # The type of this field is +User+ (+object+).
299
+ # status_code::
300
+ # The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
301
+ # The type of this field is +Integer+.
108
302
  def delete_email(
109
303
  email_id:
110
304
  )
111
- delete_request("#{PATH}/emails/#{email_id}")
305
+ delete_request("/v1/users/emails/#{email_id}")
112
306
  end
113
307
 
308
+ # Delete a phone number from a User.
309
+ #
310
+ # == Parameters:
311
+ # phone_id::
312
+ # The `phone_id` to be deleted.
313
+ # The type of this field is +String+.
314
+ #
315
+ # == Returns:
316
+ # An object with the following fields:
317
+ # request_id::
318
+ # Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
319
+ # The type of this field is +String+.
320
+ # user_id::
321
+ # The unique ID of the affected User.
322
+ # The type of this field is +String+.
323
+ # user::
324
+ # The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details.
325
+ # The type of this field is +User+ (+object+).
326
+ # status_code::
327
+ # The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
328
+ # The type of this field is +Integer+.
114
329
  def delete_phone_number(
115
330
  phone_id:
116
331
  )
117
- delete_request("#{PATH}/phone_numbers/#{phone_id}")
332
+ delete_request("/v1/users/phone_numbers/#{phone_id}")
118
333
  end
119
334
 
335
+ # Delete a WebAuthn registration from a User.
336
+ #
337
+ # == Parameters:
338
+ # webauthn_registration_id::
339
+ # The `webauthn_registration_id` to be deleted.
340
+ # The type of this field is +String+.
341
+ #
342
+ # == Returns:
343
+ # An object with the following fields:
344
+ # request_id::
345
+ # Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
346
+ # The type of this field is +String+.
347
+ # user_id::
348
+ # The unique ID of the affected User.
349
+ # The type of this field is +String+.
350
+ # user::
351
+ # The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details.
352
+ # The type of this field is +User+ (+object+).
353
+ # status_code::
354
+ # The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
355
+ # The type of this field is +Integer+.
120
356
  def delete_webauthn_registration(
121
357
  webauthn_registration_id:
122
358
  )
123
- delete_request("#{PATH}/webauthn_registrations/#{webauthn_registration_id}")
359
+ delete_request("/v1/users/webauthn_registrations/#{webauthn_registration_id}")
124
360
  end
125
361
 
362
+ # Delete a biometric registration from a User.
363
+ #
364
+ # == Parameters:
365
+ # biometric_registration_id::
366
+ # The `biometric_registration_id` to be deleted.
367
+ # The type of this field is +String+.
368
+ #
369
+ # == Returns:
370
+ # An object with the following fields:
371
+ # request_id::
372
+ # Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
373
+ # The type of this field is +String+.
374
+ # user_id::
375
+ # The unique ID of the affected User.
376
+ # The type of this field is +String+.
377
+ # user::
378
+ # The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details.
379
+ # The type of this field is +User+ (+object+).
380
+ # status_code::
381
+ # The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
382
+ # The type of this field is +Integer+.
383
+ def delete_biometric_registration(
384
+ biometric_registration_id:
385
+ )
386
+ delete_request("/v1/users/biometric_registrations/#{biometric_registration_id}")
387
+ end
388
+
389
+ # Delete a TOTP from a User.
390
+ #
391
+ # == Parameters:
392
+ # totp_id::
393
+ # The `totp_id` to be deleted.
394
+ # The type of this field is +String+.
395
+ #
396
+ # == Returns:
397
+ # An object with the following fields:
398
+ # request_id::
399
+ # Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
400
+ # The type of this field is +String+.
401
+ # user_id::
402
+ # The unique ID of the affected User.
403
+ # The type of this field is +String+.
404
+ # user::
405
+ # The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details.
406
+ # The type of this field is +User+ (+object+).
407
+ # status_code::
408
+ # The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
409
+ # The type of this field is +Integer+.
126
410
  def delete_totp(
127
411
  totp_id:
128
412
  )
129
- delete_request("#{PATH}/totps/#{totp_id}")
413
+ delete_request("/v1/users/totps/#{totp_id}")
130
414
  end
131
415
 
416
+ # Delete a crypto wallet from a User.
417
+ #
418
+ # == Parameters:
419
+ # crypto_wallet_id::
420
+ # The `crypto_wallet_id` to be deleted.
421
+ # The type of this field is +String+.
422
+ #
423
+ # == Returns:
424
+ # An object with the following fields:
425
+ # request_id::
426
+ # Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
427
+ # The type of this field is +String+.
428
+ # user_id::
429
+ # The unique ID of the affected User.
430
+ # The type of this field is +String+.
431
+ # user::
432
+ # The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details.
433
+ # The type of this field is +User+ (+object+).
434
+ # status_code::
435
+ # The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
436
+ # The type of this field is +Integer+.
132
437
  def delete_crypto_wallet(
133
438
  crypto_wallet_id:
134
439
  )
135
- delete_request("#{PATH}/crypto_wallets/#{crypto_wallet_id}")
440
+ delete_request("/v1/users/crypto_wallets/#{crypto_wallet_id}")
136
441
  end
137
442
 
443
+ # Delete a password from a User.
444
+ #
445
+ # == Parameters:
446
+ # password_id::
447
+ # The `password_id` to be deleted.
448
+ # The type of this field is +String+.
449
+ #
450
+ # == Returns:
451
+ # An object with the following fields:
452
+ # request_id::
453
+ # Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
454
+ # The type of this field is +String+.
455
+ # user_id::
456
+ # The unique ID of the affected User.
457
+ # The type of this field is +String+.
458
+ # user::
459
+ # The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details.
460
+ # The type of this field is +User+ (+object+).
461
+ # status_code::
462
+ # The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
463
+ # The type of this field is +Integer+.
138
464
  def delete_password(
139
465
  password_id:
140
466
  )
141
- delete_request("#{PATH}/passwords/#{password_id}")
467
+ delete_request("/v1/users/passwords/#{password_id}")
142
468
  end
143
469
 
144
- def delete_biometric_registration(
145
- biometric_registration_id:
146
- )
147
- delete_request("#{PATH}/biometric_registrations/#{biometric_registration_id}")
148
- end
149
-
150
- def delete_oauth_user_registration(
470
+ # Delete an OAuth registration from a User.
471
+ #
472
+ # == Parameters:
473
+ # oauth_user_registration_id::
474
+ # The `oauth_user_registration_id` to be deleted.
475
+ # The type of this field is +String+.
476
+ #
477
+ # == Returns:
478
+ # An object with the following fields:
479
+ # request_id::
480
+ # Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
481
+ # The type of this field is +String+.
482
+ # user_id::
483
+ # The unique ID of the affected User.
484
+ # The type of this field is +String+.
485
+ # user::
486
+ # The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details.
487
+ # The type of this field is +User+ (+object+).
488
+ # status_code::
489
+ # The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
490
+ # The type of this field is +Integer+.
491
+ def delete_oauth_registration(
151
492
  oauth_user_registration_id:
152
493
  )
153
- delete_request("#{PATH}/oauth/#{oauth_user_registration_id}")
154
- end
155
-
156
- private
157
-
158
- def format_emails(emails)
159
- e = []
160
- emails.each { |email| e << { email: email } }
161
- e
162
- end
163
-
164
- def format_phone_numbers(phone_numbers)
165
- p = []
166
- phone_numbers.each { |phone_number| p << { phone_number: phone_number } }
167
- p
494
+ delete_request("/v1/users/oauth/#{oauth_user_registration_id}")
168
495
  end
169
496
  end
170
497
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stytch
4
- VERSION = '5.0.2'
4
+ VERSION = '6.0.0'
5
5
  end