stytch 5.0.2 → 6.1.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,501 @@
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)
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
+ )
16
80
  request = {
17
- query: query,
18
- limit: limit
19
81
  }
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
82
+ request[:email] = email unless email.nil?
83
+ request[:name] = name unless name.nil?
84
+ request[:attributes] = attributes unless attributes.nil?
85
+ request[:phone_number] = phone_number unless phone_number.nil?
86
+ request[:create_user_as_pending] = create_user_as_pending unless create_user_as_pending.nil?
87
+ request[:trusted_metadata] = trusted_metadata unless trusted_metadata.nil?
88
+ request[:untrusted_metadata] = untrusted_metadata unless untrusted_metadata.nil?
38
89
 
39
- def get(user_id:)
40
- get_request("#{PATH}/#{user_id}")
90
+ post_request('/v1/users', request)
41
91
  end
42
92
 
43
- def get_pending(
44
- limit: nil,
45
- starting_after_id: nil
93
+ # Get information about a specific User.
94
+ #
95
+ # == Parameters:
96
+ # user_id::
97
+ # The unique ID of a specific User.
98
+ # The type of this field is +String+.
99
+ #
100
+ # == Returns:
101
+ # An object with the following fields:
102
+ # request_id::
103
+ # 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.
104
+ # The type of this field is +String+.
105
+ # user_id::
106
+ # The unique ID of the returned User.
107
+ # The type of this field is +String+.
108
+ # emails::
109
+ # An array of email objects for the User.
110
+ # The type of this field is list of +Email+ (+object+).
111
+ # status::
112
+ # The status of the User. The possible values are `pending` and `active`.
113
+ # The type of this field is +String+.
114
+ # phone_numbers::
115
+ # An array of phone number objects linked to the User.
116
+ # The type of this field is list of +PhoneNumber+ (+object+).
117
+ # webauthn_registrations::
118
+ # An array that contains a list of all WebAuthn registrations for a given User in the Stytch API.
119
+ # The type of this field is list of +WebAuthnRegistration+ (+object+).
120
+ # providers::
121
+ # An array of OAuth `provider` objects linked to the User.
122
+ # The type of this field is list of +OAuthProvider+ (+object+).
123
+ # totps::
124
+ # An array containing a list of all TOTP instances for a given User in the Stytch API.
125
+ # The type of this field is list of +TOTP+ (+object+).
126
+ # crypto_wallets::
127
+ # An array contains a list of all crypto wallets for a given User in the Stytch API.
128
+ # The type of this field is list of +CryptoWallet+ (+object+).
129
+ # biometric_registrations::
130
+ # An array that contains a list of all biometric registrations for a given User in the Stytch API.
131
+ # The type of this field is list of +BiometricRegistration+ (+object+).
132
+ # status_code::
133
+ # 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.
134
+ # The type of this field is +Integer+.
135
+ # name::
136
+ # The name of the User. Each field in the `name` object is optional.
137
+ # The type of this field is nilable +Name+ (+object+).
138
+ # created_at::
139
+ # 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`.
140
+ # The type of this field is nilable +String+.
141
+ # password::
142
+ # The password object is returned for users with a password.
143
+ # The type of this field is nilable +Password+ (+object+).
144
+ # trusted_metadata::
145
+ # 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.
146
+ # The type of this field is nilable +object+.
147
+ # untrusted_metadata::
148
+ # 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.
149
+ # The type of this field is nilable +object+.
150
+ def get(
151
+ user_id:
46
152
  )
47
153
  query_params = {
48
- limit: limit,
49
- starting_after_id: starting_after_id
50
154
  }
51
-
52
- request = request_with_query_params("#{PATH}/pending", query_params)
53
-
155
+ request = request_with_query_params("/v1/users/#{user_id}", query_params)
54
156
  get_request(request)
55
157
  end
56
158
 
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: {}
159
+ # Search for Users within your Stytch Project. Submit an empty `query` in the request to return all Users.
160
+ #
161
+ # == Parameters:
162
+ # cursor::
163
+ # 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.
164
+ # The type of this field is nilable +String+.
165
+ # limit::
166
+ # 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.
167
+ # The type of this field is nilable +Integer+.
168
+ # query::
169
+ # 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.
170
+ # The type of this field is nilable +SearchUsersQuery+ (+object+).
171
+ #
172
+ # == Returns:
173
+ # An object with the following fields:
174
+ # request_id::
175
+ # 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.
176
+ # The type of this field is +String+.
177
+ # results::
178
+ # An array of results that match your search query.
179
+ # The type of this field is list of +User+ (+object+).
180
+ # results_metadata::
181
+ # The search `results_metadata` object contains metadata relevant to your specific query like total and `next_cursor`.
182
+ # The type of this field is +ResultsMetadata+ (+object+).
183
+ # status_code::
184
+ # 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.
185
+ # The type of this field is +Integer+.
186
+ def search(
187
+ cursor: nil,
188
+ limit: nil,
189
+ query: nil
65
190
  )
66
191
  request = {
67
- email: email,
68
- phone_number: phone_number,
69
- create_user_as_pending: create_user_as_pending
70
192
  }
193
+ request[:cursor] = cursor unless cursor.nil?
194
+ request[:limit] = limit unless limit.nil?
195
+ request[:query] = query unless query.nil?
71
196
 
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)
197
+ post_request('/v1/users/search', request)
78
198
  end
