stytch 5.0.2 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,11 @@
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 StytchB2B
@@ -13,9 +19,88 @@ module StytchB2B
13
19
  @members = StytchB2B::Organizations::Members.new(@connection)
14
20
  end
15
21
 
22
+ # Creates an Organization. An `organization_name` and a unique `organization_slug` are required.
23
+ #
24
+ # By default, `email_invites` and `sso_jit_provisioning` will be set to `ALL_ALLOWED` if no Organization authentication settings are explicitly defined in the request.
25
+ #
26
+ # *See the [Organization authentication settings](https://stytch.com/docs/b2b/api/org-auth-settings) resource to learn more about fields like `email_jit_provisioning`, `email_invites`, `sso_jit_provisioning`, etc., and their behaviors.
27
+ #
28
+ # == Parameters:
29
+ # organization_name::
30
+ # The name of the Organization.
31
+ # The type of this field is +String+.
32
+ # organization_slug::
33
+ # The unique URL slug of the Organization. A minimum of two characters is required. The slug only accepts alphanumeric characters and the following reserved characters: `-` `.` `_` `~`.
34
+ # The type of this field is nilable +String+.
35
+ # organization_logo_url::
36
+ # The image URL of the Organization logo.
37
+ # The type of this field is nilable +String+.
38
+ # trusted_metadata::
39
+ # An arbitrary JSON object for storing application-specific data or identity-provider-specific data.
40
+ # The type of this field is nilable +object+.
41
+ # sso_jit_provisioning::
42
+ # The authentication setting that controls the JIT provisioning of Members when authenticating via SSO. The accepted values are:
43
+ #
44
+ # `ALL_ALLOWED` – new Members will be automatically provisioned upon successful authentication via any of the Organization's `sso_active_connections`.
45
+ #
46
+ # `RESTRICTED` – only new Members with SSO logins that comply with `sso_jit_provisioning_allowed_connections` can be provisioned upon authentication.
47
+ #
48
+ # `NOT_ALLOWED` – disable JIT provisioning via SSO.
49
+ #
50
+ # The type of this field is nilable +String+.
51
+ # email_allowed_domains::
52
+ # An array of email domains that allow invites or JIT provisioning for new Members. This list is enforced when either `email_invites` or `email_jit_provisioning` is set to `RESTRICTED`.
53
+ #
54
+ #
55
+ # Common domains such as `gmail.com` are not allowed. See the [common email domains resource](https://stytch.com/docs/b2b/api/common-email-domains) for the full list.
56
+ # The type of this field is nilable list of +String+.
57
+ # email_jit_provisioning::
58
+ # The authentication setting that controls how a new Member can be provisioned by authenticating via Email Magic Link. The accepted values are:
59
+ #
60
+ # `RESTRICTED` – only new Members with verified emails that comply with `email_allowed_domains` can be provisioned upon authentication via Email Magic Link.
61
+ #
62
+ # `NOT_ALLOWED` – disable JIT provisioning via Email Magic Link.
63
+ #
64
+ # The type of this field is nilable +String+.
65
+ # email_invites::
66
+ # The authentication setting that controls how a new Member can be invited to an organization by email. The accepted values are:
67
+ #
68
+ # `ALL_ALLOWED` – any new Member can be invited to join via email.
69
+ #
70
+ # `RESTRICTED` – only new Members with verified emails that comply with `email_allowed_domains` can be invited via email.
71
+ #
72
+ # `NOT_ALLOWED` – disable email invites.
73
+ #
74
+ # The type of this field is nilable +String+.
75
+ # auth_methods::
76
+ # The setting that controls which authentication methods can be used by Members of an Organization. The accepted values are:
77
+ #
78
+ # `ALL_ALLOWED` – the default setting which allows all authentication methods to be used.
79
+ #
80
+ # `RESTRICTED` – only methods that comply with `allowed_auth_methods` can be used for authentication. This setting does not apply to Members with `is_breakglass` set to `true`.
81
+ #
82
+ # The type of this field is nilable +String+.
83
+ # allowed_auth_methods::
84
+ #
85
+ # An array of allowed authentication methods. This list is enforced when `auth_methods` is set to `RESTRICTED`.
86
+ # The list's accepted values are: `sso`, `magic_link`, `password`, `google_oauth`, and `microsoft_oauth`.
87
+ #
88
+ # The type of this field is nilable list of +String+.
89
+ #
90
+ # == Returns:
91
+ # An object with the following fields:
92
+ # request_id::
93
+ # 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.
94
+ # The type of this field is +String+.
95
+ # organization::
96
+ # The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
97
+ # The type of this field is +Organization+ (+object+).
98
+ # status_code::
99
+ # 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.
100
+ # The type of this field is +Integer+.
16
101
  def create(
17
102
  organization_name:,
18
- organization_slug:,
103
+ organization_slug: nil,
19
104
  organization_logo_url: nil,
20
105
  trusted_metadata: nil,
21
106
  sso_jit_provisioning: nil,
@@ -26,9 +111,9 @@ module StytchB2B
26
111
  allowed_auth_methods: nil
27
112
  )
