stytch 6.4.0 → 9.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,496 @@
1
+ # frozen_string_literal: true
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
+
9
+ require_relative 'request_helper'
10
+
11
+ module StytchB2B
12
+ class SCIM
13
+ include Stytch::RequestHelper
14
+ attr_reader :connection
15
+
16
+ def initialize(connection)
17
+ @connection = connection
18
+
19
+ @connection = StytchB2B::SCIM::Connection.new(@connection)
20
+ end
21
+
22
+ class Connection
23
+ class UpdateRequestOptions
24
+ # Optional authorization object.
25
+ # Pass in an active Stytch Member session token or session JWT and the request
26
+ # will be run using that member's permissions.
27
+ attr_accessor :authorization
28
+
29
+ def initialize(
30
+ authorization: nil
31
+ )
32
+ @authorization = authorization
33
+ end
34
+
35
+ def to_headers
36
+ headers = {}
37
+ headers.merge!(@authorization.to_headers) if authorization
38
+ headers
39
+ end
40
+ end
41
+
42
+ class DeleteRequestOptions
43
+ # Optional authorization object.
44
+ # Pass in an active Stytch Member session token or session JWT and the request
45
+ # will be run using that member's permissions.
46
+ attr_accessor :authorization
47
+
48
+ def initialize(
49
+ authorization: nil
50
+ )
51
+ @authorization = authorization
52
+ end
53
+
54
+ def to_headers
55
+ headers = {}
56
+ headers.merge!(@authorization.to_headers) if authorization
57
+ headers
58
+ end
59
+ end
60
+
61
+ class RotateStartRequestOptions
62
+ # Optional authorization object.
63
+ # Pass in an active Stytch Member session token or session JWT and the request
64
+ # will be run using that member's permissions.
65
+ attr_accessor :authorization
66
+
67
+ def initialize(
68
+ authorization: nil
69
+ )
70
+ @authorization = authorization
71
+ end
72
+
73
+ def to_headers
74
+ headers = {}
75
+ headers.merge!(@authorization.to_headers) if authorization
76
+ headers
77
+ end
78
+ end
79
+
80
+ class RotateCompleteRequestOptions
81
+ # Optional authorization object.
82
+ # Pass in an active Stytch Member session token or session JWT and the request
83
+ # will be run using that member's permissions.
84
+ attr_accessor :authorization
85
+
86
+ def initialize(
87
+ authorization: nil
88
+ )
89
+ @authorization = authorization
90
+ end
91
+
92
+ def to_headers
93
+ headers = {}
94
+ headers.merge!(@authorization.to_headers) if authorization
95
+ headers
96
+ end
97
+ end
98
+
99
+ class RotateCancelRequestOptions
100
+ # Optional authorization object.
101
+ # Pass in an active Stytch Member session token or session JWT and the request
102
+ # will be run using that member's permissions.
103
+ attr_accessor :authorization
104
+
105
+ def initialize(
106
+ authorization: nil
107
+ )
108
+ @authorization = authorization
109
+ end
110
+
111
+ def to_headers
112
+ headers = {}
113
+ headers.merge!(@authorization.to_headers) if authorization
114
+ headers
115
+ end
116
+ end
117
+
118
+ class GetGroupsRequestOptions
119
+ # Optional authorization object.
120
+ # Pass in an active Stytch Member session token or session JWT and the request
121
+ # will be run using that member's permissions.
122
+ attr_accessor :authorization
123
+
124
+ def initialize(
125
+ authorization: nil
126
+ )
127
+ @authorization = authorization
128
+ end
129
+
130
+ def to_headers
131
+ headers = {}
132
+ headers.merge!(@authorization.to_headers) if authorization
133
+ headers
134
+ end
135
+ end
136
+
137
+ class CreateRequestOptions
138
+ # Optional authorization object.
139
+ # Pass in an active Stytch Member session token or session JWT and the request
140
+ # will be run using that member's permissions.
141
+ attr_accessor :authorization
142
+
143
+ def initialize(
144
+ authorization: nil
145
+ )
146
+ @authorization = authorization
147
+ end
148
+
149
+ def to_headers
150
+ headers = {}
151
+ headers.merge!(@authorization.to_headers) if authorization
152
+ headers
153
+ end
154
+ end
155
+
156
+ class GetRequestOptions
157
+ # Optional authorization object.
158
+ # Pass in an active Stytch Member session token or session JWT and the request
159
+ # will be run using that member's permissions.
160
+ attr_accessor :authorization
161
+
162
+ def initialize(
163
+ authorization: nil
164
+ )
165
+ @authorization = authorization
166
+ end
167
+
168
+ def to_headers
169
+ headers = {}
170
+ headers.merge!(@authorization.to_headers) if authorization
171
+ headers
172
+ end
173
+ end
174
+
175
+ include Stytch::RequestHelper
176
+
177
+ def initialize(connection)
178
+ @connection = connection
179
+ end
180
+
181
+ # Update a SCIM Connection.
182
+ #
183
+ # == Parameters:
184
+ # organization_id::
185
+ # 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.
186
+ # The type of this field is +String+.
187
+ # connection_id::
188
+ # The ID of the SCIM connection.
189
+ # The type of this field is +String+.
190
+ # display_name::
191
+ # A human-readable display name for the connection.
192
+ # The type of this field is nilable +String+.
193
+ # identity_provider::
194
+ # (no documentation yet)
195
+ # The type of this field is nilable +UpdateRequestIdentityProvider+ (string enum).
196
+ # scim_group_implicit_role_assignments::
197
+ # An array of SCIM group implicit role assignments. Each object in the array must contain a `group_id` and a `role_id`.
198
+ # The type of this field is nilable list of +SCIMGroupImplicitRoleAssignments+.
199
+ #
200
+ # == Returns:
201
+ # An object with the following fields:
202
+ # request_id::
203
+ # 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.
204
+ # The type of this field is +String+.
205
+ # status_code::
206
+ # 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.
207
+ # The type of this field is +Integer+.
208
+ # connection::
209
+ # The `SAML Connection` object affected by this API call. See the [SAML Connection Object](https://stytch.com/docs/b2b/api/saml-connection-object) for complete response field details.
210
+ # The type of this field is nilable +SCIMConnection+ (+object+).
211
+ #
212
+ # == Method Options:
213
+ # This method supports an optional +StytchB2B::SCIM::Connection::UpdateRequestOptions+ object which will modify the headers sent in the HTTP request.
214
+ def update(
215
+ organization_id:,
216
+ connection_id:,
217
+ display_name: nil,
218
+ identity_provider: nil,
219
+ scim_group_implicit_role_assignments: nil,
220
+ method_options: nil
221
+ )
222
+ headers = {}
223
+ headers = headers.merge(method_options.to_headers) unless method_options.nil?
224
+ request = {}
225
+ request[:display_name] = display_name unless display_name.nil?
226
+ request[:identity_provider] = identity_provider unless identity_provider.nil?
227
+ request[:scim_group_implicit_role_assignments] = scim_group_implicit_role_assignments unless scim_group_implicit_role_assignments.nil?
228
+
229
+ put_request("/v1/b2b/scim/#{organization_id}/connection/#{connection_id}", request, headers)
230
+ end
231
+
232
+ # Deletes a SCIM Connection.
233
+ #
234
+ # == Parameters:
235
+ # organization_id::
236
+ # 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.
237
+ # The type of this field is +String+.
238
+ # connection_id::
239
+ # The ID of the SCIM connection.
240
+ # The type of this field is +String+.
241
+ #
242
+ # == Returns:
243
+ # An object with the following fields:
244
+ # request_id::
245
+ # 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.
246
+ # The type of this field is +String+.
247
+ # connection_id::
248
+ # The `connection_id` that was deleted as part of the delete request.
249
+ # The type of this field is +String+.
250
+ # status_code::
251
+ # 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.
252
+ # The type of this field is +Integer+.
253
+ #
254
+ # == Method Options:
255
+ # This method supports an optional +StytchB2B::SCIM::Connection::DeleteRequestOptions+ object which will modify the headers sent in the HTTP request.
256
+ def delete(
257
+ organization_id:,
258
+ connection_id:,
259
+ method_options: nil
260
+ )
261
+ headers = {}
262
+ headers = headers.merge(method_options.to_headers) unless method_options.nil?
263
+ delete_request("/v1/b2b/scim/#{organization_id}/connection/#{connection_id}", headers)
264
+ end
265
+
266
+ # Start a SCIM token rotation.
267
+ #
268
+ # == Parameters:
269
+ # organization_id::
270
+ # 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.
271
+ # The type of this field is +String+.
272
+ # connection_id::
273
+ # The ID of the SCIM connection.
274
+ # The type of this field is +String+.
275
+ #
276
+ # == Returns:
277
+ # An object with the following fields:
278
+ # request_id::
279
+ # 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.
280
+ # The type of this field is +String+.
281
+ # status_code::
282
+ # 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.
283
+ # The type of this field is +Integer+.
284
+ # connection::
285
+ # The `SCIM Connection` object affected by this API call. See the [SCIM Connection Object](https://stytch.com/docs/b2b/api/scim-connection-object) for complete response field details.
286
+ # The type of this field is nilable +SCIMConnectionWithNextToken+ (+object+).
287
+ #
288
+ # == Method Options:
289
+ # This method supports an optional +StytchB2B::SCIM::Connection::RotateStartRequestOptions+ object which will modify the headers sent in the HTTP request.
290
+ def rotate_start(
291
+ organization_id:,
292
+ connection_id:,
293
+ method_options: nil
294
+ )
295
+ headers = {}
296
+ headers = headers.merge(method_options.to_headers) unless method_options.nil?
297
+ request = {}
298
+
299
+ post_request("/v1/b2b/scim/#{organization_id}/connection/#{connection_id}/rotate/start", request, headers)
300
+ end
301
+
302
+ # Completes a SCIM token rotation. This will complete the current token rotation process and update the active token to be the new token supplied in the [start SCIM token rotation](https://stytch.com/docs/b2b/api/scim-rotate-token-start) response.
303
+ #
304
+ # == Parameters:
305
+ # organization_id::
306
+ # 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.
307
+ # The type of this field is +String+.
308
+ # connection_id::
309
+ # The ID of the SCIM connection.
310
+ # The type of this field is +String+.
311
+ #
312
+ # == Returns:
313
+ # An object with the following fields:
314
+ # request_id::
315
+ # 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.
316
+ # The type of this field is +String+.
317
+ # status_code::
318
+ # 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.
319
+ # The type of this field is +Integer+.
320
+ # connection::
321
+ # The `SCIM Connection` object affected by this API call. See the [SCIM Connection Object](https://stytch.com/docs/b2b/api/scim-connection-object) for complete response field details.
322
+ # The type of this field is nilable +SCIMConnection+ (+object+).
323
+ #
324
+ # == Method Options:
325
+ # This method supports an optional +StytchB2B::SCIM::Connection::RotateCompleteRequestOptions+ object which will modify the headers sent in the HTTP request.
326
+ def rotate_complete(
327
+ organization_id:,
328
+ connection_id:,
329
+ method_options: nil
330
+ )
331
+ headers = {}
332
+ headers = headers.merge(method_options.to_headers) unless method_options.nil?
333
+ request = {}
334
+
335
+ post_request("/v1/b2b/scim/#{organization_id}/connection/#{connection_id}/rotate/complete", request, headers)
336
+ end
337
+
338
+ # Cancel a SCIM token rotation. This will cancel the current token rotation process, keeping the original token active.
339
+ #
340
+ # == Parameters:
341
+ # organization_id::
342
+ # 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.
343
+ # The type of this field is +String+.
344
+ # connection_id::
345
+ # The ID of the SCIM connection.
346
+ # The type of this field is +String+.
347
+ #
348
+ # == Returns:
349
+ # An object with the following fields:
350
+ # request_id::
351
+ # 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.
352
+ # The type of this field is +String+.
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+.
356
+ # connection::
357
+ # The `SCIM Connection` object affected by this API call. See the [SCIM Connection Object](https://stytch.com/docs/b2b/api/scim-connection-object) for complete response field details.
358
+ # The type of this field is nilable +SCIMConnection+ (+object+).
359
+ #
360
+ # == Method Options:
361
+ # This method supports an optional +StytchB2B::SCIM::Connection::RotateCancelRequestOptions+ object which will modify the headers sent in the HTTP request.
362
+ def rotate_cancel(
363
+ organization_id:,
364
+ connection_id:,
365
+ method_options: nil
366
+ )
367
+ headers = {}
368
+ headers = headers.merge(method_options.to_headers) unless method_options.nil?
369
+ request = {}
370
+
371
+ post_request("/v1/b2b/scim/#{organization_id}/connection/#{connection_id}/rotate/cancel", request, headers)
372
+ end
373
+
374
+ # Gets a paginated list of all SCIM Groups associated with a given Connection.
375
+ #
376
+ # == Parameters:
377
+ # organization_id::
378
+ # 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.
379
+ # The type of this field is +String+.
380
+ # connection_id::
381
+ # The ID of the SCIM connection.
382
+ # The type of this field is +String+.
383
+ # cursor::
384
+ # 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.
385
+ # The type of this field is nilable +String+.
386
+ # limit::
387
+ # 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.
388
+ # The type of this field is nilable +Integer+.
389
+ #
390
+ # == Returns:
391
+ # An object with the following fields:
392
+ # scim_groups::
393
+ # A list of SCIM Connection Groups belonging to the connection.
394
+ # The type of this field is list of +SCIMGroup+ (+object+).
395
+ # status_code::
396
+ # (no documentation yet)
397
+ # The type of this field is +Integer+.
398
+ # next_cursor::
399
+ # The `next_cursor` string is returned when your search result contains more than one page of results. This value is passed into your next search call in the `cursor` field.
400
+ # The type of this field is nilable +String+.
401
+ #
402
+ # == Method Options:
403
+ # This method supports an optional +StytchB2B::SCIM::Connection::GetGroupsRequestOptions+ object which will modify the headers sent in the HTTP request.
404
+ def get_groups(
405
+ organization_id:,
406
+ connection_id:,
407
+ cursor: nil,
408
+ limit: nil,
409
+ method_options: nil
410
+ )
411
+ headers = {}
412
+ headers = headers.merge(method_options.to_headers) unless method_options.nil?
413
+ query_params = {
414
+ cursor: cursor,
415
+ limit: limit
416
+ }
417
+ request = request_with_query_params("/v1/b2b/scim/#{organization_id}/connection/#{connection_id}", query_params)
418
+ get_request(request, headers)
419
+ end
420
+
421
+ # Create a new SCIM Connection.
422
+ #
423
+ # == Parameters:
424
+ # organization_id::
425
+ # 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.
426
+ # The type of this field is +String+.
427
+ # display_name::
428
+ # A human-readable display name for the connection.
429
+ # The type of this field is nilable +String+.
430
+ # identity_provider::
431
+ # (no documentation yet)
432
+ # The type of this field is nilable +CreateRequestIdentityProvider+ (string enum).
433
+ #
434
+ # == Returns:
435
+ # An object with the following fields:
436
+ # request_id::
437
+ # 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.
438
+ # The type of this field is +String+.
439
+ # status_code::
440
+ # 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.
441
+ # The type of this field is +Integer+.
442
+ # connection::
443
+ # The `SCIM Connection` object affected by this API call. See the [SCIM Connection Object](https://stytch.com/docs/b2b/api/scim-connection-object) for complete response field details.
444
+ # The type of this field is nilable +SCIMConnectionWithToken+ (+object+).
445
+ #
446
+ # == Method Options:
447
+ # This method supports an optional +StytchB2B::SCIM::Connection::CreateRequestOptions+ object which will modify the headers sent in the HTTP request.
448
+ def create(
449
+ organization_id:,
450
+ display_name: nil,
451
+ identity_provider: nil,
452
+ method_options: nil
453
+ )
454
+ headers = {}
455
+ headers = headers.merge(method_options.to_headers) unless method_options.nil?
456
+ request = {}
457
+ request[:display_name] = display_name unless display_name.nil?
458
+ request[:identity_provider] = identity_provider unless identity_provider.nil?
459
+
460
+ post_request("/v1/b2b/scim/#{organization_id}/connection", request, headers)
461
+ end
462
+
463
+ # Get SCIM Connection.
464
+ #
465
+ # == Parameters:
466
+ # organization_id::
467
+ # 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.
468
+ # The type of this field is +String+.
469
+ #
470
+ # == Returns:
471
+ # An object with the following fields:
472
+ # request_id::
473
+ # 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.
474
+ # The type of this field is +String+.
475
+ # status_code::
476
+ # 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.
477
+ # The type of this field is +Integer+.
478
+ # connection::
479
+ # (no documentation yet)
480
+ # The type of this field is nilable +SCIMConnection+ (+object+).
481
+ #
482
+ # == Method Options:
483
+ # This method supports an optional +StytchB2B::SCIM::Connection::GetRequestOptions+ object which will modify the headers sent in the HTTP request.
484
+ def get(
485
+ organization_id:,
486
+ method_options: nil
487
+ )
488
+ headers = {}
489
+ headers = headers.merge(method_options.to_headers) unless method_options.nil?
490
+ query_params = {}
491
+ request = request_with_query_params("/v1/b2b/scim/#{organization_id}/connection", query_params)
492
+ get_request(request, headers)
493
+ end
494
+ end
495
+ end
496
+ end