79
199
 
200
+ # Update a User's attributes.
201
+ #
202
+ # **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.
203
+ #
204
+ # == Parameters:
205
+ # user_id::
206
+ # The unique ID of a specific User.
207
+ # The type of this field is +String+.
208
+ # name::
209
+ # The name of the user. Each field in the name object is optional.
210
+ # The type of this field is nilable +Name+ (+object+).
211
+ # attributes::
212
+ # Provided attributes help with fraud detection.
213
+ # The type of this field is nilable +Attributes+ (+object+).
214
+ # trusted_metadata::
215
+ # 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.
216
+ # The type of this field is nilable +object+.
217
+ # untrusted_metadata::
218
+ # 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.
219
+ # The type of this field is nilable +object+.
220
+ #
221
+ # == Returns:
222
+ # An object with the following fields:
223
+ # request_id::
224
+ # 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.
225
+ # The type of this field is +String+.
226
+ # user_id::
227
+ # The unique ID of the updated User.
228
+ # The type of this field is +String+.
229
+ # emails::
230
+ # An array of email objects for the User.
231
+ # The type of this field is list of +Email+ (+object+).
232
+ # phone_numbers::
233
+ # An array of phone number objects linked to the User.
234
+ # The type of this field is list of +PhoneNumber+ (+object+).
235
+ # crypto_wallets::
236
+ # An array contains a list of all crypto wallets for a given User in the Stytch API.
237
+ # The type of this field is list of +CryptoWallet+ (+object+).
238
+ # user::
239
+ # 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.
240
+ # The type of this field is +User+ (+object+).
241
+ # status_code::
242
+ # 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.
243
+ # The type of this field is +Integer+.
80
244
  def update(
81
245
  user_id:,
82
- name: {},
83
- emails: [],
84
- phone_numbers: [],
85
- crypto_wallets: [],
86
- attributes: {},
87
- trusted_metadata: {},
88
- untrusted_metadata: {}
246
+ name: nil,
247
+ attributes: nil,
248
+ trusted_metadata: nil,
249
+ untrusted_metadata: nil
89
250
  )
90
251
  request = {
91
- emails: format_emails(emails),
92
- phone_numbers: format_phone_numbers(phone_numbers),
93
- crypto_wallets: crypto_wallets
94
252
  }
253
+ request[:name] = name unless name.nil?
254
+ request[:attributes] = attributes unless attributes.nil?
255
+ request[:trusted_metadata] = trusted_metadata unless trusted_metadata.nil?
256
+ request[:untrusted_metadata] = untrusted_metadata unless untrusted_metadata.nil?
95
257
 
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)
258
+ put_request("/v1/users/#{user_id}", request)
102
259
  end
103
260
 