28
113
  request = {
29
- organization_name: organization_name,
30
- organization_slug: organization_slug
114
+ organization_name: organization_name
31
115
  }
116
+ request[:organization_slug] = organization_slug unless organization_slug.nil?
32
117
  request[:organization_logo_url] = organization_logo_url unless organization_logo_url.nil?
33
118
  request[:trusted_metadata] = trusted_metadata unless trusted_metadata.nil?
34
119
  request[:sso_jit_provisioning] = sso_jit_provisioning unless sso_jit_provisioning.nil?
@@ -41,16 +126,119 @@ module StytchB2B
41
126
  post_request('/v1/b2b/organizations', request)
42
127
  end
43
128
 
129
+ # Returns an Organization specified by `organization_id`.
130
+ #
131
+ # == Parameters:
132
+ # organization_id::
133
+ # Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
134
+ # The type of this field is +String+.
135
+ #
136
+ # == Returns:
137
+ # An object with the following fields:
138
+ # request_id::
139
+ # 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.
140
+ # The type of this field is +String+.
141
+ # organization::
142
+ # The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
143
+ # The type of this field is +Organization+ (+object+).
144
+ # status_code::
145
+ # 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.
146
+ # The type of this field is +Integer+.
44
147
  def get(
45
148
  organization_id:
46
149
  )
47
- query_params = {
48
- organization_id: organization_id
49
- }
150
+ query_params = {}
50
151
  request = request_with_query_params("/v1/b2b/organizations/#{organization_id}", query_params)
51
152
  get_request(request)
52
153
  end
53
154
 
