didit-sdk 2.25.0 → 2.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,721 @@
1
+ # Code generated by codegen from openapi/*.json. DO NOT EDIT.
2
+ # frozen_string_literal: true
3
+
4
+ module Didit
5
+ module Resources
6
+ # The +authentication_setup+ resource.
7
+ class AuthenticationSetup < Didit::Resource
8
+ # Activate the custom domain
9
+ #
10
+ # Makes the verified domain the application's canonical origin, which moves the issuer and the passkey relying
11
+ # party to it. After activation, `/session/` immediately rejects access tokens issued under the old host.
12
+ # Refresh them to obtain access tokens for the new issuer.
13
+ #
14
+ # +POST /organizations/{organization_id}/applications/{application_id}/authentication/domain/activate/+
15
+ #
16
+ # @param organization_id [String] UUID of the organization that owns the application.
17
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
18
+ # application only.
19
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
20
+ # @return [Didit::Types::SetupDomain]
21
+ def activate_domain(organization_id, application_id, request_options: nil)
22
+ @client.request(
23
+ :post,
24
+ "/organizations/{organization_id}/applications/{application_id}/authentication/domain/activate/",
25
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
26
+ api: :account,
27
+ response: Types::SetupDomain,
28
+ request_options: request_options
29
+ )
30
+ end
31
+
32
+ # Get the hosted pages' branding
33
+ #
34
+ # Returns the application's brand as the hosted pages show it, the texts set per language, the legal links and
35
+ # the hosted URL.
36
+ #
37
+ # +GET /organizations/{organization_id}/applications/{application_id}/authentication/branding/+
38
+ #
39
+ # @param organization_id [String] UUID of the organization that owns the application.
40
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
41
+ # application only.
42
+ # @param language [String] Language of the default texts and the previews: an unsupported code falls back to
43
+ # `en`.
44
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
45
+ # @return [Didit::Types::SetupBranding]
46
+ def get_branding(organization_id, application_id, language: OMIT, request_options: nil)
47
+ @client.request(
48
+ :get,
49
+ "/organizations/{organization_id}/applications/{application_id}/authentication/branding/",
50
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
51
+ query: {
52
+ "language" => language
53
+ },
54
+ api: :account,
55
+ response: Types::SetupBranding,
56
+ request_options: request_options
57
+ )
58
+ end
59
+
60
+ # Get the Authentication setup
61
+ #
62
+ # Returns the application's Authentication configuration and every sign-in method with its `enabled` state and
63
+ # `credential_source`, which is how an agent verifies the setup it made. Disabled methods are listed too, and
64
+ # `credential_source` is `null` for a method that holds no social credentials. The top-level `enabled` is
65
+ # `false` when Authentication is disabled for the application.
66
+ #
67
+ # +GET /organizations/{organization_id}/applications/{application_id}/authentication/+
68
+ #
69
+ # @param organization_id [String] UUID of the organization that owns the application.
70
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
71
+ # application only.
72
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
73
+ # @return [Didit::Types::SetupConfiguration]
74
+ def get_configuration(organization_id, application_id, request_options: nil)
75
+ @client.request(
76
+ :get,
77
+ "/organizations/{organization_id}/applications/{application_id}/authentication/",
78
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
79
+ api: :account,
80
+ response: Types::SetupConfiguration,
81
+ request_options: request_options
82
+ )
83
+ end
84
+
85
+ # Get the hosted domain
86
+ #
87
+ # Returns the hosted origin, the issuer and passkey relying party that follow from it, and the custom domain
88
+ # with its DNS record, certificate and status. `origin` names the custom domain once it is active and the
89
+ # default host until then.
90
+ #
91
+ # +GET /organizations/{organization_id}/applications/{application_id}/authentication/domain/+
92
+ #
93
+ # @param organization_id [String] UUID of the organization that owns the application.
94
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
95
+ # application only.
96
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
97
+ # @return [Didit::Types::SetupDomain]
98
+ def get_domain(organization_id, application_id, request_options: nil)
99
+ @client.request(
100
+ :get,
101
+ "/organizations/{organization_id}/applications/{application_id}/authentication/domain/",
102
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
103
+ api: :account,
104
+ response: Types::SetupDomain,
105
+ request_options: request_options
106
+ )
107
+ end
108
+
109
+ # Preview a sign-in email
110
+ #
111
+ # Returns one email as it renders, with sample codes and links. An invitation preview uses a sample organization
112
+ # for a grant or named key. A console session can see a customer organization's name. The address of a console
113
+ # member is left out for a grant or a key, which have no mailbox. An email Authentication does not send answers
114
+ # `{"error": "email_not_sent_by_authentication"}`.
115
+ #
116
+ # +GET /organizations/{organization_id}/applications/{application_id}/authentication/emails/{key}/+
117
+ #
118
+ # @param organization_id [String] UUID of the organization that owns the application.
119
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
120
+ # application only.
121
+ # @param key [String] The email: `code`, `magic`, `reset`, `device`, `invite`, `org`, `agent` or `agentoff`.
122
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
123
+ # @return [Didit::Types::SetupEmail]
124
+ def get_email(organization_id, application_id, key, request_options: nil)
125
+ @client.request(
126
+ :get,
127
+ "/organizations/{organization_id}/applications/{application_id}/authentication/emails/{key}/",
128
+ path_params: { "organization_id" => organization_id, "application_id" => application_id, "key" => key },
129
+ api: :account,
130
+ response: Types::SetupEmail,
131
+ request_options: request_options
132
+ )
133
+ end
134
+
135
+ # List the sign-in emails
136
+ #
137
+ # Lists the emails Didit Authentication sends, with the ones this application sends switched on and their
138
+ # subject in the language you ask for. The senders in the response are read-only here: they come from
139
+ # Customization.
140
+ #
141
+ # +GET /organizations/{organization_id}/applications/{application_id}/authentication/emails/+
142
+ #
143
+ # @param organization_id [String] UUID of the organization that owns the application.
144
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
145
+ # application only.
146
+ # @param language [String] Language of the subjects and previews: an unsupported code falls back to `en`.
147
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
148
+ # @return [Didit::Types::SetupEmails]
149
+ def get_emails(organization_id, application_id, language: OMIT, request_options: nil)
150
+ @client.request(
151
+ :get,
152
+ "/organizations/{organization_id}/applications/{application_id}/authentication/emails/",
153
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
154
+ query: {
155
+ "language" => language
156
+ },
157
+ api: :account,
158
+ response: Types::SetupEmails,
159
+ request_options: request_options
160
+ )
161
+ end
162
+
163
+ # Get the native apps
164
+ #
165
+ # Returns the iOS app IDs and Android apps that share this application's passkeys, as the association files at
166
+ # the hosted origin publish them.
167
+ #
168
+ # +GET /organizations/{organization_id}/applications/{application_id}/authentication/native-apps/+
169
+ #
170
+ # @param organization_id [String] UUID of the organization that owns the application.
171
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
172
+ # application only.
173
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
174
+ # @return [Didit::Types::SetupNativeApps]
175
+ def get_native_apps(organization_id, application_id, request_options: nil)
176
+ @client.request(
177
+ :get,
178
+ "/organizations/{organization_id}/applications/{application_id}/authentication/native-apps/",
179
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
180
+ api: :account,
181
+ response: Types::SetupNativeApps,
182
+ request_options: request_options
183
+ )
184
+ end
185
+
186
+ # Get the onboarding progress
187
+ #
188
+ # Returns which setup steps are done, whether the application is ready and how people sign in. A grant or a key
189
+ # gets progress only: the console session's sample sign-in details, which name an end user, are left out.
190
+ #
191
+ # +GET /organizations/{organization_id}/applications/{application_id}/authentication/onboarding/+
192
+ #
193
+ # @param organization_id [String] UUID of the organization that owns the application.
194
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
195
+ # application only.
196
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
197
+ # @return [Didit::Types::SetupOnboarding]
198
+ def get_onboarding(organization_id, application_id, request_options: nil)
199
+ @client.request(
200
+ :get,
201
+ "/organizations/{organization_id}/applications/{application_id}/authentication/onboarding/",
202
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
203
+ api: :account,
204
+ response: Types::SetupOnboarding,
205
+ request_options: request_options
206
+ )
207
+ end
208
+
209
+ # Get bot protection
210
+ #
211
+ # Returns whether protection is on, each policy's mode and the last 14 days of detections. Console sessions,
212
+ # grants and named keys receive the same aggregate counters.
213
+ #
214
+ # +GET /organizations/{organization_id}/applications/{application_id}/authentication/protection/+
215
+ #
216
+ # @param organization_id [String] UUID of the organization that owns the application.
217
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
218
+ # application only.
219
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
220
+ # @return [Didit::Types::SetupProtection]
221
+ def get_protection(organization_id, application_id, request_options: nil)
222
+ @client.request(
223
+ :get,
224
+ "/organizations/{organization_id}/applications/{application_id}/authentication/protection/",
225
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
226
+ api: :account,
227
+ response: Types::SetupProtection,
228
+ request_options: request_options
229
+ )
230
+ end
231
+
232
+ # Get the application settings
233
+ #
234
+ # Returns agent access, organizations, the MFA policy, the default member role and the webhook events switched
235
+ # off.
236
+ #
237
+ # +GET /organizations/{organization_id}/applications/{application_id}/authentication/settings/+
238
+ #
239
+ # @param organization_id [String] UUID of the organization that owns the application.
240
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
241
+ # application only.
242
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
243
+ # @return [Didit::Types::SetupSettings]
244
+ def get_settings(organization_id, application_id, request_options: nil)
245
+ @client.request(
246
+ :get,
247
+ "/organizations/{organization_id}/applications/{application_id}/authentication/settings/",
248
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
249
+ api: :account,
250
+ response: Types::SetupSettings,
251
+ request_options: request_options
252
+ )
253
+ end
254
+
255
+ # Get verified sign-in
256
+ #
257
+ # Returns the sign-up verification level, the step-up rules with this month's counters, the claims your tokens
258
+ # carry and the verification workflows behind them.
259
+ #
260
+ # +GET /organizations/{organization_id}/applications/{application_id}/authentication/verified/+
261
+ #
262
+ # @param organization_id [String] UUID of the organization that owns the application.
263
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
264
+ # application only.
265
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
266
+ # @return [Didit::Types::SetupVerified]
267
+ def get_verified(organization_id, application_id, request_options: nil)
268
+ @client.request(
269
+ :get,
270
+ "/organizations/{organization_id}/applications/{application_id}/authentication/verified/",
271
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
272
+ api: :account,
273
+ response: Types::SetupVerified,
274
+ request_options: request_options
275
+ )
276
+ end
277
+
278
+ # Remove the custom domain
279
+ #
280
+ # Removes the custom domain and returns the application to its default host. When the edge does not confirm the
281
+ # removal the call answers 503 and the domain stays claimed; retry it.
282
+ #
283
+ # +DELETE /organizations/{organization_id}/applications/{application_id}/authentication/domain/+
284
+ #
285
+ # @param organization_id [String] UUID of the organization that owns the application.
286
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
287
+ # application only.
288
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
289
+ # @return [Didit::Types::SetupDomain]
290
+ def remove_domain(organization_id, application_id, request_options: nil)
291
+ @client.request(
292
+ :delete,
293
+ "/organizations/{organization_id}/applications/{application_id}/authentication/domain/",
294
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
295
+ api: :account,
296
+ response: Types::SetupDomain,
297
+ request_options: request_options
298
+ )
299
+ end
300
+
301
+ # Claim a custom domain
302
+ #
303
+ # Claims a domain for the application's hosted pages: `pending` until DNS points at the application's default
304
+ # host. Claiming a second domain while one is claimed, verified or active answers 409 `{"domain":
305
+ # "custom_domain_exists"}`; an apex, an IP or one of Didit's own hosts answers `{"domain": "invalid_domain"}`.
306
+ #
307
+ # +PUT /organizations/{organization_id}/applications/{application_id}/authentication/domain/+
308
+ #
309
+ # @param organization_id [String] UUID of the organization that owns the application.
310
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
311
+ # application only.
312
+ # @param domain [String] The domain to serve the hosted pages on. It must be a host under a zone: a CNAME cannot
313
+ # sit at an apex.
314
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
315
+ # @return [Didit::Types::SetupDomain]
316
+ def set_domain(organization_id, application_id, domain:, request_options: nil)
317
+ @client.request(
318
+ :put,
319
+ "/organizations/{organization_id}/applications/{application_id}/authentication/domain/",
320
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
321
+ body: {
322
+ "domain" => domain
323
+ },
324
+ api: :account,
325
+ response: Types::SetupDomain,
326
+ request_options: request_options
327
+ )
328
+ end
329
+
330
+ # Enable or disable a sign-in method
331
+ #
332
+ # Enables or disables one method; `enabled` is required. A social method (`google`, `microsoft`, `apple`,
333
+ # `github`) takes either your own `credentials` or `credential_source: "didit_test"`, which uses Didit's own
334
+ # sandbox app and is refused on a live application with `{"credential_source": "sandbox_only"}`; a test app the
335
+ # application cannot use answers `{"credential_source": "unavailable"}`. `phone` takes the `workflow_id` of a
336
+ # phone verification workflow. `credentials`, `workflow_id` or `credential_source` on a method that does not use
337
+ # them answer `not_supported`, turning off a method that is always on answers `{"enabled": "always_on"}`, and an
338
+ # unknown method answers `{"name": "method_unavailable"}`.
339
+ #
340
+ # +PUT /organizations/{organization_id}/applications/{application_id}/authentication/methods/{name}/+
341
+ #
342
+ # @param organization_id [String] UUID of the organization that owns the application.
343
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
344
+ # application only.
345
+ # @param name [String] The method: `password`, `code`, `magic`, `phone`, `passkey`, `google`, `microsoft`,
346
+ # `apple`, `github`, `sso` or `wallet`.
347
+ # @param enabled [Boolean]
348
+ # @param credentials [Hash] Your own OAuth app's credentials. The secret is write-only: no response returns it.
349
+ # @param credential_source [String] `didit_test` uses Didit's own sandbox app, and is refused on a live
350
+ # application with `sandbox_only`. Omitted: `own` when you send `credentials`, the stored source otherwise, and
351
+ # `didit_test` for a sandbox application's social method that was never configured.
352
+ # @param workflow_id [String] `phone` only: the phone verification workflow whose codes it sends.
353
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
354
+ # @return [Didit::Types::SetupMethodResult]
355
+ def set_method(
356
+ organization_id,
357
+ application_id,
358
+ name,
359
+ enabled:,
360
+ credentials: OMIT,
361
+ credential_source: OMIT,
362
+ workflow_id: OMIT,
363
+ request_options: nil
364
+ )
365
+ @client.request(
366
+ :put,
367
+ "/organizations/{organization_id}/applications/{application_id}/authentication/methods/{name}/",
368
+ path_params: { "organization_id" => organization_id, "application_id" => application_id, "name" => name },
369
+ body: {
370
+ "enabled" => enabled,
371
+ "credentials" => credentials,
372
+ "credential_source" => credential_source,
373
+ "workflow_id" => workflow_id
374
+ },
375
+ api: :account,
376
+ response: Types::SetupMethodResult,
377
+ request_options: request_options
378
+ )
379
+ end
380
+
381
+ # Update the hosted pages' branding
382
+ #
383
+ # Changes the hosted pages' own texts and legal links. The logo, colours and fonts are read-only here: they come
384
+ # from Customization. A language Didit does not publish answers `{"<language>": "unsupported_language"}`, and a
385
+ # legal link that is not `https://` answers `https_required`.
386
+ #
387
+ # +PATCH /organizations/{organization_id}/applications/{application_id}/authentication/branding/+
388
+ #
389
+ # @param organization_id [String] UUID of the organization that owns the application.
390
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
391
+ # application only.
392
+ # @param texts [Hash{String => Hash}]
393
+ # @param terms_url [String]
394
+ # @param privacy_url [String]
395
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
396
+ # @return [Didit::Types::SetupBranding]
397
+ def update_branding(
398
+ organization_id,
399
+ application_id,
400
+ texts: OMIT,
401
+ terms_url: OMIT,
402
+ privacy_url: OMIT,
403
+ request_options: nil
404
+ )
405
+ @client.request(
406
+ :patch,
407
+ "/organizations/{organization_id}/applications/{application_id}/authentication/branding/",
408
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
409
+ body: {
410
+ "texts" => texts,
411
+ "terms_url" => terms_url,
412
+ "privacy_url" => privacy_url
413
+ },
414
+ api: :account,
415
+ response: Types::SetupBranding,
416
+ request_options: request_options
417
+ )
418
+ end
419
+
420
+ # Update the Authentication setup
421
+ #
422
+ # Changes the settings in the body: callback URLs, allowed origins, session lifetime, idle timeout, password
423
+ # rules and the sign-up policy. Send only the fields you change. `enabled` is refused with `{"enabled":
424
+ # "follows_product"}` because the product's state decides it, and an unknown field with `{"<field>":
425
+ # "unknown_field"}`.
426
+ #
427
+ # +PATCH /organizations/{organization_id}/applications/{application_id}/authentication/+
428
+ #
429
+ # @param organization_id [String] UUID of the organization that owns the application.
430
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
431
+ # application only.
432
+ # @param redirect_uris [Array<String>]
433
+ # @param allowed_origins [Array<String>]
434
+ # @param post_logout_redirect_uri [String]
435
+ # @param session_lifetime [Integer]
436
+ # @param idle_timeout [Integer]
437
+ # @param multiple_sessions [Boolean]
438
+ # @param password_min_length [Integer]
439
+ # @param revoke_on_password_change [Boolean]
440
+ # @param allow_subaddresses [Boolean]
441
+ # @param signup_policy [String]
442
+ # @param allowed_email_domains [Array<String>]
443
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
444
+ # @return [Didit::Types::SetupConfiguration]
445
+ def update_configuration(
446
+ organization_id,
447
+ application_id,
448
+ redirect_uris: OMIT,
449
+ allowed_origins: OMIT,
450
+ post_logout_redirect_uri: OMIT,
451
+ session_lifetime: OMIT,
452
+ idle_timeout: OMIT,
453
+ multiple_sessions: OMIT,
454
+ password_min_length: OMIT,
455
+ revoke_on_password_change: OMIT,
456
+ allow_subaddresses: OMIT,
457
+ signup_policy: OMIT,
458
+ allowed_email_domains: OMIT,
459
+ request_options: nil
460
+ )
461
+ @client.request(
462
+ :patch,
463
+ "/organizations/{organization_id}/applications/{application_id}/authentication/",
464
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
465
+ body: {
466
+ "redirect_uris" => redirect_uris,
467
+ "allowed_origins" => allowed_origins,
468
+ "post_logout_redirect_uri" => post_logout_redirect_uri,
469
+ "session_lifetime" => session_lifetime,
470
+ "idle_timeout" => idle_timeout,
471
+ "multiple_sessions" => multiple_sessions,
472
+ "password_min_length" => password_min_length,
473
+ "revoke_on_password_change" => revoke_on_password_change,
474
+ "allow_subaddresses" => allow_subaddresses,
475
+ "signup_policy" => signup_policy,
476
+ "allowed_email_domains" => allowed_email_domains
477
+ },
478
+ api: :account,
479
+ response: Types::SetupConfiguration,
480
+ request_options: request_options
481
+ )
482
+ end
483
+
484
+ # Update the native apps
485
+ #
486
+ # Replaces the lists of iOS app IDs and Android apps. A malformed entry answers a field error in the shape
487
+ # `{"ios_app_ids": ["This field is invalid."]}`; duplicates are dropped.
488
+ #
489
+ # +PUT /organizations/{organization_id}/applications/{application_id}/authentication/native-apps/+
490
+ #
491
+ # @param organization_id [String] UUID of the organization that owns the application.
492
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
493
+ # application only.
494
+ # @param ios_app_ids [Array<String>]
495
+ # @param android_apps [Array<Hash>]
496
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
497
+ # @return [Didit::Types::SetupNativeApps]
498
+ def update_native_apps(organization_id, application_id, ios_app_ids:, android_apps:, request_options: nil)
499
+ @client.request(
500
+ :put,
501
+ "/organizations/{organization_id}/applications/{application_id}/authentication/native-apps/",
502
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
503
+ body: {
504
+ "ios_app_ids" => ios_app_ids,
505
+ "android_apps" => android_apps
506
+ },
507
+ api: :account,
508
+ response: Types::SetupNativeApps,
509
+ request_options: request_options
510
+ )
511
+ end
512
+
513
+ # Update the onboarding progress
514
+ #
515
+ # Records a setup step: skip the test sign-in, skip the user import, or choose the hosted sign-in page or your
516
+ # own screens. An empty body answers `{"non_field_errors": ["empty_update"]}`.
517
+ #
518
+ # +PATCH /organizations/{organization_id}/applications/{application_id}/authentication/onboarding/+
519
+ #
520
+ # @param organization_id [String] UUID of the organization that owns the application.
521
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
522
+ # application only.
523
+ # @param test_skipped [Boolean]
524
+ # @param import_skipped [Boolean]
525
+ # @param sign_in_ui [String]
526
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
527
+ # @return [Didit::Types::SetupOnboarding]
528
+ def update_onboarding(
529
+ organization_id,
530
+ application_id,
531
+ test_skipped: OMIT,
532
+ import_skipped: OMIT,
533
+ sign_in_ui: OMIT,
534
+ request_options: nil
535
+ )
536
+ @client.request(
537
+ :patch,
538
+ "/organizations/{organization_id}/applications/{application_id}/authentication/onboarding/",
539
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
540
+ body: {
541
+ "test_skipped" => test_skipped,
542
+ "import_skipped" => import_skipped,
543
+ "sign_in_ui" => sign_in_ui
544
+ },
545
+ api: :account,
546
+ response: Types::SetupOnboarding,
547
+ request_options: request_options
548
+ )
549
+ end
550
+
551
+ # Update bot protection
552
+ #
553
+ # Turns protection on or off, turns the breached-password check on or off and sets a mode per policy. The
554
+ # policies you send are merged into the stored ones. An unknown policy answers `{"policies":
555
+ # ["unknown_protection"]}`.
556
+ #
557
+ # +PATCH /organizations/{organization_id}/applications/{application_id}/authentication/protection/+
558
+ #
559
+ # @param organization_id [String] UUID of the organization that owns the application.
560
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
561
+ # application only.
562
+ # @param enabled [Boolean]
563
+ # @param breached_password_check [Boolean]
564
+ # @param policies [Hash{String => String}] A mode per policy: `bots`, `stuffing`, `brute`, `disposable`, `vpn`
565
+ # and `travel`.
566
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
567
+ # @return [Didit::Types::SetupProtection]
568
+ def update_protection(
569
+ organization_id,
570
+ application_id,
571
+ enabled: OMIT,
572
+ breached_password_check: OMIT,
573
+ policies: OMIT,
574
+ request_options: nil
575
+ )
576
+ @client.request(
577
+ :patch,
578
+ "/organizations/{organization_id}/applications/{application_id}/authentication/protection/",
579
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
580
+ body: {
581
+ "enabled" => enabled,
582
+ "breached_password_check" => breached_password_check,
583
+ "policies" => policies
584
+ },
585
+ api: :account,
586
+ response: Types::SetupProtection,
587
+ request_options: request_options
588
+ )
589
+ end
590
+
591
+ # Update the application settings
592
+ #
593
+ # Changes the settings in the body. `agent_humans_only` needs a person: a named API key answers 403
594
+ # `owner_or_admin_required`, and turning it on needs an owner or admin with an enrolled passkey.
595
+ #
596
+ # +PATCH /organizations/{organization_id}/applications/{application_id}/authentication/settings/+
597
+ #
598
+ # @param organization_id [String] UUID of the organization that owns the application.
599
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
600
+ # application only.
601
+ # @param sign_in_ui [String]
602
+ # @param agent_humans_only [Boolean]
603
+ # @param agents_enabled [Boolean]
604
+ # @param agent_scopes [Array<String>]
605
+ # @param agent_lifetime [Integer]
606
+ # @param agent_idle_timeout [Integer]
607
+ # @param agent_approval [String]
608
+ # @param organizations_enabled [Boolean]
609
+ # @param mfa_policy [String]
610
+ # @param default_member_role [String]
611
+ # @param webhook_events_disabled [Array<String>]
612
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
613
+ # @return [Didit::Types::SetupSettings]
614
+ def update_settings(
615
+ organization_id,
616
+ application_id,
617
+ sign_in_ui: OMIT,
618
+ agent_humans_only: OMIT,
619
+ agents_enabled: OMIT,
620
+ agent_scopes: OMIT,
621
+ agent_lifetime: OMIT,
622
+ agent_idle_timeout: OMIT,
623
+ agent_approval: OMIT,
624
+ organizations_enabled: OMIT,
625
+ mfa_policy: OMIT,
626
+ default_member_role: OMIT,
627
+ webhook_events_disabled: OMIT,
628
+ request_options: nil
629
+ )
630
+ @client.request(
631
+ :patch,
632
+ "/organizations/{organization_id}/applications/{application_id}/authentication/settings/",
633
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
634
+ body: {
635
+ "sign_in_ui" => sign_in_ui,
636
+ "agent_humans_only" => agent_humans_only,
637
+ "agents_enabled" => agents_enabled,
638
+ "agent_scopes" => agent_scopes,
639
+ "agent_lifetime" => agent_lifetime,
640
+ "agent_idle_timeout" => agent_idle_timeout,
641
+ "agent_approval" => agent_approval,
642
+ "organizations_enabled" => organizations_enabled,
643
+ "mfa_policy" => mfa_policy,
644
+ "default_member_role" => default_member_role,
645
+ "webhook_events_disabled" => webhook_events_disabled
646
+ },
647
+ api: :account,
648
+ response: Types::SetupSettings,
649
+ request_options: request_options
650
+ )
651
+ end
652
+
653
+ # Update verified sign-in
654
+ #
655
+ # Sets the sign-up verification level, the step-up rules, the claims your tokens carry and the workflows the
656
+ # rules use. Each supplied rule updates only the fields you send for its kind. Omitted rules keep their
657
+ # settings. Two rules of the same kind answer `duplicate_rule`, and `threshold` or `currency` on a rule other
658
+ # than `payout` answer `not_supported`.
659
+ #
660
+ # +PATCH /organizations/{organization_id}/applications/{application_id}/authentication/verified/+
661
+ #
662
+ # @param organization_id [String] UUID of the organization that owns the application.
663
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
664
+ # application only.
665
+ # @param signup_level [String]
666
+ # @param rules [Array<Hash>]
667
+ # @param claims [Array<String>]
668
+ # @param workflows [Hash]
669
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
670
+ # @return [Didit::Types::SetupVerified]
671
+ def update_verified(
672
+ organization_id,
673
+ application_id,
674
+ signup_level: OMIT,
675
+ rules: OMIT,
676
+ claims: OMIT,
677
+ workflows: OMIT,
678
+ request_options: nil
679
+ )
680
+ @client.request(
681
+ :patch,
682
+ "/organizations/{organization_id}/applications/{application_id}/authentication/verified/",
683
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
684
+ body: {
685
+ "signup_level" => signup_level,
686
+ "rules" => rules,
687
+ "claims" => claims,
688
+ "workflows" => workflows
689
+ },
690
+ api: :account,
691
+ response: Types::SetupVerified,
692
+ request_options: request_options
693
+ )
694
+ end
695
+
696
+ # Verify the custom domain
697
+ #
698
+ # Checks the DNS record now and asks the edge for the certificate. A missing or mismatched DNS record returns
699
+ # 200 with a `failure_reason`. Read `domain/` afterwards for the result: `verified` once the certificate is
700
+ # issued, `failed` with a `failure_reason` when it cannot be issued.
701
+ #
702
+ # +POST /organizations/{organization_id}/applications/{application_id}/authentication/domain/verify/+
703
+ #
704
+ # @param organization_id [String] UUID of the organization that owns the application.
705
+ # @param application_id [String] UUID of the application: live or sandbox. A named key configures its own
706
+ # application only.
707
+ # @param request_options [Hash, nil] :timeout, :max_retries, :extra_headers, :extra_query, :extra_body
708
+ # @return [Didit::Types::SetupDomain]
709
+ def verify_domain(organization_id, application_id, request_options: nil)
710
+ @client.request(
711
+ :post,
712
+ "/organizations/{organization_id}/applications/{application_id}/authentication/domain/verify/",
713
+ path_params: { "organization_id" => organization_id, "application_id" => application_id },
714
+ api: :account,
715
+ response: Types::SetupDomain,
716
+ request_options: request_options
717
+ )
718
+ end
719
+ end
720
+ end
721
+ end