104
- def delete(user_id:)
105
- delete_request("#{PATH}/#{user_id}")
261
+ # Delete a User from Stytch.
262
+ #
263
+ # == Parameters:
264
+ # user_id::
265
+ # The unique ID of a specific User.
266
+ # The type of this field is +String+.
267
+ #
268
+ # == Returns:
269
+ # An object with the following fields:
270
+ # request_id::
271
+ # 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.
272
+ # The type of this field is +String+.
273
+ # user_id::
274
+ # The unique ID of the deleted User.
275
+ # The type of this field is +String+.
276
+ # status_code::
277
+ # 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.
278
+ # The type of this field is +Integer+.
279
+ def delete(
280
+ user_id:
281
+ )
282
+ delete_request("/v1/users/#{user_id}")
106
283
  end
107
284
 
285
+ # Delete an email from a User.
286
+ #
287
+ # == Parameters:
288
+ # email_id::
289
+ # The `email_id` to be deleted.
290
+ # The type of this field is +String+.
291
+ #
292
+ # == Returns:
293
+ # An object with the following fields:
294
+ # request_id::
295
+ # 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.
296
+ # The type of this field is +String+.
297
+ # user_id::
298
+ # The unique ID of the affected User.
299
+ # The type of this field is +String+.
300
+ # user::
301
+ # 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.
302
+ # The type of this field is +User+ (+object+).
303
+ # status_code::
304
+ # 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.
305
+ # The type of this field is +Integer+.
108
306
  def delete_email(
109
307
  email_id:
110
308
  )
111
- delete_request("#{PATH}/emails/#{email_id}")
309
+ delete_request("/v1/users/emails/#{email_id}")
112
310
  end
113
311
 
312
+ # Delete a phone number from a User.
313
+ #
314
+ # == Parameters:
315
+ # phone_id::
316
+ # The `phone_id` to be deleted.
317
+ # The type of this field is +String+.
318
+ #
319
+ # == Returns:
320
+ # An object with the following fields:
321
+ # request_id::
322
+ # 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.
323
+ # The type of this field is +String+.
324
+ # user_id::
325
+ # The unique ID of the affected User.
326
+ # The type of this field is +String+.
327
+ # user::
328
+ # 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.
329
+ # The type of this field is +User+ (+object+).
330
+ # status_code::
331
+ # 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.
332
+ # The type of this field is +Integer+.
114
333
  def delete_phone_number(
115
334
  phone_id:
116
335
  )
117
- delete_request("#{PATH}/phone_numbers/#{phone_id}")
336
+ delete_request("/v1/users/phone_numbers/#{phone_id}")
118
337
  end
119
338
 
339
+ # Delete a WebAuthn registration from a User.
340
+ #
341
+ # == Parameters:
342
+ # webauthn_registration_id::
343
+ # The `webauthn_registration_id` to be deleted.
344
+ # The type of this field is +String+.
345
+ #
346
+ # == Returns:
347
+ # An object with the following fields:
348
+ # request_id::
349
+ # 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.
350
+ # The type of this field is +String+.
351
+ # user_id::
352
+ # The unique ID of the affected User.
353
+ # The type of this field is +String+.
354
+ # user::
355
+ # 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.
356
+ # The type of this field is +User+ (+object+).
357
+ # status_code::
358
+ # 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.
359
+ # The type of this field is +Integer+.
120
360
  def delete_webauthn_registration(
121
361
  webauthn_registration_id:
122
362
  )
123
- delete_request("#{PATH}/webauthn_registrations/#{webauthn_registration_id}")
363
+ delete_request("/v1/users/webauthn_registrations/#{webauthn_registration_id}")
124
364
  end
125
365
 