155
+ # Updates an Organization specified by `organization_id`. An Organization must always have at least one auth setting set to either `RESTRICTED` or `ALL_ALLOWED` in order to provision new Members. test
156
+ #
157
+ # *See the [Organization authentication settings](https://stytch.com/docs/b2b/api/org-auth-settings) resource to learn more about fields like `email_jit_provisioning`, `email_invites`, `sso_jit_provisioning`, etc., and their behaviors.
158
+ #
159
+ # == Parameters:
160
+ # organization_id::
161
+ # Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
162
+ # The type of this field is +String+.
163
+ # organization_name::
164
+ # The name of the Organization.
165
+ # The type of this field is nilable +String+.
166
+ # organization_slug::
167
+ # The unique URL slug of the Organization. A minimum of two characters is required. The slug only accepts alphanumeric characters and the following reserved characters: `-` `.` `_` `~`.
168
+ # The type of this field is nilable +String+.
169
+ # organization_logo_url::
170
+ # The image URL of the Organization logo.
171
+ # The type of this field is nilable +String+.
172
+ # trusted_metadata::
173
+ # An arbitrary JSON object for storing application-specific data or identity-provider-specific data.
174
+ # The type of this field is nilable +object+.
175
+ # sso_default_connection_id::
176
+ # The default connection used for SSO when there are multiple active connections.
177
+ # The type of this field is nilable +String+.
178
+ # sso_jit_provisioning::
179
+ # The authentication setting that controls the JIT provisioning of Members when authenticating via SSO. The accepted values are:
180
+ #
181
+ # `ALL_ALLOWED` – new Members will be automatically provisioned upon successful authentication via any of the Organization's `sso_active_connections`.
182
+ #
183
+ # `RESTRICTED` – only new Members with SSO logins that comply with `sso_jit_provisioning_allowed_connections` can be provisioned upon authentication.
184
+ #
185
+ # `NOT_ALLOWED` – disable JIT provisioning via SSO.
186
+ #
187
+ # The type of this field is nilable +String+.
188
+ # sso_jit_provisioning_allowed_connections::
189
+ # An array of `connection_id`s that reference [SAML Connection objects](https://stytch.com/docs/b2b/api/saml-connection-object).
190
+ # Only these connections will be allowed to JIT provision Members via SSO when `sso_jit_provisioning` is set to `RESTRICTED`.
191
+ # The type of this field is nilable list of +String+.
192
+ # email_allowed_domains::
193
+ # An array of email domains that allow invites or JIT provisioning for new Members. This list is enforced when either `email_invites` or `email_jit_provisioning` is set to `RESTRICTED`.
194
+ #
195
+ #
196
+ # Common domains such as `gmail.com` are not allowed. See the [common email domains resource](https://stytch.com/docs/b2b/api/common-email-domains) for the full list.
197
+ # The type of this field is nilable list of +String+.
198
+ # email_jit_provisioning::
199
+ # The authentication setting that controls how a new Member can be provisioned by authenticating via Email Magic Link. The accepted values are:
200
+ #
201
+ # `RESTRICTED` – only new Members with verified emails that comply with `email_allowed_domains` can be provisioned upon authentication via Email Magic Link.
202
+ #
203
+ # `NOT_ALLOWED` – disable JIT provisioning via Email Magic Link.
204
+ #
205
+ # The type of this field is nilable +String+.
206
+ # email_invites::
207
+ # The authentication setting that controls how a new Member can be invited to an organization by email. The accepted values are:
208
+ #
209
+ # `ALL_ALLOWED` – any new Member can be invited to join via email.
210
+ #
211
+ # `RESTRICTED` – only new Members with verified emails that comply with `email_allowed_domains` can be invited via email.
212
+ #
213
+ # `NOT_ALLOWED` – disable email invites.
214
+ #
215
+ # The type of this field is nilable +String+.
216
+ # auth_methods::
217
+ # The setting that controls which authentication methods can be used by Members of an Organization. The accepted values are:
218
+ #
219
+ # `ALL_ALLOWED` – the default setting which allows all authentication methods to be used.
220
+ #
221
+ # `RESTRICTED` – only methods that comply with `allowed_auth_methods` can be used for authentication. This setting does not apply to Members with `is_breakglass` set to `true`.
222
+ #
223
+ # The type of this field is nilable +String+.
224
+ # allowed_auth_methods::
225
+ #
226
+ # An array of allowed authentication methods. This list is enforced when `auth_methods` is set to `RESTRICTED`.
227
+ # The list's accepted values are: `sso`, `magic_link`, `password`, `google_oauth`, and `microsoft_oauth`.
228
+ #
229
+ # The type of this field is nilable list of +String+.
230
+ #
231
+ # == Returns:
232
+ # An object with the following fields:
233
+ # request_id::
234
+ # 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.
235
+ # The type of this field is +String+.
236
+ # organization::
237
+ # The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
238
+ # The type of this field is +Organization+ (+object+).
239
+ # status_code::
240
+ # 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.
241
+ # The type of this field is +Integer+.
54
242
  def update(
55
243
  organization_id:,
56
244
  organization_name: nil,
@@ -66,9 +254,7 @@ module StytchB2B
66
254
  auth_methods: nil,
67
255
  allowed_auth_methods: nil
68
256
  )
69
- request = {
70
- organization_id: organization_id
71
- }
257
+ request = {}
72
258
  request[:organization_name] = organization_name unless organization_name.nil?
73
259
  request[:organization_slug] = organization_slug unless organization_slug.nil?
74
260
  request[:organization_logo_url] = organization_logo_url unless organization_logo_url.nil?
@@ -88,12 +274,57 @@ module StytchB2B
88
274
  put_request("/v1/b2b/organizations/#{organization_id}", request)
89
275
  end
90
276
 
277
+ # Deletes an Organization specified by `organization_id`. All Members of the Organization will also be deleted.
278
+ #
279
+ # == Parameters:
280
+ # organization_id::
281
+ # Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
282
+ # The type of this field is +String+.
283
+ #
284
+ # == Returns:
285
+ # An object with the following fields:
286
+ # request_id::
287
+ # 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.
288
+ # The type of this field is +String+.
289
+ # organization_id::
290
+ # Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
291
+ # The type of this field is +String+.
292
+ # status_code::
293
+ # 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.
294
+ # The type of this field is +Integer+.
91
295
  def delete(
92
296
  organization_id:
93
297
  )
94
298
  delete_request("/v1/b2b/organizations/#{organization_id}")
95
299
  end
96
300
 
301
+ # Search for Organizations. If you send a request with no body params, no filtering will be applied and the endpoint will return all Organizations. All fuzzy search filters require a minimum of three characters.
302
+ #
303
+ # == Parameters:
304
+ # cursor::
305
+ # 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.
306
+ # The type of this field is nilable +String+.
307
+ # limit::
308
+ # 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.
309
+ # The type of this field is nilable +Integer+.
310
+ # query::
311
+ # 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 Organizations with no filtering applied.
312
+ # The type of this field is nilable +SearchQuery+ (+object+).
313
+ #
314
+ # == Returns:
315
+ # An object with the following fields:
316
+ # request_id::
317
+ # 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.
318
+ # The type of this field is +String+.
319
+ # organizations::
320
+ # An array of [Organization objects](https://stytch.com/docs/b2b/api/organization-object).
321
+ # The type of this field is list of +Organization+ (+object+).
322
+ # results_metadata::
323
+ # The search `results_metadata` object contains metadata relevant to your specific query like `total` and `next_cursor`.
324
+ # The type of this field is +ResultsMetadata+ (+object+).
325
+ # status_code::
326
+ # 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.
327
+ # The type of this field is +Integer+.
97
328
  def search(
98
329
  cursor: nil,
99
330
  limit: nil,
@@ -114,42 +345,47 @@ module StytchB2B
114
345
  @connection = connection
115
346
  end
116
347
 
117
- def create(
118
- organization_id:,
119
- email_address:,
120
- name: nil,
121
- trusted_metadata: nil,
122
- untrusted_metadata: nil,
123
- create_member_as_pending: nil,
124
- is_breakglass: nil
125
- )
126
- request = {
127
- organization_id: organization_id,
128
- email_address: email_address
129
- }
130
- request[:name] = name unless name.nil?
131
- request[:trusted_metadata] = trusted_metadata unless trusted_metadata.nil?
132
- request[:untrusted_metadata] = untrusted_metadata unless untrusted_metadata.nil?
133
- request[:create_member_as_pending] = create_member_as_pending unless create_member_as_pending.nil?
134
- request[:is_breakglass] = is_breakglass unless is_breakglass.nil?
135
-
136
- post_request("/v1/b2b/organizations/#{organization_id}/members", request)
137
- end
138
-
139
- def get(
140
- organization_id:,
141
- member_id: nil,
142
- email_address: nil
143
- )
144
- query_params = {
145
- organization_id: organization_id,
146
- member_id: member_id,
147
- email_address: email_address
148
- }
149
- request = request_with_query_params("/v1/b2b/organizations/#{organization_id}/member", query_params)
150
- get_request(request)
151
- end
152
-
348
+ # Updates a Member specified by `organization_id` and `member_id`.
349
+ #
350
+ # == Parameters:
351
+ # organization_id::
352
+ # Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
353
+ # The type of this field is +String+.
354
+ # member_id::
355
+ # Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value.
356
+ # The type of this field is +String+.
357
+ # name::
358
+ # The name of the Member.
359
+ # The type of this field is nilable +String+.
360
+ # trusted_metadata::
361
+ # An arbitrary JSON object for storing application-specific data or identity-provider-specific data.
362
+ # The type of this field is nilable +object+.
363
+ # untrusted_metadata::
364
+ # An arbitrary JSON object of application-specific data. These fields can be edited directly by the
365
+ # frontend SDK, and should not be used to store critical information. See the [Metadata resource](https://stytch.com/docs/b2b/api/metadata)
366
+ # for complete field behavior details.
367
+ # The type of this field is nilable +object+.
368
+ # is_breakglass::
369
+ # Identifies the Member as a break glass user - someone who has permissions to authenticate into an Organization by bypassing the Organization's settings. A break glass account is typically used for emergency purposes to gain access outside of normal authentication procedures. Refer to the [Organization object](organization-object) and its `auth_methods` and `allowed_auth_methods` fields for more details.
370
+ # The type of this field is nilable +Boolean+.
371
+ #
372
+ # == Returns:
373
+ # An object with the following fields:
374
+ # request_id::
375
+ # 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.
376
+ # The type of this field is +String+.
377
+ # member_id::
378
+ # Globally unique UUID that identifies a specific Member.
379
+ # The type of this field is +String+.
380
+ # member::
381
+ # The [Member object](https://stytch.com/docs/b2b/api/member-object).
382
+ # The type of this field is +Member+ (+object+).
383
+ # organization::
384
+ # The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
385
+ # The type of this field is +Organization+ (+object+).
386
+ # status_code::
387
+ # 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.
388
+ # The type of this field is +Integer+.
153
389
  def update(
154
390
  organization_id:,
155
391
  member_id:,
@@ -158,10 +394,7 @@ module StytchB2B
158
394
  untrusted_metadata: nil,
159
395
  is_breakglass: nil
160
396
  )
161
- request = {
162
- organization_id: organization_id,
163
- member_id: member_id
164
- }
397
+ request = {}
165
398
  request[:name] = name unless name.nil?
166
399
  request[:trusted_metadata] = trusted_metadata unless trusted_metadata.nil?
167
400
  request[:untrusted_metadata] = untrusted_metadata unless untrusted_metadata.nil?
@@ -170,6 +403,27 @@ module StytchB2B
170
403
  put_request("/v1/b2b/organizations/#{organization_id}/members/#{member_id}", request)
171
404
  end
172
405
 
406
+ # Deletes a Member specified by `organization_id` and `member_id`.
407
+ #
408
+ # == Parameters:
409
+ # organization_id::
410
+ # Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
411
+ # The type of this field is +String+.
412
+ # member_id::
413
+ # Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value.
414
+ # The type of this field is +String+.
415
+ #
416
+ # == Returns:
417
+ # An object with the following fields:
418
+ # request_id::
419
+ # 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.
420
+ # The type of this field is +String+.
421
+ # member_id::
422
+ # Globally unique UUID that identifies a specific Member.
423
+ # The type of this field is +String+.
424
+ # status_code::
425
+ # 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.
426
+ # The type of this field is +Integer+.
173
427
  def delete(
174
428
  organization_id:,
175
429
  member_id:
@@ -177,6 +431,41 @@ module StytchB2B
177
431
  delete_request("/v1/b2b/organizations/#{organization_id}/members/#{member_id}")
178
432
  end
179
433
 
434
+ # Search for Members within specified Organizations. An array with at least one `organization_id` is required. Submitting an empty `query` returns all Members within the specified Organizations.
435
+ #
436
+ # *All fuzzy search filters require a minimum of three characters.
437
+ #
438
+ # == Parameters:
439
+ # organization_ids::
440
+ # An array of organization_ids. At least one value is required.
441
+ # The type of this field is list of +String+.
442
+ # cursor::
443
+ # 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.
444
+ # The type of this field is nilable +String+.
445
+ # limit::
446
+ # 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.
447
+ # The type of this field is nilable +Integer+.
448
+ # query::
449
+ # 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 Organizations with no filtering applied.
450
+ # The type of this field is nilable +SearchQuery+ (+object+).
451
+ #
452
+ # == Returns:
453
+ # An object with the following fields:
454
+ # request_id::
455
+ # 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.
456
+ # The type of this field is +String+.
457
+ # members::
458
+ # An array of [Member objects](member-object).
459
+ # The type of this field is list of +Member+ (+object+).
460
+ # results_metadata::
461
+ # The search `results_metadata` object contains metadata relevant to your specific query like `total` and `next_cursor`.
462
+ # The type of this field is +ResultsMetadata+ (+object+).
463
+ # organizations::
464
+ # A map from `organization_id` to [Organization object](https://stytch.com/docs/b2b/api/organization-object). The map only contains the Organizations that the Members belongs to.
465
+ # The type of this field is map of +String+ to +Organization+ (+object+).
466
+ # status_code::
467
+ # 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.
468
+ # The type of this field is +Integer+.
180
469
  def search(
181
470
  organization_ids:,
182
471
  cursor: nil,
@@ -193,12 +482,147 @@ module StytchB2B
193
482
  post_request('/v1/b2b/organizations/members/search', request)
194
483
  end
195
484
 
196
- def organizations_delete_password(
485
+ # Delete a Member's password.
486
+ #
487
+ # == Parameters:
488
+ # organization_id::
489
+ # Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
490
+ # The type of this field is +String+.
491
+ # member_password_id::
492
+ # Globally unique UUID that identifies a Member's password.
493
+ # The type of this field is +String+.
494
+ #
495
+ # == Returns:
496
+ # An object with the following fields:
497
+ # request_id::
498
+ # 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.
499
+ # The type of this field is +String+.
500
+ # member_id::
501
+ # Globally unique UUID that identifies a specific Member.
502
+ # The type of this field is +String+.
503
+ # member::
504
+ # The [Member object](https://stytch.com/docs/b2b/api/member-object).
505
+ # The type of this field is +Member+ (+object+).
506
+ # organization::
507
+ # The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
508
+ # The type of this field is +Organization+ (+object+).
509
+ # status_code::
510
+ # 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.
511
+ # The type of this field is +Integer+.
512
+ def delete_password(
197
513
  organization_id:,
198
514
  member_password_id:
199
515
  )
200
516
  delete_request("/v1/b2b/organizations/#{organization_id}/members/passwords/#{member_password_id}")
201
517
  end
518
+
519
+ # Creates a Member. An `organization_id` and `email_address` are required.
520
+ #
521
+ # == Parameters:
522
+ # organization_id::
523
+ # Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
524
+ # The type of this field is +String+.
525
+ # email_address::
526
+ # The email address of the Member.
527
+ # The type of this field is +String+.
528
+ # name::
529
+ # The name of the Member.
530
+ # The type of this field is nilable +String+.
531
+ # trusted_metadata::
532
+ # An arbitrary JSON object for storing application-specific data or identity-provider-specific data.
533
+ # The type of this field is nilable +object+.
534
+ # untrusted_metadata::
535
+ # An arbitrary JSON object of application-specific data. These fields can be edited directly by the
536
+ # frontend SDK, and should not be used to store critical information. See the [Metadata resource](https://stytch.com/docs/b2b/api/metadata)
537
+ # for complete field behavior details.
538
+ # The type of this field is nilable +object+.
539
+ # create_member_as_pending::
540
+ # Flag for whether or not to save a Member as `pending` or `active` in Stytch. It defaults to false. If true, new Members will be created with status `pending` in Stytch's backend. Their status will remain `pending` and they will continue to receive signup email templates for every Email Magic Link until that Member authenticates and becomes `active`. If false, new Members will be created with status `active`.
541
+ # The type of this field is nilable +Boolean+.
542
+ # is_breakglass::
543
+ # Identifies the Member as a break glass user - someone who has permissions to authenticate into an Organization by bypassing the Organization's settings. A break glass account is typically used for emergency purposes to gain access outside of normal authentication procedures. Refer to the [Organization object](organization-object) and its `auth_methods` and `allowed_auth_methods` fields for more details.
544
+ # The type of this field is nilable +Boolean+.
545
+ #
546
+ # == Returns:
547
+ # An object with the following fields:
548
+ # request_id::
549
+ # 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.
550
+ # The type of this field is +String+.
551
+ # member_id::
552
+ # Globally unique UUID that identifies a specific Member.
553
+ # The type of this field is +String+.
554
+ # member::
555
+ # The [Member object](https://stytch.com/docs/b2b/api/member-object).
556
+ # The type of this field is +Member+ (+object+).
557
+ # organization::
558
+ # The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
559
+ # The type of this field is +Organization+ (+object+).
560
+ # status_code::
561
+ # 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.
562
+ # The type of this field is +Integer+.
563
+ def create(
564
+ organization_id:,
565
+ email_address:,
566
+ name: nil,
567
+ trusted_metadata: nil,
568
+ untrusted_metadata: nil,
569
+ create_member_as_pending: nil,
570
+ is_breakglass: nil
571
+ )
572
+ request = {
573
+ email_address: email_address
574
+ }
575
+ request[:name] = name unless name.nil?
576
+ request[:trusted_metadata] = trusted_metadata unless trusted_metadata.nil?
577
+ request[:untrusted_metadata] = untrusted_metadata unless untrusted_metadata.nil?
578
+ request[:create_member_as_pending] = create_member_as_pending unless create_member_as_pending.nil?
579
+ request[:is_breakglass] = is_breakglass unless is_breakglass.nil?
580
+
581
+ post_request("/v1/b2b/organizations/#{organization_id}/members", request)
582
+ end
583
+
584
+ # Get a Member by `member_id` or `email_address`.
585
+ #
586
+ # == Parameters:
587
+ # organization_id::
588
+ # Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
589
+ # The type of this field is +String+.
590
+ # member_id::
591
+ # Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value.
592
+ # The type of this field is nilable +String+.
593
+ # email_address::
594
+ # The email address of the Member.
595
+ # The type of this field is nilable +String+.
596
+ #
597
+ # == Returns:
598
+ # An object with the following fields:
599
+ # request_id::
600
+ # 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.
601
+ # The type of this field is +String+.
602
+ # member_id::
603
+ # Globally unique UUID that identifies a specific Member.
604
+ # The type of this field is +String+.
605
+ # member::
606
+ # The [Member object](https://stytch.com/docs/b2b/api/member-object).
607
+ # The type of this field is +Member+ (+object+).
608
+ # organization::
609
+ # The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
610
+ # The type of this field is +Organization+ (+object+).
611
+ # status_code::
612
+ # 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.
613
+ # The type of this field is +Integer+.
614
+ def get(
615
+ organization_id:,
616
+ member_id: nil,
617
+ email_address: nil
618
+ )
619
+ query_params = {
620
+ member_id: member_id,
621
+ email_address: email_address
622
+ }
623
+ request = request_with_query_params("/v1/b2b/organizations/#{organization_id}/member", query_params)
624
+ get_request(request)
625
+ end
202
626
  end
203
627
  end
204
628
  end