366
+ # Delete a biometric registration from a User.
367
+ #
368
+ # == Parameters:
369
+ # biometric_registration_id::
370
+ # The `biometric_registration_id` to be deleted.
371
+ # The type of this field is +String+.
372
+ #
373
+ # == Returns:
374
+ # An object with the following fields:
375
+ # request_id::
376
+ # 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.
377
+ # The type of this field is +String+.
378
+ # user_id::
379
+ # The unique ID of the affected User.
380
+ # The type of this field is +String+.
381
+ # user::
382
+ # 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.
383
+ # The type of this field is +User+ (+object+).
384
+ # status_code::
385
+ # 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.
386
+ # The type of this field is +Integer+.
387
+ def delete_biometric_registration(
388
+ biometric_registration_id:
389
+ )
390
+ delete_request("/v1/users/biometric_registrations/#{biometric_registration_id}")
391
+ end
392
+
393
+ # Delete a TOTP from a User.
394
+ #
395
+ # == Parameters:
396
+ # totp_id::
397
+ # The `totp_id` to be deleted.
398
+ # The type of this field is +String+.
399
+ #
400
+ # == Returns:
401
+ # An object with the following fields:
402
+ # request_id::
403
+ # 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.
404
+ # The type of this field is +String+.
405
+ # user_id::
406
+ # The unique ID of the affected User.
407
+ # The type of this field is +String+.
408
+ # user::
409
+ # 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.
410
+ # The type of this field is +User+ (+object+).
411
+ # status_code::
412
+ # 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.
413
+ # The type of this field is +Integer+.
126
414
  def delete_totp(
127
415
  totp_id:
128
416
  )
129
- delete_request("#{PATH}/totps/#{totp_id}")
417
+ delete_request("/v1/users/totps/#{totp_id}")
130
418
  end
131
419
 
420
+ # Delete a crypto wallet from a User.
421
+ #
422
+ # == Parameters:
423
+ # crypto_wallet_id::
424
+ # The `crypto_wallet_id` to be deleted.
425
+ # The type of this field is +String+.
426
+ #
427
+ # == Returns:
428
+ # An object with the following fields:
429
+ # request_id::
430
+ # 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.
431
+ # The type of this field is +String+.
432
+ # user_id::
433
+ # The unique ID of the affected User.
434
+ # The type of this field is +String+.
435
+ # user::
436
+ # 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.
437
+ # The type of this field is +User+ (+object+).
438
+ # status_code::
439
+ # 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.
440
+ # The type of this field is +Integer+.
132
441
  def delete_crypto_wallet(
133
442
  crypto_wallet_id:
134
443
  )
135
- delete_request("#{PATH}/crypto_wallets/#{crypto_wallet_id}")
444
+ delete_request("/v1/users/crypto_wallets/#{crypto_wallet_id}")
136
445
  end
137
446
 
447
+ # Delete a password from a User.
448
+ #
449
+ # == Parameters:
450
+ # password_id::
451
+ # The `password_id` to be deleted.
452
+ # The type of this field is +String+.
453
+ #
454
+ # == Returns:
455
+ # An object with the following fields:
456
+ # request_id::
457
+ # 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.
458
+ # The type of this field is +String+.
459
+ # user_id::
460
+ # The unique ID of the affected User.
461
+ # The type of this field is +String+.
462
+ # user::
463
+ # 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.
464
+ # The type of this field is +User+ (+object+).
465
+ # status_code::
466
+ # 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.
467
+ # The type of this field is +Integer+.
138
468
  def delete_password(
139
469
  password_id:
140
470
  )
141
- delete_request("#{PATH}/passwords/#{password_id}")
471
+ delete_request("/v1/users/passwords/#{password_id}")
142
472
  end
143
473
 
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(
474
+ # Delete an OAuth registration from a User.
475
+ #
476
+ # == Parameters:
477
+ # oauth_user_registration_id::
478
+ # The `oauth_user_registration_id` to be deleted.
479
+ # The type of this field is +String+.
480
+ #
481
+ # == Returns:
482
+ # An object with the following fields:
483
+ # request_id::
484
+ # 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.
485
+ # The type of this field is +String+.
486
+ # user_id::
487
+ # The unique ID of the affected User.
488
+ # The type of this field is +String+.
489
+ # user::
490
+ # 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.
491
+ # The type of this field is +User+ (+object+).
492
+ # status_code::
493
+ # 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.
494
+ # The type of this field is +Integer+.
495
+ def delete_oauth_registration(
151
496
  oauth_user_registration_id:
152
497
  )
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
498
+ delete_request("/v1/users/oauth/#{oauth_user_registration_id}")
168
499
  end
169
500
  end
170
501
  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.1.0'
5
5
  end