diff --git a/openapi/SOURCE.json b/openapi/SOURCE.json index d5e32c8..d369dfb 100644 --- a/openapi/SOURCE.json +++ b/openapi/SOURCE.json @@ -1,13 +1,13 @@ { "verification.json": { "url": "https://docs.didit.me/openapi-25.json", - "sha256": "2b0b333987cf2026b56d1ac6a2093ddb5888b6c98495d12d49be96e4cb0a37fd", - "fetched_at": "2026-11-20T19:12:35Z" + "sha256": "eb023f313be71c3ad514cc69387cb03a903e094ba1565dc219fa3735c044005e", + "fetched_at": "2026-11-21T12:14:14Z" }, "account.json": { "url": "https://docs.didit.me/openapi-auth.json", - "sha256": "38ce5a0dda5a0843c95c606819eb65e5d4f6ca474f9e453595cdf2e1c0eae572", - "fetched_at": "2026-11-13T07:57:14Z" + "sha256": "ad62ebe753a36a98b8a7516e099efe7f1fae4229491c6702248c02c61afbc220", + "fetched_at": "2026-11-21T12:14:14Z" }, "webhook-vectors.json": { "generator": "product-automations scripts/server-sdks/make_vectors.py (seeded 2026-10-17)", diff --git a/openapi/account.json b/openapi/account.json index ebe5a61..8f77598 100644 --- a/openapi/account.json +++ b/openapi/account.json @@ -19,6 +19,10 @@ { "name": "Account Management", "description": "Authenticated endpoints (JWT bearer) that list organizations and create, fetch, or update applications. Use these to recover or rotate the `api_key` you authenticate verification API calls with." + }, + { + "name": "Setup", + "description": "Set up Didit Authentication by API: the sign-in methods, the application settings, branding, bot protection, verified sign-in, the sign-up emails, the hosted domain and the native apps. These routes live on `https://apx.didit.me/auth/v2/organizations/{organization_id}/applications/{application_id}/authentication/`, not on the application's issuer, and they take a credential an owner approved: a management grant, or a named API key with the `authentication` scope. The console session of an owner or admin with `write:authentication` still works. End-user data, organizations, roles, imports and agent sessions stay console-only." } ], "paths": { @@ -2215,976 +2219,6253 @@ } ] } - } - }, - "components": { - "securitySchemes": { - "BearerAuth": { - "type": "http", - "scheme": "bearer", - "bearerFormat": "JWT", - "description": "RS256-signed JWT `access_token` returned by `POST /programmatic/login/` or `POST /programmatic/verify-email/`. Send as `Authorization: Bearer `. Default lifetime is 86400 seconds (24h). This token is only valid against the Account Management endpoints on `apx.didit.me/auth/v2`. The verification API (`verification.didit.me/v3`) uses the long-lived `api_key` as `x-api-key` instead." - } }, - "schemas": { - "RegisterRequest": { - "type": "object", - "required": [ - "email", - "password" - ], - "properties": { - "email": { - "type": "string", - "format": "email", - "description": "Any valid email address (personal, work, alias). Used as the unique account identifier.", - "example": "you@yourdomain.com" - }, - "password": { - "type": "string", - "minLength": 8, - "description": "Minimum 8 characters. Must contain at least one uppercase letter (`A-Z`), one lowercase letter (`a-z`), one digit (`0-9`), and one special character from `!@#$%^&*()_+-=[]{}|;:,.<>?`. Validation reports one failed rule at a time.", - "example": "MyStr0ng!Pass" - } + "/organizations/{organization_id}/applications/{application_id}/authentication/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." } - }, - "RegisterResponse": { - "type": "object", - "properties": { - "message": { + ], + "parameters": [ + { + "name": "organization_id", + "in": "path", + "required": true, + "description": "UUID of the organization that owns the application.", + "schema": { "type": "string", - "description": "Human-readable confirmation that the verification code was sent.", - "example": "Registration successful. Check your email for the verification code." - }, - "email": { + "format": "uuid", + "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + } + }, + { + "name": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { "type": "string", - "format": "email", - "description": "The email the verification code was sent to.", - "example": "you@yourdomain.com" + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" } } - }, - "VerifyEmailRequest": { - "type": "object", - "required": [ - "email", - "code" + ], + "get": { + "tags": [ + "Setup" ], - "properties": { - "email": { - "type": "string", - "format": "email", - "description": "Email used during `POST /programmatic/register/`.", - "example": "you@yourdomain.com" + "summary": "Get the Authentication setup", + "description": "Returns the application's Authentication configuration and every sign-in method with its `enabled` state and `credential_source`, which is how an agent verifies the setup it made. Disabled methods are listed too, and `credential_source` is `null` for a method that holds no social credentials. The top-level `enabled` is `false` when Authentication is disabled for the application.", + "operationId": "authentication_get_configuration", + "security": [ + { + "ManagementGrant": [] }, - "code": { - "type": "string", - "minLength": 6, - "maxLength": 6, - "description": "6-character alphanumeric code from the verification email. Codes expire 10 minutes after the most recent code was sent.", - "example": "A3K9F2" + { + "ManagementApiKey": [] } - } - }, - "VerifyEmailResponse": { - "type": "object", - "properties": { - "access_token": { - "type": "string", - "description": "RS256-signed JWT. Use as `Authorization: Bearer ` for Account Management endpoints on `apx.didit.me/auth/v2`." + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_configuration", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "The configuration and its methods.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupConfiguration" + }, + "examples": { + "SetupConfiguration": { + "summary": "A sandbox application with email code on and Didit's test Google app", + "value": { + "enabled": true, + "publishable_key": "pk_test_ZG9jcy1kZW1vLnNhbmRib3guYXV0aC5kaWRpdC5tZQ", + "methods": [ + { + "name": "code", + "enabled": true, + "credential_source": null + }, + { + "name": "google", + "enabled": true, + "credential_source": "didit_test", + "configured": true, + "client_id": "didit-test-google", + "callback_uri": "https://auth.didit.test/social/google/callback" + }, + { + "name": "password", + "enabled": false, + "credential_source": null + } + ], + "didit_test_credentials": { + "google": true, + "microsoft": true, + "apple": true, + "github": true + }, + "redirect_uris": [ + "https://app.example.com/auth/callback" + ], + "allowed_origins": [], + "post_logout_redirect_uri": "", + "session_lifetime": 2592000, + "idle_timeout": 86400, + "multiple_sessions": true, + "password_min_length": 10, + "revoke_on_password_change": true, + "allow_subaddresses": false, + "signup_policy": "anyone", + "allowed_email_domains": [] + } + } + } + } + } }, - "refresh_token": { - "type": "string", - "description": "Refresh token paired with the access token." + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" }, - "expires_in": { - "type": "integer", - "description": "Lifetime of the access token in seconds (default 86400).", - "example": 86400 + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" }, - "organization": { - "$ref": "#/components/schemas/OrganizationSummary" + "404": { + "$ref": "#/components/responses/SetupNotFound" }, - "application": { - "allOf": [ - { - "$ref": "#/components/schemas/ApplicationCredentialsSummary" - } - ], - "description": "The organization's live application (`mode: live`): the credentials a production integration ships with. Every check created with its key is billed from the organization's balance." + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_configuration(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" }, - "sandbox_application": { - "allOf": [ - { - "$ref": "#/components/schemas/ApplicationCredentialsSummary" - } - ], - "nullable": true, - "description": "The organization's sandbox application (`mode: sandbox`). Use its `api_key` to build and test the integration for free: every check is mocked and never billed. Switch to the live `application` key to go live." + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getConfiguration(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" }, - "2fa_required": { - "type": "boolean", - "description": "Present and `true` when the account already has an authenticator app or a passkey. The response then carries `temp_token` instead of tokens and application keys.", - "example": true + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetConfiguration(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" }, - "temp_token": { - "type": "string", - "description": "Short-lived token for the second-factor step, sent only with `2fa_required`. It is not an access token." + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getConfiguration(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" }, - "has_authenticator": { - "type": "boolean", - "description": "With `2fa_required`: whether the account has an authenticator app." + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getConfiguration('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" }, - "has_passkeys": { - "type": "boolean", - "description": "With `2fa_required`: whether the account has a passkey." + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_configuration(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetConfigurationAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" } - } + ] }, - "LoginRequest": { - "type": "object", - "required": [ - "email", - "password" + "patch": { + "tags": [ + "Setup" ], - "properties": { - "email": { - "type": "string", - "format": "email", - "example": "you@yourdomain.com" + "summary": "Update the Authentication setup", + "description": "Changes the settings in the body: callback URLs, allowed origins, session lifetime, idle timeout, password rules and the sign-up policy. Send only the fields you change. `enabled` is refused with `{\"enabled\": \"follows_product\"}` because the product's state decides it, and an unknown field with `{\"\": \"unknown_field\"}`.", + "operationId": "authentication_update_configuration", + "security": [ + { + "ManagementGrant": [] }, - "password": { - "type": "string", - "example": "MyStr0ng!Pass" + { + "ManagementApiKey": [] } - } - }, - "LoginResponse": { - "type": "object", - "properties": { - "access_token": { - "type": "string", - "description": "RS256-signed JWT. Use as `Authorization: Bearer ` for Account Management endpoints." + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "update_configuration", + "auth": "api_key", + "server": true + }, + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupConfigurationUpdate" + }, + "examples": { + "InvitedSignUp": { + "summary": "One-week sessions, sign-up by invitation only", + "value": { + "session_lifetime": 604800, + "signup_policy": "invited" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The configuration as it now stands.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupConfiguration" + }, + "examples": { + "InvitedSignUp": { + "summary": "Configuration after setting a 7-day session and invited sign-up", + "value": { + "enabled": true, + "publishable_key": "pk_test_ZG9jcy1kZW1vLnNhbmRib3guYXV0aC5kaWRpdC5tZQ", + "methods": [ + { + "name": "code", + "enabled": true, + "credential_source": null + }, + { + "name": "google", + "enabled": true, + "credential_source": "didit_test", + "configured": true, + "client_id": "didit-test-google", + "callback_uri": "https://auth.didit.test/social/google/callback" + }, + { + "name": "password", + "enabled": false, + "credential_source": null + } + ], + "didit_test_credentials": { + "google": true, + "microsoft": true, + "apple": true, + "github": true + }, + "redirect_uris": [ + "https://app.example.com/auth/callback" + ], + "allowed_origins": [], + "post_logout_redirect_uri": "", + "session_lifetime": 604800, + "idle_timeout": 86400, + "multiple_sessions": true, + "password_min_length": 10, + "revoke_on_password_change": true, + "allow_subaddresses": false, + "signup_policy": "invited", + "allowed_email_domains": [] + } + } + } + } + } }, - "refresh_token": { - "type": "string" + "400": { + "$ref": "#/components/responses/SetupValidation" }, - "expires_in": { - "type": "integer", - "description": "Lifetime of the access token in seconds (default 86400).", - "example": 86400 + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" }, - "message": { - "type": "string", - "example": "Login successful" - } + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.update_configuration(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n session_lifetime=604800,\n signup_policy=\"invited\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.updateConfiguration(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n {\n session_lifetime: 604800,\n signup_policy: \"invited\",\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.UpdateConfiguration(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.SetupConfigurationUpdate{\n\tSessionLifetime: didit.Int(604800),\n\tSignupPolicy: didit.Some(didit.SetupConfigurationUpdateSignupPolicy(\"invited\")),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\nimport me.didit.types.SetupConfigurationUpdate;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().updateConfiguration(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", SetupConfigurationUpdate.builder()\n .sessionLifetime(604800L)\n .signupPolicy(SetupConfigurationUpdate.SignupPolicy.of(\"invited\"))\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->updateConfiguration('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', [\n 'session_lifetime' => 604800,\n 'signup_policy' => 'invited',\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.update_configuration(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n session_lifetime: 604800,\n signup_policy: \"invited\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.UpdateConfigurationAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", new SetupConfigurationUpdate\n{\n SessionLifetime = 604800,\n SignupPolicy = new SetupConfigurationUpdateSignupPolicy(\"invited\"),\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/methods/{name}/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_id", + "in": "path", + "required": true, + "description": "UUID of the organization that owns the application.", + "schema": { + "type": "string", + "format": "uuid", + "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + } + }, + { + "name": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "put": { + "tags": [ + "Setup" + ], + "summary": "Enable or disable a sign-in method", + "description": "Enables or disables one method; `enabled` is required. A social method (`google`, `microsoft`, `apple`, `github`) takes either your own `credentials` or `credential_source: \"didit_test\"`, which uses Didit's own sandbox app and is refused on a live application with `{\"credential_source\": \"sandbox_only\"}`; a test app the application cannot use answers `{\"credential_source\": \"unavailable\"}`. `phone` takes the `workflow_id` of a phone verification workflow. `credentials`, `workflow_id` or `credential_source` on a method that does not use them answer `not_supported`, turning off a method that is always on answers `{\"enabled\": \"always_on\"}`, and an unknown method answers `{\"name\": \"method_unavailable\"}`.", + "operationId": "authentication_set_method", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "set_method", + "auth": "api_key", + "server": true + }, + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "description": "The method: `password`, `code`, `magic`, `phone`, `passkey`, `google`, `microsoft`, `apple`, `github`, `sso` or `wallet`.", + "schema": { + "type": "string", + "enum": [ + "password", + "code", + "magic", + "phone", + "passkey", + "google", + "microsoft", + "apple", + "github", + "sso", + "wallet" + ], + "example": "code" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupMethodUpdate" + }, + "examples": { + "EmailCode": { + "summary": "Email code", + "value": { + "enabled": true + } + }, + "OwnGoogleApp": { + "summary": "Your own Google app", + "value": { + "enabled": true, + "credentials": { + "client_id": "1234.apps.googleusercontent.com", + "client_secret": "GOCSPX-..." + } + } + }, + "DiditTestGoogle": { + "summary": "Didit's test app, on a sandbox application only", + "value": { + "enabled": true, + "credential_source": "didit_test" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The method as it now stands. The secret is never returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupMethodResult" + }, + "examples": { + "SetupMethodResult": { + "summary": "Didit's test Google app on a sandbox application", + "value": { + "name": "google", + "enabled": true, + "credential_source": "didit_test", + "configured": true, + "client_id": "didit-test-google", + "callback_uri": "https://auth.didit.test/social/google/callback" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.set_method(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n \"code\",\n enabled=True,\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.setMethod(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n \"code\",\n {\n enabled: true,\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.SetMethod(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", \"code\", didit.SetupMethodUpdate{\n\tEnabled: true,\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\nimport me.didit.types.SetupMethodUpdate;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().setMethod(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", \"code\", SetupMethodUpdate.builder()\n .enabled(true)\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->setMethod('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', 'code', [\n 'enabled' => true,\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.set_method(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n \"code\",\n enabled: true\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.SetMethodAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", \"code\", new SetupMethodUpdate\n{\n Enabled = true,\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/onboarding/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_id", + "in": "path", + "required": true, + "description": "UUID of the organization that owns the application.", + "schema": { + "type": "string", + "format": "uuid", + "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + } + }, + { + "name": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "Get the onboarding progress", + "description": "Returns which setup steps are done, whether the application is ready and how people sign in. A grant or a key gets progress only: the console session's sample sign-in details, which name an end user, are left out.", + "operationId": "authentication_get_onboarding", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_onboarding", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "The onboarding progress.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupOnboarding" + }, + "examples": { + "SetupOnboarding": { + "summary": "Response", + "value": { + "completed": [ + "methods", + "redirects" + ], + "ready": false, + "sign_in_ui": "hosted", + "test_status": "not_started" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_onboarding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getOnboarding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetOnboarding(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getOnboarding(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getOnboarding('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_onboarding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetOnboardingAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + }, + "patch": { + "tags": [ + "Setup" + ], + "summary": "Update the onboarding progress", + "description": "Records a setup step: skip the test sign-in, skip the user import, or choose the hosted sign-in page or your own screens. An empty body answers `{\"non_field_errors\": [\"empty_update\"]}`.", + "operationId": "authentication_update_onboarding", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "update_onboarding", + "auth": "api_key", + "server": true + }, + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupOnboardingUpdate" + }, + "examples": { + "OwnScreens": { + "summary": "Build your own sign-in screens", + "value": { + "sign_in_ui": "own" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The onboarding progress after the change.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupOnboarding" + }, + "examples": { + "OwnScreens": { + "summary": "Onboarding after choosing your own sign-in screens", + "value": { + "completed": [ + "methods", + "redirects" + ], + "ready": false, + "sign_in_ui": "own", + "test_status": "not_started" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.update_onboarding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n sign_in_ui=\"own\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.updateOnboarding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n {\n sign_in_ui: \"own\",\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.UpdateOnboarding(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.SetupOnboardingUpdate{\n\tSignInUI: didit.Some(didit.SetupOnboardingUpdateSignInUI(\"own\")),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\nimport me.didit.types.SetupOnboardingUpdate;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().updateOnboarding(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", SetupOnboardingUpdate.builder()\n .signInUi(SetupOnboardingUpdate.SignInUi.of(\"own\"))\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->updateOnboarding('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', [\n 'sign_in_ui' => 'own',\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.update_onboarding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n sign_in_ui: \"own\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.UpdateOnboardingAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", new SetupOnboardingUpdate\n{\n SignInUi = new SetupOnboardingUpdateSignInUi(\"own\"),\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/settings/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_id", + "in": "path", + "required": true, + "description": "UUID of the organization that owns the application.", + "schema": { + "type": "string", + "format": "uuid", + "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + } + }, + { + "name": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "Get the application settings", + "description": "Returns agent access, organizations, the MFA policy, the default member role and the webhook events switched off.", + "operationId": "authentication_get_settings", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_settings", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "The application settings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupSettings" + }, + "examples": { + "SetupSettings": { + "summary": "Default settings of a new application", + "value": { + "sign_in_ui": "hosted", + "agent_humans_only": false, + "agents_enabled": false, + "agent_scopes": [], + "agent_lifetime": 604800, + "agent_idle_timeout": 7200, + "agent_approval": "passkey", + "organizations_enabled": false, + "mfa_policy": "organization_admins", + "default_member_role": "member", + "webhook_events_disabled": [] + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_settings(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getSettings(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetSettings(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getSettings(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getSettings('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_settings(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetSettingsAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + }, + "patch": { + "tags": [ + "Setup" + ], + "summary": "Update the application settings", + "description": "Changes the settings in the body. `agent_humans_only` needs a person: a named API key answers 403 `owner_or_admin_required`, and turning it on needs an owner or admin with an enrolled passkey.", + "operationId": "authentication_update_settings", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "update_settings", + "auth": "api_key", + "server": true + }, + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupSettingsUpdate" + }, + "examples": { + "EveryoneMfa": { + "summary": "Require MFA for everyone", + "value": { + "mfa_policy": "everyone", + "default_member_role": "member" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The settings as they now stand.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupSettings" + }, + "examples": { + "EveryoneMfa": { + "summary": "Settings after requiring two factors for everyone", + "value": { + "sign_in_ui": "hosted", + "agent_humans_only": false, + "agents_enabled": false, + "agent_scopes": [], + "agent_lifetime": 604800, + "agent_idle_timeout": 7200, + "agent_approval": "passkey", + "organizations_enabled": false, + "mfa_policy": "everyone", + "default_member_role": "member", + "webhook_events_disabled": [] + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.update_settings(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n mfa_policy=\"everyone\",\n default_member_role=\"member\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.updateSettings(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n {\n mfa_policy: \"everyone\",\n default_member_role: \"member\",\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.UpdateSettings(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.SetupSettingsUpdate{\n\tMFAPolicy: didit.Some(didit.SetupSettingsUpdateMFAPolicy(\"everyone\")),\n\tDefaultMemberRole: didit.Some(didit.SetupSettingsUpdateDefaultMemberRole(\"member\")),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\nimport me.didit.types.SetupSettingsUpdate;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().updateSettings(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", SetupSettingsUpdate.builder()\n .mfaPolicy(SetupSettingsUpdate.MfaPolicy.of(\"everyone\"))\n .defaultMemberRole(SetupSettingsUpdate.DefaultMemberRole.of(\"member\"))\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->updateSettings('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', [\n 'mfa_policy' => 'everyone',\n 'default_member_role' => 'member',\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.update_settings(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n mfa_policy: \"everyone\",\n default_member_role: \"member\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.UpdateSettingsAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", new SetupSettingsUpdate\n{\n MfaPolicy = new SetupSettingsUpdateMfaPolicy(\"everyone\"),\n DefaultMemberRole = new SetupSettingsUpdateDefaultMemberRole(\"member\"),\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/branding/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_id", + "in": "path", + "required": true, + "description": "UUID of the organization that owns the application.", + "schema": { + "type": "string", + "format": "uuid", + "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + } + }, + { + "name": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "Get the hosted pages' branding", + "description": "Returns the application's brand as the hosted pages show it, the texts set per language, the legal links and the hosted URL.", + "operationId": "authentication_get_branding", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_branding", + "auth": "api_key", + "server": true + }, + "parameters": [ + { + "name": "language", + "in": "query", + "required": false, + "description": "Language of the default texts and the previews: an unsupported code falls back to `en`.", + "schema": { + "type": "string", + "example": "es" + } + } + ], + "responses": { + "200": { + "description": "The branding.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupBranding" + }, + "examples": { + "SetupBranding": { + "summary": "Branding of a sandbox application with the organization's own look", + "value": { + "brand": { + "source": "customization", + "name": "Docs Demo", + "logo": null, + "logo_dark": null, + "brand_colour": "#2567FF", + "brand_colour_dark": "#6191FF", + "button_text_colour": "#FFFFFF", + "background": "#FFFFFF", + "background_dark": "#0E0F12", + "corner_radius": 12, + "font": "Inter", + "theme": "device" + }, + "texts": {}, + "defaults": { + "sign_in_title": "Sign in to Docs Demo (Sandbox)", + "subtitle": "Welcome back! Sign in to continue.", + "sign_up_title": "Create your Docs Demo (Sandbox) account" + }, + "terms_url": null, + "privacy_url": null, + "languages": [ + "en", + "es", + "fr", + "de", + "ja" + ], + "badge": { + "visible": true, + "plan": "free", + "early_access": false + }, + "hosted_url": "https://docs-demo.sandbox.auth.didit.me/sign-in" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_branding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getBranding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetBranding(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.AuthenticationSetupGetBrandingParams{})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getBranding(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getBranding('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_branding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetBrandingAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + }, + "patch": { + "tags": [ + "Setup" + ], + "summary": "Update the hosted pages' branding", + "description": "Changes the hosted pages' own texts and legal links. The logo, colours and fonts are read-only here: they come from Customization. A language Didit does not publish answers `{\"\": \"unsupported_language\"}`, and a legal link that is not `https://` answers `https_required`.", + "operationId": "authentication_update_branding", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "update_branding", + "auth": "api_key", + "server": true + }, + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupBrandingUpdate" + }, + "examples": { + "LegalLinks": { + "summary": "Terms and privacy links", + "value": { + "terms_url": "https://example.com/terms", + "privacy_url": "https://example.com/privacy" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The branding as it now stands.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupBranding" + }, + "examples": { + "LegalLinks": { + "summary": "Branding after adding the legal links", + "value": { + "brand": { + "source": "customization", + "name": "Docs Demo", + "logo": null, + "logo_dark": null, + "brand_colour": "#2567FF", + "brand_colour_dark": "#6191FF", + "button_text_colour": "#FFFFFF", + "background": "#FFFFFF", + "background_dark": "#0E0F12", + "corner_radius": 12, + "font": "Inter", + "theme": "device" + }, + "texts": {}, + "defaults": { + "sign_in_title": "Sign in to Docs Demo (Sandbox)", + "subtitle": "Welcome back! Sign in to continue.", + "sign_up_title": "Create your Docs Demo (Sandbox) account" + }, + "terms_url": "https://example.com/terms", + "privacy_url": "https://example.com/privacy", + "languages": [ + "en", + "es", + "fr", + "de", + "ja" + ], + "badge": { + "visible": true, + "plan": "free", + "early_access": false + }, + "hosted_url": "https://docs-demo.sandbox.auth.didit.me/sign-in" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.update_branding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n terms_url=\"https://example.com/terms\",\n privacy_url=\"https://example.com/privacy\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.updateBranding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n {\n terms_url: \"https://example.com/terms\",\n privacy_url: \"https://example.com/privacy\",\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.UpdateBranding(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.SetupBrandingUpdate{\n\tTermsURL: didit.String(\"https://example.com/terms\"),\n\tPrivacyURL: didit.String(\"https://example.com/privacy\"),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\nimport me.didit.types.SetupBrandingUpdate;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().updateBranding(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", SetupBrandingUpdate.builder()\n .termsUrl(\"https://example.com/terms\")\n .privacyUrl(\"https://example.com/privacy\")\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->updateBranding('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', [\n 'terms_url' => 'https://example.com/terms',\n 'privacy_url' => 'https://example.com/privacy',\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.update_branding(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n terms_url: \"https://example.com/terms\",\n privacy_url: \"https://example.com/privacy\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.UpdateBrandingAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", new SetupBrandingUpdate\n{\n TermsUrl = \"https://example.com/terms\",\n PrivacyUrl = \"https://example.com/privacy\",\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/emails/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_id", + "in": "path", + "required": true, + "description": "UUID of the organization that owns the application.", + "schema": { + "type": "string", + "format": "uuid", + "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + } + }, + { + "name": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "List the sign-in emails", + "description": "Lists the emails Didit Authentication sends, with the ones this application sends switched on and their subject in the language you ask for. The senders in the response are read-only here: they come from Customization.", + "operationId": "authentication_get_emails", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_emails", + "auth": "api_key", + "server": true + }, + "parameters": [ + { + "name": "language", + "in": "query", + "required": false, + "description": "Language of the subjects and previews: an unsupported code falls back to `en`.", + "schema": { + "type": "string", + "example": "en" + } + } + ], + "responses": { + "200": { + "description": "The emails and senders.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupEmails" + }, + "examples": { + "SetupEmails": { + "summary": "Response", + "value": { + "senders": { + "email": { + "name": "Example", + "email": "no-reply@example.com", + "header": "Example ", + "own": false + }, + "sms": { + "name": null + } + }, + "emails": [ + { + "key": "code", + "icon": "mail", + "sent": true, + "enabled": true, + "subject": "Your Example code: 123456" + } + ], + "language": "en" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_emails(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getEmails(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetEmails(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.AuthenticationSetupGetEmailsParams{})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getEmails(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getEmails('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_emails(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetEmailsAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/emails/{key}/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_id", + "in": "path", + "required": true, + "description": "UUID of the organization that owns the application.", + "schema": { + "type": "string", + "format": "uuid", + "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + } + }, + { + "name": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "Preview a sign-in email", + "description": "Returns one email as it renders, with sample codes and links. An invitation preview uses a sample organization for a grant or named key. A console session can see a customer organization's name. The address of a console member is left out for a grant or a key, which have no mailbox. An email Authentication does not send answers `{\"error\": \"email_not_sent_by_authentication\"}`.", + "operationId": "authentication_get_email", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_email", + "auth": "api_key", + "server": true + }, + "parameters": [ + { + "name": "key", + "in": "path", + "required": true, + "description": "The email: `code`, `magic`, `reset`, `device`, `invite`, `org`, `agent` or `agentoff`.", + "schema": { + "type": "string", + "enum": [ + "code", + "magic", + "reset", + "device", + "invite", + "org", + "agent", + "agentoff" + ], + "example": "code" + } + } + ], + "responses": { + "200": { + "description": "The rendered email.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupEmail" + }, + "examples": { + "SetupEmail": { + "summary": "Response", + "value": { + "key": "code", + "from": "Example ", + "to": "", + "subject": "Your Example code: 123456", + "html": "...", + "enabled": true + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_email(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n \"code\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getEmail(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n \"code\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetEmail(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", \"code\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getEmail(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", \"code\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getEmail('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', 'code');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_email(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n \"code\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetEmailAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", \"code\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/protection/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_id", + "in": "path", + "required": true, + "description": "UUID of the organization that owns the application.", + "schema": { + "type": "string", + "format": "uuid", + "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + } + }, + { + "name": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "Get bot protection", + "description": "Returns whether protection is on, each policy's mode and the last 14 days of detections. Console sessions, grants and named keys receive the same aggregate counters.", + "operationId": "authentication_get_protection", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_protection", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "Protection settings and their counters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupProtection" + }, + "examples": { + "SetupProtection": { + "summary": "Response", + "value": { + "enabled": true, + "breached_password_check": true, + "protections": [ + { + "key": "bots", + "mode": "block", + "available": true, + "counts": { + "log": 0, + "challenge": 12, + "block": 3 + }, + "accounts": 9 + } + ], + "daily": [ + { + "date": "2026-11-19", + "protection": "bots", + "action": "block", + "count": 3 + } + ], + "challenges_daily": [ + { + "date": "2026-11-19", + "passed": 10, + "failed": 2 + } + ], + "period_days": 14, + "calendar_month": { + "start": "2026-11-01T00:00:00Z", + "as_of": "2026-11-20T10:00:00Z", + "previous_start": "2026-10-01T00:00:00Z", + "previous_end": "2026-11-01T00:00:00Z", + "protections": [ + { + "key": "bots", + "counts": { + "log": 0, + "challenge": 4, + "block": 1 + }, + "previous_counts": { + "log": 0, + "challenge": 2, + "block": 0 + }, + "counts_delta": { + "log": 0, + "challenge": 2, + "block": 1 + }, + "accounts": 4, + "previous_accounts": 2, + "accounts_delta": 2 + } + ], + "challenges": { + "passed": 4, + "failed": 1, + "previous_passed": 2, + "previous_failed": 0 + } + }, + "attack_mode": { + "active": false, + "started_at": null, + "expires_at": null + }, + "selfie_available": false + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_protection(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getProtection(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetProtection(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getProtection(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getProtection('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_protection(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetProtectionAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + }, + "patch": { + "tags": [ + "Setup" + ], + "summary": "Update bot protection", + "description": "Turns protection on or off, turns the breached-password check on or off and sets a mode per policy. The policies you send are merged into the stored ones. An unknown policy answers `{\"policies\": [\"unknown_protection\"]}`.", + "operationId": "authentication_update_protection", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "update_protection", + "auth": "api_key", + "server": true + }, + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupProtectionUpdate" + }, + "examples": { + "BlockBots": { + "summary": "Block bots and challenge credential stuffing", + "value": { + "enabled": true, + "policies": { + "bots": "block", + "stuffing": "challenge", + "brute": "challenge" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Protection settings as they now stand.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupProtection" + }, + "examples": { + "SetupProtection": { + "summary": "Response", + "value": { + "enabled": true, + "breached_password_check": true, + "protections": [ + { + "key": "bots", + "mode": "block", + "available": true, + "counts": { + "log": 0, + "challenge": 12, + "block": 3 + }, + "accounts": 9 + } + ], + "daily": [ + { + "date": "2026-11-19", + "protection": "bots", + "action": "block", + "count": 3 + } + ], + "challenges_daily": [ + { + "date": "2026-11-19", + "passed": 10, + "failed": 2 + } + ], + "period_days": 14, + "calendar_month": { + "start": "2026-11-01T00:00:00Z", + "as_of": "2026-11-20T10:00:00Z", + "previous_start": "2026-10-01T00:00:00Z", + "previous_end": "2026-11-01T00:00:00Z", + "protections": [ + { + "key": "bots", + "counts": { + "log": 0, + "challenge": 4, + "block": 1 + }, + "previous_counts": { + "log": 0, + "challenge": 2, + "block": 0 + }, + "counts_delta": { + "log": 0, + "challenge": 2, + "block": 1 + }, + "accounts": 4, + "previous_accounts": 2, + "accounts_delta": 2 + } + ], + "challenges": { + "passed": 4, + "failed": 1, + "previous_passed": 2, + "previous_failed": 0 + } + }, + "attack_mode": { + "active": false, + "started_at": null, + "expires_at": null + }, + "selfie_available": false + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.update_protection(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n enabled=True,\n policies={\"bots\": \"block\", \"stuffing\": \"challenge\", \"brute\": \"challenge\"},\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.updateProtection(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n {\n enabled: true,\n policies: { bots: \"block\", stuffing: \"challenge\", brute: \"challenge\" },\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.UpdateProtection(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.SetupProtectionUpdate{\n\tEnabled: didit.Bool(true),\n\tPolicies: didit.Some(map[string]string{\"bots\": \"block\", \"stuffing\": \"challenge\", \"brute\": \"challenge\"}),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import java.util.Map;\nimport me.didit.Didit;\nimport me.didit.types.SetupProtectionUpdate;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().updateProtection(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", SetupProtectionUpdate.builder()\n .enabled(true)\n .policies(Map.of(\"bots\", \"block\", \"stuffing\", \"challenge\", \"brute\", \"challenge\"))\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->updateProtection('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', [\n 'enabled' => true,\n 'policies' => ['bots' => 'block', 'stuffing' => 'challenge', 'brute' => 'challenge'],\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.update_protection(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n enabled: true,\n policies: { bots: \"block\", stuffing: \"challenge\", brute: \"challenge\" }\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Collections.Generic;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.UpdateProtectionAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", new SetupProtectionUpdate\n{\n Enabled = true,\n Policies = new Dictionary { [\"bots\"] = \"block\", [\"stuffing\"] = \"challenge\", [\"brute\"] = \"challenge\" },\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/verified/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_id", + "in": "path", + "required": true, + "description": "UUID of the organization that owns the application.", + "schema": { + "type": "string", + "format": "uuid", + "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + } + }, + { + "name": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "Get verified sign-in", + "description": "Returns the sign-up verification level, the step-up rules with this month's counters, the claims your tokens carry and the verification workflows behind them.", + "operationId": "authentication_get_verified", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_verified", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "Verified sign-in settings and counters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupVerified" + }, + "examples": { + "SetupVerified": { + "summary": "Response", + "value": { + "signup_level": "liveness", + "signup": { + "checks": 41, + "passed": 39, + "failed": 2 + }, + "rules": [ + { + "rule": "payout", + "enabled": true, + "method": "selfie", + "threshold": "500.00", + "currency": "EUR", + "checks": 6, + "passed": 5, + "failed": 1 + } + ], + "claims": [ + "over_18", + "given_name", + "country" + ], + "available_claims": [ + "over_18", + "over_21", + "given_name", + "family_name", + "birthdate", + "nationality", + "country", + "document_verified", + "liveness" + ], + "workflows": { + "liveness": null, + "selfie": null, + "full_id": null + }, + "wallet": { + "enabled": false, + "sign_ins": 0, + "people": 0 + }, + "since": "2026-11-01T00:00:00Z" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_verified(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getVerified(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetVerified(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getVerified(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getVerified('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_verified(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetVerifiedAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + }, + "patch": { + "tags": [ + "Setup" + ], + "summary": "Update verified sign-in", + "description": "Sets the sign-up verification level, the step-up rules, the claims your tokens carry and the workflows the rules use. Each supplied rule updates only the fields you send for its kind. Omitted rules keep their settings. Two rules of the same kind answer `duplicate_rule`, and `threshold` or `currency` on a rule other than `payout` answer `not_supported`.", + "operationId": "authentication_update_verified", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "update_verified", + "auth": "api_key", + "server": true + }, + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupVerifiedUpdate" + }, + "examples": { + "SelfieOnPayout": { + "summary": "A selfie before a payout over EUR 500", + "value": { + "signup_level": "liveness", + "rules": [ + { + "rule": "payout", + "enabled": true, + "method": "selfie", + "threshold": "500.00", + "currency": "EUR" + } + ], + "claims": [ + "over_18", + "given_name", + "country" + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Verified sign-in settings as they now stand.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupVerified" + }, + "examples": { + "SetupVerified": { + "summary": "Response", + "value": { + "signup_level": "liveness", + "signup": { + "checks": 41, + "passed": 39, + "failed": 2 + }, + "rules": [ + { + "rule": "payout", + "enabled": true, + "method": "selfie", + "threshold": "500.00", + "currency": "EUR", + "checks": 6, + "passed": 5, + "failed": 1 + } + ], + "claims": [ + "over_18", + "given_name", + "country" + ], + "available_claims": [ + "over_18", + "over_21", + "given_name", + "family_name", + "birthdate", + "nationality", + "country", + "document_verified", + "liveness" + ], + "workflows": { + "liveness": null, + "selfie": null, + "full_id": null + }, + "wallet": { + "enabled": false, + "sign_ins": 0, + "people": 0 + }, + "since": "2026-11-01T00:00:00Z" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.update_verified(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n signup_level=\"liveness\",\n rules=[{\n \"rule\": \"payout\",\n \"enabled\": True,\n \"method\": \"selfie\",\n \"threshold\": \"500.00\",\n \"currency\": \"EUR\",\n }],\n claims=[\"over_18\", \"given_name\", \"country\"],\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.updateVerified(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n {\n signup_level: \"liveness\",\n rules: [{\n rule: \"payout\",\n enabled: true,\n method: \"selfie\",\n threshold: \"500.00\",\n currency: \"EUR\",\n }],\n claims: [\"over_18\", \"given_name\", \"country\"],\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.UpdateVerified(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.SetupVerifiedUpdate{\n\tSignupLevel: didit.Some(didit.SetupVerifiedUpdateSignupLevel(\"liveness\")),\n\tRules: didit.Some([]didit.SetupVerifiedUpdateRules{{\n\t\tRule: \"payout\",\n\t\tEnabled: didit.Bool(true),\n\t\tMethod: didit.Some(didit.SetupVerifiedUpdateRulesMethod(\"selfie\")),\n\t\tThreshold: didit.String(\"500.00\"),\n\t\tCurrency: didit.String(\"EUR\"),\n\t}}),\n\tClaims: didit.Some([]string{\"over_18\", \"given_name\", \"country\"}),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import java.util.List;\nimport me.didit.Didit;\nimport me.didit.types.SetupVerifiedUpdate;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().updateVerified(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", SetupVerifiedUpdate.builder()\n .signupLevel(SetupVerifiedUpdate.SignupLevel.of(\"liveness\"))\n .rules(List.of(SetupVerifiedUpdate.Rules.builder()\n .rule(SetupVerifiedUpdate.Rules.Rule.of(\"payout\"))\n .enabled(true)\n .method(SetupVerifiedUpdate.Rules.Method.of(\"selfie\"))\n .threshold(\"500.00\")\n .currency(\"EUR\")\n .build()))\n .claims(List.of(\"over_18\", \"given_name\", \"country\"))\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->updateVerified('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', [\n 'signup_level' => 'liveness',\n 'rules' => [[\n 'rule' => 'payout',\n 'enabled' => true,\n 'method' => 'selfie',\n 'threshold' => '500.00',\n 'currency' => 'EUR',\n ]],\n 'claims' => ['over_18', 'given_name', 'country'],\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.update_verified(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n signup_level: \"liveness\",\n rules: [{\n rule: \"payout\",\n enabled: true,\n method: \"selfie\",\n threshold: \"500.00\",\n currency: \"EUR\",\n }],\n claims: [\"over_18\", \"given_name\", \"country\"]\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.UpdateVerifiedAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", new SetupVerifiedUpdate\n{\n SignupLevel = new SetupVerifiedUpdateSignupLevel(\"liveness\"),\n Rules = new SetupVerifiedUpdateRules[]\n {\n new()\n {\n Rule = \"payout\",\n Enabled = true,\n Method = new SetupVerifiedUpdateRulesMethod(\"selfie\"),\n Threshold = \"500.00\",\n Currency = \"EUR\",\n },\n },\n Claims = new string[] { \"over_18\", \"given_name\", \"country\" },\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/domain/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_id", + "in": "path", + "required": true, + "description": "UUID of the organization that owns the application.", + "schema": { + "type": "string", + "format": "uuid", + "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + } + }, + { + "name": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "Get the hosted domain", + "description": "Returns the hosted origin, the issuer and passkey relying party that follow from it, and the custom domain with its DNS record, certificate and status. `origin` names the custom domain once it is active and the default host until then.", + "operationId": "authentication_get_domain", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_domain", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "The hosted domain.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupDomain" + }, + "examples": { + "SetupDomain": { + "summary": "Response", + "value": { + "host": "demo.auth.didit.me", + "default_origin": "https://demo.auth.didit.me", + "origin": "https://login.example.com", + "hosted_url": "https://login.example.com/sign-in", + "issuer": "https://login.example.com", + "passkey_rp_id": "login.example.com", + "sandbox": false, + "sandbox_origin": "https://demo.sandbox.auth.didit.me", + "custom_domains_available": true, + "custom_domain": { + "domain": "login.example.com", + "status": "verified", + "failure_reason": "", + "dns_record": { + "type": "CNAME", + "name": "login.example.com", + "value": "demo.auth.didit.me" + }, + "certificate": { + "status": "issued", + "expires_at": "2027-02-18T00:00:00Z" + }, + "dns_checked_at": "2026-11-20T10:00:00Z", + "verified_at": "2026-11-20T10:05:00Z", + "activated_at": null + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getDomain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetDomain(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getDomain(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getDomain('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetDomainAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + }, + "put": { + "tags": [ + "Setup" + ], + "summary": "Claim a custom domain", + "description": "Claims a domain for the application's hosted pages: `pending` until DNS points at the application's default host. Claiming a second domain while one is claimed, verified or active answers 409 `{\"domain\": \"custom_domain_exists\"}`; an apex, an IP or one of Didit's own hosts answers `{\"domain\": \"invalid_domain\"}`.", + "operationId": "authentication_set_domain", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "set_domain", + "auth": "api_key", + "server": true + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupDomainRequest" + }, + "examples": { + "LoginDomain": { + "summary": "Claim a sign-in domain", + "value": { + "domain": "login.example.com" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The domain as it now stands.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupDomain" + }, + "examples": { + "SetupDomain": { + "summary": "Response", + "value": { + "host": "demo.auth.didit.me", + "default_origin": "https://demo.auth.didit.me", + "origin": "https://login.example.com", + "hosted_url": "https://login.example.com/sign-in", + "issuer": "https://login.example.com", + "passkey_rp_id": "login.example.com", + "sandbox": false, + "sandbox_origin": "https://demo.sandbox.auth.didit.me", + "custom_domains_available": true, + "custom_domain": { + "domain": "login.example.com", + "status": "verified", + "failure_reason": "", + "dns_record": { + "type": "CNAME", + "name": "login.example.com", + "value": "demo.auth.didit.me" + }, + "certificate": { + "status": "issued", + "expires_at": "2027-02-18T00:00:00Z" + }, + "dns_checked_at": "2026-11-20T10:00:00Z", + "verified_at": "2026-11-20T10:05:00Z", + "activated_at": null + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "409": { + "$ref": "#/components/responses/SetupConflict" + }, + "503": { + "$ref": "#/components/responses/SetupUnavailable" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.set_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n domain=\"login.example.com\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.setDomain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n {\n domain: \"login.example.com\",\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.SetDomain(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.SetupDomainRequest{\n\tDomain: \"login.example.com\",\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\nimport me.didit.types.SetupDomainRequest;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().setDomain(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", SetupDomainRequest.builder()\n .domain(\"login.example.com\")\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->setDomain('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', [\n 'domain' => 'login.example.com',\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.set_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n domain: \"login.example.com\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.SetDomainAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", new SetupDomainRequest\n{\n Domain = \"login.example.com\",\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + }, + "delete": { + "tags": [ + "Setup" + ], + "summary": "Remove the custom domain", + "description": "Removes the custom domain and returns the application to its default host. When the edge does not confirm the removal the call answers 503 and the domain stays claimed; retry it.", + "operationId": "authentication_remove_domain", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "remove_domain", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "The hosted domain without a custom domain.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupDomain" + }, + "examples": { + "Removed": { + "summary": "Domain after removing the custom domain: the default origin serves again", + "value": { + "host": "demo.auth.didit.me", + "default_origin": "https://demo.auth.didit.me", + "origin": "https://demo.auth.didit.me", + "hosted_url": "https://demo.auth.didit.me/sign-in", + "issuer": "https://demo.auth.didit.me", + "passkey_rp_id": "demo.auth.didit.me", + "sandbox": false, + "sandbox_origin": "https://demo.sandbox.auth.didit.me", + "custom_domains_available": true, + "custom_domain": null + } + } + } + } + } + }, + "503": { + "$ref": "#/components/responses/SetupUnavailable" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.remove_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.removeDomain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.RemoveDomain(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().removeDomain(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->removeDomain('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.remove_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.RemoveDomainAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/domain/verify/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_id", + "in": "path", + "required": true, + "description": "UUID of the organization that owns the application.", + "schema": { + "type": "string", + "format": "uuid", + "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + } + }, + { + "name": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "post": { + "tags": [ + "Setup" + ], + "summary": "Verify the custom domain", + "description": "Checks the DNS record now and asks the edge for the certificate. A missing or mismatched DNS record returns 200 with a `failure_reason`. Read `domain/` afterwards for the result: `verified` once the certificate is issued, `failed` with a `failure_reason` when it cannot be issued.", + "operationId": "authentication_verify_domain", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "verify_domain", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "The domain as it now stands.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupDomain" + }, + "examples": { + "SetupDomain": { + "summary": "Response", + "value": { + "host": "demo.auth.didit.me", + "default_origin": "https://demo.auth.didit.me", + "origin": "https://login.example.com", + "hosted_url": "https://login.example.com/sign-in", + "issuer": "https://login.example.com", + "passkey_rp_id": "login.example.com", + "sandbox": false, + "sandbox_origin": "https://demo.sandbox.auth.didit.me", + "custom_domains_available": true, + "custom_domain": { + "domain": "login.example.com", + "status": "verified", + "failure_reason": "", + "dns_record": { + "type": "CNAME", + "name": "login.example.com", + "value": "demo.auth.didit.me" + }, + "certificate": { + "status": "issued", + "expires_at": "2027-02-18T00:00:00Z" + }, + "dns_checked_at": "2026-11-20T10:00:00Z", + "verified_at": "2026-11-20T10:05:00Z", + "activated_at": null + } + } + } + } + } + } + }, + "400": { + "description": "Set a custom domain before verifying it.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FieldErrors" + }, + "example": { + "domain": "custom_domain_missing" + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "description": "The domain is already in use (`domain_in_use`), changed during verification (`custom_domain_changed`), or needs to be removed and added again after a failed certificate (`custom_domain_failed`). With a management grant or a named key, `{\"detail\": \"product_disabled\"}` means Authentication is turned off for the application; a person turns it on in the console.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FieldErrors" + }, + "examples": { + "Conflict": { + "summary": "The domain cannot change in its current state", + "value": { + "domain": "domain_in_use" + } + }, + "ProductDisabled": { + "summary": "Authentication is turned off for the application", + "value": { + "detail": "product_disabled" + } + } + } + } + } + }, + "429": { + "$ref": "#/components/responses/RateLimited" + }, + "503": { + "description": "Domain verification is unavailable. Retry when DNS or the custom domain service is available.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FieldErrors" + }, + "example": { + "domain": "dns_unavailable" + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.verify_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.verifyDomain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.VerifyDomain(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().verifyDomain(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->verifyDomain('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.verify_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.VerifyDomainAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/domain/activate/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_id", + "in": "path", + "required": true, + "description": "UUID of the organization that owns the application.", + "schema": { + "type": "string", + "format": "uuid", + "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + } + }, + { + "name": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "post": { + "tags": [ + "Setup" + ], + "summary": "Activate the custom domain", + "description": "Makes the verified domain the application's canonical origin, which moves the issuer and the passkey relying party to it. After activation, `/session/` immediately rejects access tokens issued under the old host. Refresh them to obtain access tokens for the new issuer.", + "operationId": "authentication_activate_domain", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "activate_domain", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "The domain as it now stands.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupDomain" + }, + "examples": { + "SetupDomain": { + "summary": "Response", + "value": { + "host": "demo.auth.didit.me", + "default_origin": "https://demo.auth.didit.me", + "origin": "https://login.example.com", + "hosted_url": "https://login.example.com/sign-in", + "issuer": "https://login.example.com", + "passkey_rp_id": "login.example.com", + "sandbox": false, + "sandbox_origin": "https://demo.sandbox.auth.didit.me", + "custom_domains_available": true, + "custom_domain": { + "domain": "login.example.com", + "status": "verified", + "failure_reason": "", + "dns_record": { + "type": "CNAME", + "name": "login.example.com", + "value": "demo.auth.didit.me" + }, + "certificate": { + "status": "issued", + "expires_at": "2027-02-18T00:00:00Z" + }, + "dns_checked_at": "2026-11-20T10:00:00Z", + "verified_at": "2026-11-20T10:05:00Z", + "activated_at": null + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "description": "Verify the custom domain before activating it. With a management grant or a named key, `{\"detail\": \"product_disabled\"}` means Authentication is turned off for the application; a person turns it on in the console.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FieldErrors" + }, + "examples": { + "Conflict": { + "summary": "The domain cannot change in its current state", + "value": { + "domain": "custom_domain_not_verified" + } + }, + "ProductDisabled": { + "summary": "Authentication is turned off for the application", + "value": { + "detail": "product_disabled" + } + } + } + } + } + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.activate_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.activateDomain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.ActivateDomain(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().activateDomain(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->activateDomain('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.activate_domain(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.ActivateDomainAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + }, + "/organizations/{organization_id}/applications/{application_id}/authentication/native-apps/": { + "servers": [ + { + "url": "https://apx.didit.me/auth/v2", + "description": "The management API, on the account host. Setup routes are not served on the application's issuer." + } + ], + "parameters": [ + { + "name": "organization_id", + "in": "path", + "required": true, + "description": "UUID of the organization that owns the application.", + "schema": { + "type": "string", + "format": "uuid", + "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + } + }, + { + "name": "application_id", + "in": "path", + "required": true, + "description": "UUID of the application: live or sandbox. A named key configures its own application only.", + "schema": { + "type": "string", + "format": "uuid", + "example": "7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d" + } + } + ], + "get": { + "tags": [ + "Setup" + ], + "summary": "Get the native apps", + "description": "Returns the iOS app IDs and Android apps that share this application's passkeys, as the association files at the hosted origin publish them.", + "operationId": "authentication_get_native_apps", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "get_native_apps", + "auth": "api_key", + "server": true + }, + "responses": { + "200": { + "description": "The native apps.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupNativeApps" + }, + "examples": { + "SetupNativeApps": { + "summary": "Response", + "value": { + "ios_app_ids": [ + "A1B2C3D4E5.com.example.app" + ], + "android_apps": [ + { + "package_name": "com.example.app", + "sha256_cert_fingerprints": [ + "AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89" + ] + } + ] + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.get_native_apps(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.getNativeApps(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.GetNativeApps(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().getNativeApps(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->getNativeApps('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d');\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.get_native_apps(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\"\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.GetNativeAppsAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\");\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + }, + "put": { + "tags": [ + "Setup" + ], + "summary": "Update the native apps", + "description": "Replaces the lists of iOS app IDs and Android apps. A malformed entry answers a field error in the shape `{\"ios_app_ids\": [\"This field is invalid.\"]}`; duplicates are dropped.", + "operationId": "authentication_update_native_apps", + "security": [ + { + "ManagementGrant": [] + }, + { + "ManagementApiKey": [] + } + ], + "x-didit-sdk": { + "resource": "authentication_setup", + "method": "update_native_apps", + "auth": "api_key", + "server": true + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupNativeAppsUpdate" + }, + "examples": { + "OneAppPerPlatform": { + "summary": "One iOS app and one Android app", + "value": { + "ios_app_ids": [ + "A1B2C3D4E5.com.example.app" + ], + "android_apps": [ + { + "package_name": "com.example.app", + "sha256_cert_fingerprints": [ + "AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89" + ] + } + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The native apps as they now stand.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetupNativeApps" + }, + "examples": { + "SetupNativeApps": { + "summary": "Response", + "value": { + "ios_app_ids": [ + "A1B2C3D4E5.com.example.app" + ], + "android_apps": [ + { + "package_name": "com.example.app", + "sha256_cert_fingerprints": [ + "AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89" + ] + } + ] + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/SetupValidation" + }, + "401": { + "$ref": "#/components/responses/SetupNotAuthenticated" + }, + "403": { + "$ref": "#/components/responses/SetupPermissionDenied" + }, + "404": { + "$ref": "#/components/responses/SetupNotFound" + }, + "409": { + "$ref": "#/components/responses/SetupProductDisabled" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.authentication_setup.update_native_apps(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n ios_app_ids=[\"A1B2C3D4E5.com.example.app\"],\n android_apps=[{\n \"package_name\": \"com.example.app\",\n \"sha256_cert_fingerprints\": [\"AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89\"],\n }],\n)\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.authenticationSetup.updateNativeApps(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n {\n ios_app_ids: [\"A1B2C3D4E5.com.example.app\"],\n android_apps: [{\n package_name: \"com.example.app\",\n sha256_cert_fingerprints: [\"AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89\"],\n }],\n },\n);\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.AuthenticationSetup.UpdateNativeApps(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", didit.SetupNativeAppsUpdate{\n\tIosAppIDs: []string{\"A1B2C3D4E5.com.example.app\"},\n\tAndroidApps: []didit.SetupAndroidAppParam{{\n\t\tPackageName: \"com.example.app\",\n\t\tSha256CertFingerprints: []string{\"AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89\"},\n\t}},\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import java.util.List;\nimport me.didit.Didit;\nimport me.didit.types.SetupAndroidApp;\nimport me.didit.types.SetupNativeAppsUpdate;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.authenticationSetup().updateNativeApps(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", SetupNativeAppsUpdate.builder()\n .iosAppIds(List.of(\"A1B2C3D4E5.com.example.app\"))\n .androidApps(List.of(SetupAndroidApp.builder()\n .packageName(\"com.example.app\")\n .sha256CertFingerprints(List.of(\"AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89\"))\n .build()))\n .build());\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "authenticationSetup->updateNativeApps('a1b2c3d4-5678-90ab-cdef-111111111111', '7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d', [\n 'ios_app_ids' => ['A1B2C3D4E5.com.example.app'],\n 'android_apps' => [[\n 'package_name' => 'com.example.app',\n 'sha256_cert_fingerprints' => ['AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89'],\n ]],\n]);\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.authentication_setup.update_native_apps(\n \"a1b2c3d4-5678-90ab-cdef-111111111111\",\n \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\",\n ios_app_ids: [\"A1B2C3D4E5.com.example.app\"],\n android_apps: [{\n package_name: \"com.example.app\",\n sha256_cert_fingerprints: [\"AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89\"],\n }]\n)\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.AuthenticationSetup.UpdateNativeAppsAsync(\"a1b2c3d4-5678-90ab-cdef-111111111111\", \"7b0a6c2e-3f41-4c9a-8d55-1e2f3a4b5c6d\", new SetupNativeAppsUpdate\n{\n IosAppIds = new string[] { \"A1B2C3D4E5.com.example.app\" },\n AndroidApps = new SetupAndroidApp[]\n {\n new()\n {\n PackageName = \"com.example.app\",\n Sha256CertFingerprints = new string[] { \"AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89\" },\n },\n },\n});\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } + } + }, + "components": { + "securitySchemes": { + "BearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT", + "description": "RS256-signed JWT `access_token` returned by `POST /programmatic/login/` or `POST /programmatic/verify-email/`. Send as `Authorization: Bearer `. Default lifetime is 86400 seconds (24h). This token is only valid against the Account Management endpoints on `apx.didit.me/auth/v2`. The verification API (`verification.didit.me/v3`) uses the long-lived `api_key` as `x-api-key` instead." + }, + "ManagementApiKey": { + "type": "apiKey", + "in": "header", + "name": "x-api-key", + "description": "A **named** application API key whose scopes give `authentication` the level the request needs: `read` to read the setup, `write` to read and change it. It configures its own application only, within its IP allowlist and expiry. The application's primary secret, an unscoped key and a token from `POST /programmatic/login` are refused with 403." + }, + "ManagementGrant": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT", + "description": "An OAuth grant an owner approved for this application, carrying `didit:management`: the MCP connector's grant (`Log in with Didit`) or the device-code grant an owner without a password approves. Send it as `Authorization: Bearer `. The grant keeps the scopes, organizations and role chosen at consent, so it cannot reach an organization or an action the person did not approve. A grant limited to `didit:verification` is refused with 403." + } + }, + "schemas": { + "RegisterRequest": { + "type": "object", + "required": [ + "email", + "password" + ], + "properties": { + "email": { + "type": "string", + "format": "email", + "description": "Any valid email address (personal, work, alias). Used as the unique account identifier.", + "example": "you@yourdomain.com" + }, + "password": { + "type": "string", + "minLength": 8, + "description": "Minimum 8 characters. Must contain at least one uppercase letter (`A-Z`), one lowercase letter (`a-z`), one digit (`0-9`), and one special character from `!@#$%^&*()_+-=[]{}|;:,.<>?`. Validation reports one failed rule at a time.", + "example": "MyStr0ng!Pass" + } + } + }, + "RegisterResponse": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable confirmation that the verification code was sent.", + "example": "Registration successful. Check your email for the verification code." + }, + "email": { + "type": "string", + "format": "email", + "description": "The email the verification code was sent to.", + "example": "you@yourdomain.com" + } + } + }, + "VerifyEmailRequest": { + "type": "object", + "required": [ + "email", + "code" + ], + "properties": { + "email": { + "type": "string", + "format": "email", + "description": "Email used during `POST /programmatic/register/`.", + "example": "you@yourdomain.com" + }, + "code": { + "type": "string", + "minLength": 6, + "maxLength": 6, + "description": "6-character alphanumeric code from the verification email. Codes expire 10 minutes after the most recent code was sent.", + "example": "A3K9F2" + } + } + }, + "VerifyEmailResponse": { + "type": "object", + "properties": { + "access_token": { + "type": "string", + "description": "RS256-signed JWT. Use as `Authorization: Bearer ` for Account Management endpoints on `apx.didit.me/auth/v2`." + }, + "refresh_token": { + "type": "string", + "description": "Refresh token paired with the access token." + }, + "expires_in": { + "type": "integer", + "description": "Lifetime of the access token in seconds (default 86400).", + "example": 86400 + }, + "organization": { + "$ref": "#/components/schemas/OrganizationSummary" + }, + "application": { + "allOf": [ + { + "$ref": "#/components/schemas/ApplicationCredentialsSummary" + } + ], + "description": "The organization's live application (`mode: live`): the credentials a production integration ships with. Every check created with its key is billed from the organization's balance." + }, + "sandbox_application": { + "allOf": [ + { + "$ref": "#/components/schemas/ApplicationCredentialsSummary" + } + ], + "nullable": true, + "description": "The organization's sandbox application (`mode: sandbox`). Use its `api_key` to build and test the integration for free: every check is mocked and never billed. Switch to the live `application` key to go live." + }, + "2fa_required": { + "type": "boolean", + "description": "Present and `true` when the account already has an authenticator app or a passkey. The response then carries `temp_token` instead of tokens and application keys.", + "example": true + }, + "temp_token": { + "type": "string", + "description": "Short-lived token for the second-factor step, sent only with `2fa_required`. It is not an access token." + }, + "has_authenticator": { + "type": "boolean", + "description": "With `2fa_required`: whether the account has an authenticator app." + }, + "has_passkeys": { + "type": "boolean", + "description": "With `2fa_required`: whether the account has a passkey." + } + } + }, + "LoginRequest": { + "type": "object", + "required": [ + "email", + "password" + ], + "properties": { + "email": { + "type": "string", + "format": "email", + "example": "you@yourdomain.com" + }, + "password": { + "type": "string", + "example": "MyStr0ng!Pass" + } + } + }, + "LoginResponse": { + "type": "object", + "properties": { + "access_token": { + "type": "string", + "description": "RS256-signed JWT. Use as `Authorization: Bearer ` for Account Management endpoints." + }, + "refresh_token": { + "type": "string" + }, + "expires_in": { + "type": "integer", + "description": "Lifetime of the access token in seconds (default 86400).", + "example": 86400 + }, + "message": { + "type": "string", + "example": "Login successful" + } + } + }, + "Organization": { + "type": "object", + "properties": { + "uuid": { + "type": "string", + "format": "uuid", + "description": "Use as `{org_id}` on the application endpoints.", + "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + }, + "name": { + "type": "string", + "description": "Display name of the organization.", + "example": "developer" + }, + "contact_email": { + "type": "string", + "format": "email", + "description": "Primary contact email for the organization.", + "example": "developer@gmail.com" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2025-06-01T10:00:00Z" + } + } + }, + "OrganizationSummary": { + "type": "object", + "description": "Minimal organization shape returned inline by `POST /programmatic/verify-email/`.", + "properties": { + "uuid": { + "type": "string", + "format": "uuid", + "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + }, + "name": { + "type": "string", + "example": "developer" + } + } + }, + "ApplicationCredentialsSummary": { + "type": "object", + "description": "Minimal application shape returned inline by `POST /programmatic/verify-email/`. Persist the `api_key` immediately.", + "properties": { + "uuid": { + "type": "string", + "format": "uuid", + "example": "b2c3d4e5-6789-01bc-defg-222222222222" + }, + "name": { + "type": "string", + "example": "developer" + }, + "client_id": { + "type": "string", + "example": "S9LIYGSoWNuGMLHsvEt9dQ" + }, + "api_key": { + "type": "string", + "description": "Use this as `x-api-key` on every verification API call. New keys start with `sk_live_` (live application) or `sk_test_` (sandbox application), followed by 43 URL-safe characters (letters, digits, `-` and `_`). Keys created before this format have no prefix and keep working unchanged.", + "example": "sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + "data_location": { + "$ref": "#/components/schemas/ApplicationDataLocation" + }, + "mode": { + "type": "string", + "enum": [ + "live", + "sandbox" + ], + "description": "The application's environment. A `live` application bills every verification session and check created with its key. A `sandbox` application mocks every check and is never billed, so it is where you test (each sandbox application can create 500 test sessions every 24 hours). Read this field to pick the application: never infer the environment from the name.", + "example": "live" + } + } + }, + "Application": { + "type": "object", + "description": "Full application record. `uuid`, `client_id`, and `api_key` never change after creation. `data_location` doesn't either, except once on the live application created with your organization, before it is used (see the update request).", + "properties": { + "uuid": { + "type": "string", + "format": "uuid", + "description": "Application UUID. Use as `{app_id}` in subsequent calls.", + "example": "b2c3d4e5-6789-01bc-defg-222222222222" + }, + "name": { + "type": "string", + "description": "Application display name shown in the Didit console.", + "example": "Acme Production App" + }, + "client_id": { + "type": "string", + "description": "Public client identifier, safe to embed in OAuth-style flows.", + "example": "S9LIYGSoWNuGMLHsvEt9dQ" + }, + "api_key": { + "type": "string", + "description": "Long-lived secret (also called `client_secret`). Use as the `x-api-key` header for every call to `https://verification.didit.me/v3/...` (sessions, workflows, AML, etc.). Treat as a credential; never expose client-side. New keys start with `sk_live_` (live application) or `sk_test_` (sandbox application), followed by 43 URL-safe characters (letters, digits, `-` and `_`). Keys created before this format have no prefix and keep working unchanged. For 72 hours after you recovered your account, list, retrieve and update return an empty string here instead of the key.", + "example": "sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + }, + "website_url": { + "type": "string", + "nullable": true, + "description": "Website or app URL associated with this application.", + "example": "https://acme.example" + }, + "redirect_uris": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Allowed redirect URIs for OAuth-style and verification redirect flows.", + "example": [ + "https://acme.example/callback" + ] + }, + "terms_url": { + "type": "string", + "nullable": true, + "description": "Terms of service URL shown in the verification flow.", + "example": "https://acme.example/terms" + }, + "privacy_url": { + "type": "string", + "nullable": true, + "description": "Privacy policy URL shown in the verification flow.", + "example": "https://acme.example/privacy" + }, + "description": { + "type": "string", + "nullable": true, + "description": "Internal description for the application (not shown to end users)." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2025-06-01T10:00:00Z" + }, + "data_location": { + "$ref": "#/components/schemas/ApplicationDataLocation" + }, + "products": { + "type": "array", + "readOnly": true, + "description": "The application's products. Always all three, in this order: `identity`, `transactions`, `authentication`. A new application has `identity` enabled with every module on, and `transactions` and `authentication` disabled. Read-only: a `products` key in a create or update body is ignored.", + "items": { + "$ref": "#/components/schemas/ApplicationProduct" + }, + "example": [ + { + "product": "identity", + "status": "enabled", + "modules": { + "user_verification": true, + "business_verification": true, + "case_management": true + } + }, + { + "product": "transactions", + "status": "disabled", + "modules": { + "travel_rule": true, + "case_management": true + } + }, + { + "product": "authentication", + "status": "disabled", + "modules": {} + } + ] + }, + "mode": { + "type": "string", + "enum": [ + "live", + "sandbox" + ], + "description": "The application's environment. A `live` application bills every verification session and check created with its key. A `sandbox` application mocks every check and is never billed, so it is where you test (each sandbox application can create 500 test sessions every 24 hours). Read this field to pick the application: never infer the environment from the name.", + "example": "live", + "readOnly": true + }, + "initiate_login_uri": { + "$ref": "#/components/schemas/ApplicationInitiateLoginURI" + } + } + }, + "ApplicationCreateRequest": { + "type": "object", + "description": "All fields are optional. Sending an empty body creates an application with a default name, in the European Union.", + "properties": { + "name": { + "type": "string", + "description": "Application display name. Defaults to `\" App\"`.", + "example": "Acme Customer App" + }, + "website_url": { + "type": "string", + "description": "Website or app URL associated with this application.", + "example": "https://acme.example" + }, + "redirect_uris": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Allowed redirect URIs for OAuth-style and verification redirect flows.", + "example": [ + "https://acme.example/callback" + ] + }, + "terms_url": { + "type": "string", + "description": "Terms of service URL shown in the verification flow.", + "example": "https://acme.example/terms" + }, + "privacy_url": { + "type": "string", + "description": "Privacy policy URL shown in the verification flow.", + "example": "https://acme.example/privacy" + }, + "description": { + "type": "string", + "description": "Internal description for the application (not shown to end users)." + }, + "data_location": { + "$ref": "#/components/schemas/ApplicationDataLocation" + }, + "initiate_login_uri": { + "$ref": "#/components/schemas/ApplicationInitiateLoginURI" + } + } + }, + "ApplicationUpdateRequest": { + "type": "object", + "description": "PATCH body for application metadata. Send only the fields you want to change; omitted fields are preserved. `uuid`, `client_id`, and `api_key` cannot be updated. `products` is read-only: a `products` key in the body is ignored. `data_location` can't be changed after the application is created: naming the location it already has is accepted, and any other location answers 400. The one exception is the live application created with your organization: the first update that names a `data_location` chooses it, once, while no API key of the application has been used and it has no verification session.", + "properties": { + "name": { + "type": "string", + "description": "Application display name.", + "example": "Acme Production App" + }, + "website_url": { + "type": "string", + "description": "Website or app URL associated with this application.", + "example": "https://app.acme.example" + }, + "redirect_uris": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Allowed redirect URIs for OAuth-style and verification redirect flows.", + "example": [ + "https://acme.example/callback" + ] + }, + "terms_url": { + "type": "string", + "description": "Terms of service URL shown in the verification flow." + }, + "privacy_url": { + "type": "string", + "description": "Privacy policy URL shown in the verification flow." + }, + "description": { + "type": "string", + "description": "Internal description for the application." + }, + "data_location": { + "$ref": "#/components/schemas/ApplicationDataLocation" + }, + "initiate_login_uri": { + "$ref": "#/components/schemas/ApplicationInitiateLoginURI" + } + } + }, + "ApplicationDataLocation": { + "type": "string", + "enum": [ + "eu", + "au", + "mx", + "ae", + "us" + ], + "description": "Where the application's verification data is stored and processed, chosen when the application is created. `eu` is the European Union (Ireland), the default. `au` (Australia, Sydney), `mx` (Mexico), `ae` (United Arab Emirates) and `us` (United States, N. Virginia) are coming soon: a request that names them answers 400 `This data location is not available yet.` An organization's Sandbox application is always in the European Union.", + "example": "eu" + }, + "ValidationError": { + "description": "Validation error body. The intended envelope is a `{field: [\"message\", ...]}` map for field-level errors or a `{detail: \"...\"}` single-key envelope for business-rule errors. A handful of validators (password strength on register, code validity on verify-email) currently respond with a bare array `[\"message\"]` -- known server-side inconsistency. The schema below keeps that bare-array branch so client code generated from this spec deserializes today's responses, but new client code should treat it as the relevant field-keyed form (`{password: [...]}` or `{code: [...]}`) and the server contract will converge on that shape.", + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + }, + "example": { + "email": [ + "Enter a valid email address." + ] + } + }, + { + "type": "object", + "properties": { + "detail": { + "type": "string" + } + }, + "example": { + "detail": "An account with this email already exists." + } + }, + { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "Invalid or expired verification code." + ] + } + ] + }, + "AuthError": { + "type": "object", + "description": "Authentication / authorization / not-found error envelope.", + "properties": { + "detail": { + "type": "string", + "example": "Invalid access token" + } + } + }, + "RateLimitError": { + "type": "object", + "description": "Rate-limit or progressive-lockout response. `wait` is the cooldown in seconds.", + "properties": { + "detail": { + "type": "string", + "example": "Too many login attempts from this IP address. Please wait before trying again." + } + } + }, + "PaginatedOrganizationList": { + "type": "object", + "required": [ + "count", + "next", + "previous", + "results" + ], + "properties": { + "count": { + "type": "integer", + "description": "Total number of organizations." + }, + "next": { + "type": "string", + "format": "uri", + "nullable": true, + "description": "URL of the next page, or `null` on the last page." + }, + "previous": { + "type": "string", + "format": "uri", + "nullable": true, + "description": "URL of the previous page, or `null` on the first page." + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Organization" + } + } + } + }, + "PaginatedApplicationList": { + "type": "object", + "required": [ + "count", + "next", + "previous", + "results" + ], + "properties": { + "count": { + "type": "integer", + "description": "Total number of applications." + }, + "next": { + "type": "string", + "format": "uri", + "nullable": true, + "description": "URL of the next page, or `null` on the last page." + }, + "previous": { + "type": "string", + "format": "uri", + "nullable": true, + "description": "URL of the previous page, or `null` on the first page." + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Application" + } + } + } + }, + "ApplicationProduct": { + "type": "object", + "description": "One product of an application and its state. Read-only: the application endpoints return it and ignore it in a request body.", + "properties": { + "product": { + "type": "string", + "enum": [ + "identity", + "transactions", + "authentication" + ], + "description": "`identity` (Identity verification), `transactions` (Transaction monitoring) or `authentication` (Authentication).", + "example": "identity" + }, + "status": { + "type": "string", + "enum": [ + "enabled", + "early_access", + "disabled" + ], + "description": "Whether the product is on for this application. `early_access` applies only to `authentication`, which Didit turns on for you.", + "example": "enabled" + }, + "modules": { + "type": "object", + "additionalProperties": { + "type": "boolean" + }, + "description": "Module switches of the product, each `true` or `false`. `identity` has `user_verification`, `business_verification` and `case_management`. `transactions` has `travel_rule` and `case_management`. `authentication` has none (`{}`). `case_management` is one setting shown under both `identity` and `transactions`, so it has the same value on both.", + "example": { + "user_verification": true, + "business_verification": true, + "case_management": true + } + } + }, + "required": [ + "product", + "status", + "modules" + ] + }, + "EmailUndeliverableError": { + "type": "object", + "description": "Returned by `POST /programmatic/register/` when the address cannot receive the verification code. The check runs before any account is created or changed, so nothing is left behind.", + "required": [ + "detail", + "code", + "reason" + ], + "properties": { + "detail": { + "type": "string", + "description": "Human-readable message.", + "example": "This email can't receive messages. Please use a different email address." + }, + "code": { + "type": "string", + "enum": [ + "email_undeliverable" + ], + "description": "Always `email_undeliverable`." + }, + "reason": { + "type": "string", + "enum": [ + "invalid_address", + "reserved_domain", + "no_mail_records", + "disposable_domain", + "possible_typo", + "suppressed" + ], + "description": "Why the address was refused: `invalid_address` (not a valid address), `reserved_domain` (a reserved or test domain such as `example.com`), `no_mail_records` (the domain has no mail server), `disposable_domain` (a throwaway mailbox provider), `possible_typo` (a likely misspelling of a common provider; see `suggestion`), `suppressed` (the address previously bounced or complained)." + }, + "suggestion": { + "type": "string", + "description": "The likely intended domain, present only when the domain looks like a typo (for example `gmail.com` for `gmial.com`). The API does not accept a confirmation: register again with the corrected address.", + "example": "gmail.com" + } + } + }, + "RecoveryHoldError": { + "type": "object", + "description": "Returned for 72 hours after the account was recovered (lost sign-in methods were reset). Actions that create organizations, applications or secrets are refused until `until`; read operations keep working.", + "required": [ + "detail", + "code", + "until" + ], + "properties": { + "detail": { + "type": "string", + "example": "This action is on hold because you recovered your account." + }, + "code": { + "type": "string", + "enum": [ + "recovery_hold" + ], + "example": "recovery_hold" + }, + "until": { + "type": "string", + "format": "date-time", + "description": "When the hold ends (ISO 8601). Retry the request after this time.", + "example": "2026-11-04T10:15:00+00:00" + } + } + }, + "SsoRequiredError": { + "type": "object", + "description": "The account belongs to an organization that requires SSO sign-in. No tokens, API keys or organizations are issued; sign in through the organization's SSO in a browser instead.", + "required": [ + "error", + "message", + "organization_name", + "organization_slug", + "sso_url" + ], + "properties": { + "error": { + "type": "string", + "enum": [ + "sso_required" + ], + "example": "sso_required" + }, + "message": { + "type": "string", + "example": "Your organization 'Acme Corp' requires SSO login." + }, + "organization_name": { + "type": "string", + "example": "Acme Corp" + }, + "organization_slug": { + "type": "string", + "example": "acme-corp" + }, + "sso_url": { + "type": "string", + "description": "Path of the organization's SSO sign-in page, relative to the console.", + "example": "/sso/acme-corp" + } + } + }, + "RecoverySetupRequiredError": { + "type": "object", + "description": "The account was recovered and has no sign-in method set up yet. No tokens are issued; a one-time link to set up a new method was emailed to the account's address. Open it, set up the method, then log in again.", + "required": [ + "recovery_setup_required", + "setup_link_sent", + "message", + "code" + ], + "properties": { + "recovery_setup_required": { + "type": "boolean", + "example": true + }, + "setup_link_sent": { + "type": "boolean", + "example": true + }, + "message": { + "type": "string", + "example": "You recovered your account. Open the link we emailed you to set up a new sign-in method." + }, + "code": { + "type": "string", + "enum": [ + "recovery_setup_required" + ], + "example": "recovery_setup_required" + } + } + }, + "ServiceUnavailableError": { + "type": "object", + "description": "The request could not be completed right now and nothing was changed. Retry it in a moment.", + "properties": { + "detail": { + "type": "string", + "example": "We couldn't confirm that this application is unused. Try again in a moment." + }, + "code": { + "type": "string", + "example": "data_location_check_unavailable" + } + } + }, + "ApplicationInitiateLoginURI": { + "type": "string", + "maxLength": 2048, + "default": "", + "example": "https://acme.example/login", + "description": "Application sign-in URL for an admin-sent sign-in link. Optional; an empty string disables sending. A nonempty value must use HTTPS and the exact hostname of website_url (subdomains must match), with no userinfo, query, fragment or whitespace and no port other than 443. The server also revalidates the saved URI when website_url changes; update or clear initiate_login_uri in the same PATCH if needed. The hosted handoff adds iss and login_hint, but creates no session or tokens. See /authentication/sign-in-methods#admin-sent-sign-in-link." + }, + "ConsoleIdentityActionRequest": { + "type": "object", + "additionalProperties": false, + "required": [ + "action" + ], + "description": "Console-only action. reset_mfa deletes TOTP, passkeys and recovery codes, invalidates pending challenges, revokes sessions and agent grants, and queues a notice and audit when anything changes. It leaves the password unchanged. send_sign_in_link sends only to the identity email and requires initiate_login_uri. send_password_reset uses the existing 30-minute password-reset flow; it is limited to once per minute per identity. Status actions return the identity; reset and send actions return the corresponding result.", + "properties": { + "action": { + "type": "string", + "enum": [ + "block", + "unblock", + "unlock", + "revoke_sessions", + "send_password_reset", + "reset_mfa", + "send_sign_in_link" + ], + "description": "Identity action to perform." + }, + "notify_users": { + "type": "boolean", + "default": false, + "description": "Only block and unblock accept true. Emails the person when their blocked status changes. Repeating an unchanged status does not send another notice. Requires an email address." + } + }, + "example": { + "action": "reset_mfa" + } + }, + "ConsoleBulkIdentityActionRequest": { + "type": "object", + "additionalProperties": false, + "required": [ + "action", + "ids" + ], + "description": "Console-only bulk action. Each identity is handled independently. send_password_reset is single-identity only. Duplicate IDs or an invalid request reject the entire request before processing.", + "properties": { + "action": { + "type": "string", + "enum": [ + "block", + "unblock", + "unlock", + "revoke_sessions", + "reset_mfa", + "send_sign_in_link" + ], + "description": "Action applied to each identity." + }, + "ids": { + "type": "array", + "minItems": 1, + "maxItems": 100, + "uniqueItems": true, + "items": { + "type": "string", + "format": "uuid" + }, + "description": "One to 100 distinct identity IDs in this application." + }, + "notify_users": { + "type": "boolean", + "default": false, + "description": "Only block and unblock accept true. Emails the person when their blocked status changes. Repeating an unchanged status does not send another notice. Requires an email address." + } + }, + "example": { + "action": "reset_mfa", + "ids": [ + "00000000-0000-4000-8000-000000000001" + ] + } + }, + "ConsoleMFAResetResult": { + "type": "object", + "required": [ + "status", + "requires_sign_in_link" + ], + "description": "Successful console MFA reset. A repeated reset with nothing remaining to reset returns the same result without duplicate notices or audit events. An identity without email cannot be reset.", + "properties": { + "status": { + "type": "string", + "enum": [ + "applied" + ] + }, + "requires_sign_in_link": { + "type": "boolean", + "description": "True when the person has no usable password. Offer a sign-in link after resetting MFA so they can sign in and enroll a new factor." + } + }, + "example": { + "status": "applied", + "requires_sign_in_link": true + } + }, + "ConsoleSignInLinkResult": { + "type": "object", + "required": [ + "status", + "expires_in" + ], + "description": "Console sign-in email sent. Never contains the link or token. Missing application URI returns HTTP 400 with error initiate_login_uri_required. An identity without email or a blocked identity is rejected. Rate limits return 429 and delivery failure returns 503.", + "properties": { + "status": { + "type": "string", + "enum": [ + "sent" + ] + }, + "expires_in": { + "type": "integer", + "enum": [ + 900 + ], + "description": "Single-use handoff lifetime in seconds; the handoff does not authenticate the person." + } + }, + "example": { + "status": "sent", + "expires_in": 900 + } + }, + "ConsoleBulkIdentityActionResult": { + "type": "object", + "required": [ + "id", + "status" + ], + "description": "Per-identity result. Successful sign-in email uses sent, not applied. Missing identities, including identities from another application, return not_found. An action-level error returns invalid_request; error is included for failed sign-in-link actions only.", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "status": { + "type": "string", + "enum": [ + "applied", + "sent", + "not_found", + "invalid_request" + ] + }, + "requires_sign_in_link": { + "type": "boolean", + "description": "Present only for a successful reset_mfa." + }, + "expires_in": { + "type": "integer", + "enum": [ + 900 + ], + "description": "Present only for a successful send_sign_in_link." + }, + "error": { + "type": "string", + "description": "Sign-in-link failure code, such as initiate_login_uri_required, identity_has_no_email, identity_blocked, rate_limited or delivery_unavailable." + } + } + }, + "ConsoleBulkIdentityActionResponse": { + "type": "object", + "required": [ + "results" + ], + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ConsoleBulkIdentityActionResult" + }, + "description": "One result per requested identity, in request order. Check each status even when the HTTP response is 200." + } + }, + "example": { + "results": [ + { + "id": "00000000-0000-4000-8000-000000000001", + "status": "applied", + "requires_sign_in_link": true + } + ] + } + }, + "Detail": { + "type": "object", + "required": [ + "detail" + ], + "properties": { + "detail": { + "type": "string", + "example": "invalid_token" + } } }, - "Organization": { + "FieldErrors": { + "title": "Field errors", + "type": "object", + "description": "Validation errors by field. A value is a list of messages, or a single code (`unknown_field`, `invalid_redirect_uri`). `non_field_errors` holds rules across fields.", + "additionalProperties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "SetupAndroidApp": { + "title": "Android app", "type": "object", + "required": [ + "package_name", + "sha256_cert_fingerprints" + ], "properties": { - "uuid": { - "type": "string", - "format": "uuid", - "description": "Use as `{org_id}` on the application endpoints.", - "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + "package_name": { + "type": "string" + }, + "sha256_cert_fingerprints": { + "type": "array", + "maxItems": 5, + "items": { + "type": "string" + } + } + } + }, + "SetupBrand": { + "title": "Brand", + "type": "object", + "description": "The brand as Customization sets it. Read-only here.", + "properties": { + "source": { + "type": "string" }, "name": { + "type": "string" + }, + "logo": { "type": "string", - "description": "Display name of the organization.", - "example": "developer" + "nullable": true }, - "contact_email": { + "logo_dark": { "type": "string", - "format": "email", - "description": "Primary contact email for the organization.", - "example": "developer@gmail.com" + "nullable": true }, - "created_at": { + "brand_colour": { + "type": "string" + }, + "brand_colour_dark": { + "type": "string" + }, + "button_text_colour": { + "type": "string" + }, + "background": { + "type": "string" + }, + "background_dark": { + "type": "string" + }, + "corner_radius": { + "type": "integer" + }, + "font": { + "type": "string" + }, + "theme": { "type": "string", - "format": "date-time", - "example": "2025-06-01T10:00:00Z" + "enum": [ + "device" + ] } } }, - "OrganizationSummary": { + "SetupBranding": { + "title": "Hosted pages branding", "type": "object", - "description": "Minimal organization shape returned inline by `POST /programmatic/verify-email/`.", + "required": [ + "brand", + "texts", + "defaults", + "languages", + "badge", + "hosted_url" + ], "properties": { - "uuid": { + "brand": { + "$ref": "#/components/schemas/SetupBrand" + }, + "texts": { + "type": "object", + "description": "The texts this application set, by language code.", + "additionalProperties": { + "$ref": "#/components/schemas/SetupBrandingTexts" + } + }, + "defaults": { + "type": "object", + "description": "Didit's own copy for the language you asked for.", + "properties": { + "sign_in_title": { + "type": "string" + }, + "subtitle": { + "type": "string" + }, + "sign_up_title": { + "type": "string" + } + } + }, + "terms_url": { + "type": "string", + "nullable": true + }, + "privacy_url": { + "type": "string", + "nullable": true + }, + "languages": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The language codes the hosted pages can show." + }, + "badge": { + "type": "object", + "properties": { + "visible": { + "type": "boolean" + }, + "plan": { + "type": "string" + }, + "early_access": { + "type": "boolean" + } + } + }, + "hosted_url": { + "type": "string", + "format": "uri" + } + } + }, + "SetupBrandingTexts": { + "title": "Hosted page texts", + "type": "object", + "description": "The texts of the hosted sign-in, sign-up and subtitle lines. A field left empty falls back to Didit's copy.", + "properties": { + "sign_in_title": { + "type": "string", + "maxLength": 120 + }, + "subtitle": { + "type": "string", + "maxLength": 160 + }, + "sign_up_title": { + "type": "string", + "maxLength": 120 + } + } + }, + "SetupBrandingUpdate": { + "title": "Branding update", + "type": "object", + "description": "Every field is optional. A language Didit does not publish answers `unsupported_language`, and a legal link that is not `https://` answers `https_required`.", + "properties": { + "texts": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/SetupBrandingTexts" + } + }, + "terms_url": { + "type": "string", + "maxLength": 500 + }, + "privacy_url": { + "type": "string", + "maxLength": 500 + } + } + }, + "SetupConfiguration": { + "title": "Authentication configuration", + "type": "object", + "required": [ + "application_id", + "enabled", + "methods", + "didit_test_credentials", + "redirect_uris", + "allowed_origins", + "session_lifetime", + "idle_timeout", + "signup_policy" + ], + "properties": { + "application_id": { + "type": "string", + "format": "uuid" + }, + "publishable_key": { + "type": "string", + "nullable": true, + "description": "`pk_live_` or `pk_test_` followed by the base64url issuer. A public identifier, not a credential; `null` when the hosted origin is not usable yet.", + "example": "pk_live_ZG9jcy1kZW1vLmF1dGguZGlkaXQubWU" + }, + "enabled": { + "type": "boolean", + "description": "Whether Authentication is on for this application. Read-only: it follows the product." + }, + "methods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SetupMethodSummary" + } + }, + "didit_test_credentials": { + "$ref": "#/components/schemas/SetupDiditTestCredentials" + }, + "redirect_uris": { + "type": "array", + "maxItems": 50, + "items": { + "type": "string", + "maxLength": 2048 + }, + "description": "Where `POST authorize/` may send the browser after sign-in. Exact match, and `https://` only on a live application." + }, + "allowed_origins": { + "type": "array", + "maxItems": 50, + "items": { + "type": "string", + "maxLength": 2048 + }, + "description": "Origins allowed to embed or call the hosted pages and the browser SDK. Scheme, host and optional port only." + }, + "post_logout_redirect_uri": { + "type": "string", + "maxLength": 2048, + "description": "Where hosted sign-out sends the browser. Empty for none." + }, + "session_lifetime": { + "type": "integer", + "enum": [ + 86400, + 604800, + 2592000, + 7776000 + ] + }, + "idle_timeout": { + "type": "integer", + "enum": [ + 1800, + 7200, + 86400, + 604800 + ] + }, + "multiple_sessions": { + "type": "boolean", + "description": "`false` signs the person out of their other sessions at each new sign-in." + }, + "password_min_length": { + "type": "integer", + "enum": [ + 8, + 10, + 12, + 14 + ] + }, + "revoke_on_password_change": { + "type": "boolean" + }, + "allow_subaddresses": { + "type": "boolean", + "description": "Accept a `+` in the email's local part." + }, + "signup_policy": { + "type": "string", + "enum": [ + "anyone", + "invited", + "allowed_domains" + ] + }, + "allowed_email_domains": { + "type": "array", + "maxItems": 100, + "items": { + "type": "string", + "maxLength": 253 + }, + "description": "The domains `signup_policy: \"allowed_domains\"` accepts." + } + } + }, + "SetupConfigurationUpdate": { + "title": "Configuration update", + "type": "object", + "description": "Every field is optional; send only what changes. `enabled`, `publishable_key`, `methods` and `didit_test_credentials` are read-only and answer `follows_product` or `unknown_field`.", + "properties": { + "redirect_uris": { + "type": "array", + "maxItems": 50, + "items": { + "type": "string" + } + }, + "allowed_origins": { + "type": "array", + "maxItems": 50, + "items": { + "type": "string" + } + }, + "post_logout_redirect_uri": { + "type": "string" + }, + "session_lifetime": { + "type": "integer", + "enum": [ + 86400, + 604800, + 2592000, + 7776000 + ] + }, + "idle_timeout": { + "type": "integer", + "enum": [ + 1800, + 7200, + 86400, + 604800 + ] + }, + "multiple_sessions": { + "type": "boolean" + }, + "password_min_length": { + "type": "integer", + "enum": [ + 8, + 10, + 12, + 14 + ] + }, + "revoke_on_password_change": { + "type": "boolean" + }, + "allow_subaddresses": { + "type": "boolean" + }, + "signup_policy": { + "type": "string", + "enum": [ + "anyone", + "invited", + "allowed_domains" + ] + }, + "allowed_email_domains": { + "type": "array", + "maxItems": 100, + "items": { + "type": "string" + } + } + } + }, + "SetupCustomDomain": { + "title": "Custom domain", + "type": "object", + "required": [ + "domain", + "status", + "dns_record", + "certificate" + ], + "properties": { + "domain": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "issuing", + "verified", + "active", + "failed" + ] + }, + "failure_reason": { + "type": "string" + }, + "dns_record": { + "type": "object", + "required": [ + "type", + "name", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "CNAME" + ] + }, + "name": { + "type": "string" + }, + "value": { + "type": "string", + "description": "The application's default host the domain points at." + } + } + }, + "certificate": { + "type": "object", + "properties": { + "status": { + "type": "string" + }, + "expires_at": { + "type": "string", + "nullable": true, + "format": "date-time" + } + } + }, + "dns_checked_at": { "type": "string", - "format": "uuid", - "example": "a1b2c3d4-5678-90ab-cdef-111111111111" + "nullable": true, + "format": "date-time" }, - "name": { + "verified_at": { "type": "string", - "example": "developer" + "nullable": true, + "format": "date-time" + }, + "activated_at": { + "type": "string", + "nullable": true, + "format": "date-time" } } }, - "ApplicationCredentialsSummary": { + "SetupDiditTestCredentials": { + "title": "Didit test apps", "type": "object", - "description": "Minimal application shape returned inline by `POST /programmatic/verify-email/`. Persist the `api_key` immediately.", + "description": "Which social providers Didit's own sandbox apps can serve for this application. Every value is `false` on a live application.", "properties": { - "uuid": { - "type": "string", - "format": "uuid", - "example": "b2c3d4e5-6789-01bc-defg-222222222222" - }, - "name": { - "type": "string", - "example": "developer" - }, - "client_id": { - "type": "string", - "example": "S9LIYGSoWNuGMLHsvEt9dQ" + "google": { + "type": "boolean" }, - "api_key": { - "type": "string", - "description": "Use this as `x-api-key` on every verification API call. New keys start with `sk_live_` (live application) or `sk_test_` (sandbox application), followed by 43 URL-safe characters (letters, digits, `-` and `_`). Keys created before this format have no prefix and keep working unchanged.", - "example": "sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + "microsoft": { + "type": "boolean" }, - "data_location": { - "$ref": "#/components/schemas/ApplicationDataLocation" + "apple": { + "type": "boolean" }, - "mode": { - "type": "string", - "enum": [ - "live", - "sandbox" - ], - "description": "The application's environment. A `live` application bills every verification session and check created with its key. A `sandbox` application mocks every check and is never billed, so it is where you test (each sandbox application can create 500 test sessions every 24 hours). Read this field to pick the application: never infer the environment from the name.", - "example": "live" + "github": { + "type": "boolean" } } }, - "Application": { + "SetupDomain": { + "title": "Hosted domain", "type": "object", - "description": "Full application record. `uuid`, `client_id`, and `api_key` never change after creation. `data_location` doesn't either, except once on the live application created with your organization, before it is used (see the update request).", + "required": [ + "host", + "default_origin", + "origin", + "hosted_url", + "issuer", + "passkey_rp_id", + "sandbox", + "custom_domains_available" + ], "properties": { - "uuid": { - "type": "string", - "format": "uuid", - "description": "Application UUID. Use as `{app_id}` in subsequent calls.", - "example": "b2c3d4e5-6789-01bc-defg-222222222222" + "host": { + "type": "string" }, - "name": { + "default_origin": { "type": "string", - "description": "Application display name shown in the Didit console.", - "example": "Acme Production App" + "format": "uri" }, - "client_id": { + "origin": { "type": "string", - "description": "Public client identifier, safe to embed in OAuth-style flows.", - "example": "S9LIYGSoWNuGMLHsvEt9dQ" + "format": "uri", + "description": "The custom domain once it is active, the default origin until then." }, - "api_key": { + "hosted_url": { "type": "string", - "description": "Long-lived secret (also called `client_secret`). Use as the `x-api-key` header for every call to `https://verification.didit.me/v3/...` (sessions, workflows, AML, etc.). Treat as a credential; never expose client-side. New keys start with `sk_live_` (live application) or `sk_test_` (sandbox application), followed by 43 URL-safe characters (letters, digits, `-` and `_`). Keys created before this format have no prefix and keep working unchanged. For 72 hours after you recovered your account, list, retrieve and update return an empty string here instead of the key.", - "example": "sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + "format": "uri" }, - "website_url": { + "issuer": { "type": "string", - "nullable": true, - "description": "Website or app URL associated with this application.", - "example": "https://acme.example" + "format": "uri" }, - "redirect_uris": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Allowed redirect URIs for OAuth-style and verification redirect flows.", - "example": [ - "https://acme.example/callback" - ] - }, - "terms_url": { - "type": "string", - "nullable": true, - "description": "Terms of service URL shown in the verification flow.", - "example": "https://acme.example/terms" + "passkey_rp_id": { + "type": "string" }, - "privacy_url": { - "type": "string", - "nullable": true, - "description": "Privacy policy URL shown in the verification flow.", - "example": "https://acme.example/privacy" + "sandbox": { + "type": "boolean" }, - "description": { + "sandbox_origin": { "type": "string", "nullable": true, - "description": "Internal description for the application (not shown to end users)." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2025-06-01T10:00:00Z" + "format": "uri", + "description": "A live application's sandbox origin, shown beside its own." }, - "data_location": { - "$ref": "#/components/schemas/ApplicationDataLocation" + "custom_domains_available": { + "type": "boolean", + "description": "Whether this deployment can serve a custom domain." }, - "products": { - "type": "array", - "readOnly": true, - "description": "The application's products. Always all three, in this order: `identity`, `transactions`, `authentication`. A new application has `identity` enabled with every module on, and `transactions` and `authentication` disabled. Read-only: a `products` key in a create or update body is ignored.", - "items": { - "$ref": "#/components/schemas/ApplicationProduct" - }, - "example": [ - { - "product": "identity", - "status": "enabled", - "modules": { - "user_verification": true, - "business_verification": true, - "case_management": true - } - }, - { - "product": "transactions", - "status": "disabled", - "modules": { - "travel_rule": true, - "case_management": true - } - }, + "custom_domain": { + "type": "object", + "nullable": true, + "allOf": [ { - "product": "authentication", - "status": "disabled", - "modules": {} + "$ref": "#/components/schemas/SetupCustomDomain" } ] - }, - "mode": { - "type": "string", - "enum": [ - "live", - "sandbox" - ], - "description": "The application's environment. A `live` application bills every verification session and check created with its key. A `sandbox` application mocks every check and is never billed, so it is where you test (each sandbox application can create 500 test sessions every 24 hours). Read this field to pick the application: never infer the environment from the name.", - "example": "live", - "readOnly": true - }, - "initiate_login_uri": { - "$ref": "#/components/schemas/ApplicationInitiateLoginURI" } } }, - "ApplicationCreateRequest": { + "SetupDomainRequest": { + "title": "Custom domain", "type": "object", - "description": "All fields are optional. Sending an empty body creates an application with a default name, in the European Union.", + "required": [ + "domain" + ], "properties": { - "name": { - "type": "string", - "description": "Application display name. Defaults to `\" App\"`.", - "example": "Acme Customer App" - }, - "website_url": { - "type": "string", - "description": "Website or app URL associated with this application.", - "example": "https://acme.example" - }, - "redirect_uris": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Allowed redirect URIs for OAuth-style and verification redirect flows.", - "example": [ - "https://acme.example/callback" - ] - }, - "terms_url": { - "type": "string", - "description": "Terms of service URL shown in the verification flow.", - "example": "https://acme.example/terms" - }, - "privacy_url": { - "type": "string", - "description": "Privacy policy URL shown in the verification flow.", - "example": "https://acme.example/privacy" - }, - "description": { + "domain": { "type": "string", - "description": "Internal description for the application (not shown to end users)." - }, - "data_location": { - "$ref": "#/components/schemas/ApplicationDataLocation" - }, - "initiate_login_uri": { - "$ref": "#/components/schemas/ApplicationInitiateLoginURI" + "maxLength": 253, + "description": "The domain to serve the hosted pages on. It must be a host under a zone: a CNAME cannot sit at an apex.", + "example": "login.example.com" } } }, - "ApplicationUpdateRequest": { + "SetupEmail": { + "title": "Rendered sign-in email", "type": "object", - "description": "PATCH body for application metadata. Send only the fields you want to change; omitted fields are preserved. `uuid`, `client_id`, and `api_key` cannot be updated. `products` is read-only: a `products` key in the body is ignored. `data_location` can't be changed after the application is created: naming the location it already has is accepted, and any other location answers 400. The one exception is the live application created with your organization: the first update that names a `data_location` chooses it, once, while no API key of the application has been used and it has no verification session.", + "required": [ + "key", + "from", + "to", + "subject", + "html", + "enabled" + ], "properties": { - "name": { - "type": "string", - "description": "Application display name.", - "example": "Acme Production App" - }, - "website_url": { - "type": "string", - "description": "Website or app URL associated with this application.", - "example": "https://app.acme.example" - }, - "redirect_uris": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Allowed redirect URIs for OAuth-style and verification redirect flows.", - "example": [ - "https://acme.example/callback" - ] + "key": { + "type": "string" }, - "terms_url": { - "type": "string", - "description": "Terms of service URL shown in the verification flow." + "from": { + "type": "string" }, - "privacy_url": { + "to": { "type": "string", - "description": "Privacy policy URL shown in the verification flow." + "description": "The console member's address. Empty for a grant or a key." }, - "description": { - "type": "string", - "description": "Internal description for the application." + "subject": { + "type": "string" }, - "data_location": { - "$ref": "#/components/schemas/ApplicationDataLocation" + "html": { + "type": "string" }, - "initiate_login_uri": { - "$ref": "#/components/schemas/ApplicationInitiateLoginURI" + "enabled": { + "type": "boolean" } } }, - "ApplicationDataLocation": { - "type": "string", - "enum": [ - "eu", - "au", - "mx", - "ae", - "us" + "SetupEmailSummary": { + "title": "Sign-in email", + "type": "object", + "required": [ + "key", + "sent", + "enabled" ], - "description": "Where the application's verification data is stored and processed, chosen when the application is created. `eu` is the European Union (Ireland), the default. `au` (Australia, Sydney), `mx` (Mexico), `ae` (United Arab Emirates) and `us` (United States, N. Virginia) are coming soon: a request that names them answers 400 `This data location is not available yet.` An organization's Sandbox application is always in the European Union.", - "example": "eu" - }, - "ValidationError": { - "description": "Validation error body. The intended envelope is a `{field: [\"message\", ...]}` map for field-level errors or a `{detail: \"...\"}` single-key envelope for business-rule errors. A handful of validators (password strength on register, code validity on verify-email) currently respond with a bare array `[\"message\"]` -- known server-side inconsistency. The schema below keeps that bare-array branch so client code generated from this spec deserializes today's responses, but new client code should treat it as the relevant field-keyed form (`{password: [...]}` or `{code: [...]}`) and the server contract will converge on that shape.", - "oneOf": [ - { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - }, - "example": { - "email": [ - "Enter a valid email address." - ] - } + "properties": { + "key": { + "type": "string", + "enum": [ + "code", + "magic", + "reset", + "device", + "invite", + "org", + "agent", + "agentoff" + ] + }, + "icon": { + "type": "string" }, - { + "sent": { + "type": "boolean", + "description": "Whether Authentication sends this email at all. `false` for `device`, `agent` and `agentoff`, which are listing placeholders." + }, + "enabled": { + "type": "boolean", + "description": "Whether this application sends it." + }, + "subject": { + "type": "string" + } + } + }, + "SetupEmails": { + "title": "Sign-in emails", + "type": "object", + "required": [ + "senders", + "emails", + "language" + ], + "properties": { + "senders": { "type": "object", + "description": "Read-only: they come from Customization.", "properties": { - "detail": { - "type": "string" + "email": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "header": { + "type": "string" + }, + "own": { + "type": "boolean", + "description": "Whether the application sends from its own verified domain." + } + } + }, + "sms": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + } + } } - }, - "example": { - "detail": "An account with this email already exists." } }, - { + "emails": { "type": "array", "items": { - "type": "string" - }, - "example": [ - "Invalid or expired verification code." - ] + "$ref": "#/components/schemas/SetupEmailSummary" + } + }, + "language": { + "type": "string" } - ] + } }, - "AuthError": { + "SetupMethodResult": { + "title": "Sign-in method", "type": "object", - "description": "Authentication / authorization / not-found error envelope.", + "required": [ + "name", + "enabled" + ], "properties": { - "detail": { + "name": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "credential_source": { "type": "string", - "example": "Invalid access token" + "enum": [ + "own", + "didit_test" + ], + "description": "Returned only for social methods." + }, + "configured": { + "type": "boolean", + "description": "Whether the method can now sign anyone in." + }, + "client_id": { + "type": "string" + }, + "callback_uri": { + "type": "string" } } }, - "RateLimitError": { + "SetupMethodSummary": { + "title": "Sign-in method", "type": "object", - "description": "Rate-limit or progressive-lockout response. `wait` is the cooldown in seconds.", + "description": "One sign-in method. `credential_source` is `null` for a method that holds no social credentials, and `always_on` appears on the methods that are on for every application.", + "required": [ + "name", + "enabled", + "credential_source" + ], "properties": { - "detail": { + "name": { "type": "string", - "example": "Too many login attempts from this IP address. Please wait before trying again." + "enum": [ + "password", + "code", + "magic", + "phone", + "passkey", + "google", + "microsoft", + "apple", + "github", + "sso", + "wallet" + ] + }, + "enabled": { + "type": "boolean" + }, + "credential_source": { + "type": "string", + "nullable": true, + "enum": [ + "own", + "didit_test", + null + ], + "description": "`own` for the application's credentials, `didit_test` for Didit's sandbox app, `null` for a method that takes no social credentials." + }, + "always_on": { + "type": "boolean", + "description": "Present and `true` on a method no application can switch off." + }, + "available": { + "type": "boolean", + "description": "`wallet` only: whether Didit ID Wallet sign-in can be offered." + }, + "configured": { + "type": "boolean", + "description": "Whether the method has the credentials it needs to sign anyone in." + }, + "client_id": { + "type": "string", + "description": "The social client ID in use, or an empty string." + }, + "callback_uri": { + "type": "string", + "description": "The redirect URI to register with the provider; Didit's own broker for `didit_test`." } } }, - "PaginatedOrganizationList": { + "SetupMethodUpdate": { + "title": "Sign-in method update", "type": "object", "required": [ - "count", - "next", - "previous", - "results" + "enabled" ], + "description": "`enabled` is required. `credentials` belongs to a social method, `workflow_id` to `phone`, and `credential_source` to a social method; anywhere else they answer `not_supported`. An unknown field answers `unknown_field`.", "properties": { - "count": { - "type": "integer", - "description": "Total number of organizations." + "enabled": { + "type": "boolean" }, - "next": { + "credentials": { + "$ref": "#/components/schemas/SetupProviderCredentials" + }, + "credential_source": { "type": "string", - "format": "uri", - "nullable": true, - "description": "URL of the next page, or `null` on the last page." + "enum": [ + "own", + "didit_test" + ], + "description": "`didit_test` uses Didit's own sandbox app, and is refused on a live application with `sandbox_only`. Omitted: `own` when you send `credentials`, the stored source otherwise, and `didit_test` for a sandbox application's social method that was never configured." }, - "previous": { + "workflow_id": { "type": "string", - "format": "uri", - "nullable": true, - "description": "URL of the previous page, or `null` on the first page." + "format": "uuid", + "description": "`phone` only: the phone verification workflow whose codes it sends." + } + } + }, + "SetupNativeApps": { + "title": "Native apps", + "type": "object", + "required": [ + "ios_app_ids", + "android_apps" + ], + "properties": { + "ios_app_ids": { + "type": "array", + "maxItems": 10, + "items": { + "type": "string" + }, + "description": "Apple team ID and bundle identifier, as `webcredentials` names an app." }, - "results": { + "android_apps": { "type": "array", + "maxItems": 10, "items": { - "$ref": "#/components/schemas/Organization" + "$ref": "#/components/schemas/SetupAndroidApp" } } } }, - "PaginatedApplicationList": { + "SetupNativeAppsUpdate": { + "title": "Native apps update", "type": "object", "required": [ - "count", - "next", - "previous", - "results" + "ios_app_ids", + "android_apps" ], + "description": "Both lists are replaced. Duplicates are dropped.", "properties": { - "count": { - "type": "integer", - "description": "Total number of applications." - }, - "next": { - "type": "string", - "format": "uri", - "nullable": true, - "description": "URL of the next page, or `null` on the last page." - }, - "previous": { - "type": "string", - "format": "uri", - "nullable": true, - "description": "URL of the previous page, or `null` on the first page." + "ios_app_ids": { + "type": "array", + "maxItems": 10, + "items": { + "type": "string" + } }, - "results": { + "android_apps": { "type": "array", + "maxItems": 10, "items": { - "$ref": "#/components/schemas/Application" + "$ref": "#/components/schemas/SetupAndroidApp" } } } }, - "ApplicationProduct": { + "SetupOnboarding": { + "title": "Onboarding progress", "type": "object", - "description": "One product of an application and its state. Read-only: the application endpoints return it and ignore it in a request body.", + "required": [ + "completed", + "ready", + "sign_in_ui", + "test_status" + ], "properties": { - "product": { + "completed": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "methods", + "redirects", + "import", + "test" + ] + } + }, + "ready": { + "type": "boolean", + "description": "Every setup step is done." + }, + "sign_in_ui": { "type": "string", "enum": [ - "identity", - "transactions", - "authentication" - ], - "description": "`identity` (Identity verification), `transactions` (Transaction monitoring) or `authentication` (Authentication).", - "example": "identity" + "hosted", + "own" + ] }, - "status": { + "test_sign_in": { + "type": "object", + "nullable": true, + "description": "Console session only: the sample sign-in the console shows, naming an end user. Left out for a grant or a key." + }, + "test_status": { "type": "string", "enum": [ - "enabled", - "early_access", - "disabled" - ], - "description": "Whether the product is on for this application. `early_access` applies only to `authentication`, which Didit turns on for you.", - "example": "enabled" + "verified", + "skipped", + "not_started" + ] + } + } + }, + "SetupOnboardingUpdate": { + "title": "Onboarding update", + "type": "object", + "description": "At least one field is required; an empty body answers `{\"non_field_errors\": [\"empty_update\"]}`.", + "properties": { + "test_skipped": { + "type": "boolean" + }, + "import_skipped": { + "type": "boolean" + }, + "sign_in_ui": { + "type": "string", + "enum": [ + "hosted", + "own" + ] + } + } + }, + "SetupProtection": { + "title": "Bot protection", + "type": "object", + "required": [ + "enabled", + "breached_password_check", + "protections", + "period_days" + ], + "properties": { + "enabled": { + "type": "boolean" + }, + "breached_password_check": { + "type": "boolean" + }, + "protections": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SetupProtectionPolicy" + } + }, + "daily": { + "type": "array", + "description": "Detections per day, policy and action.", + "items": { + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date" + }, + "protection": { + "type": "string" + }, + "action": { + "type": "string" + }, + "count": { + "type": "integer" + } + } + } + }, + "challenges_daily": { + "type": "array", + "description": "Extra proofs asked for and how they ended.", + "items": { + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date" + }, + "passed": { + "type": "integer" + }, + "failed": { + "type": "integer" + } + } + } + }, + "period_days": { + "type": "integer", + "enum": [ + 14 + ] + }, + "calendar_month": { + "type": "object", + "description": "This calendar month against the previous one.", + "properties": { + "start": { + "type": "string", + "format": "date-time" + }, + "as_of": { + "type": "string", + "format": "date-time" + }, + "previous_start": { + "type": "string", + "format": "date-time" + }, + "previous_end": { + "type": "string", + "format": "date-time" + }, + "protections": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "counts": { + "type": "object", + "properties": { + "log": { + "type": "integer" + }, + "challenge": { + "type": "integer" + }, + "block": { + "type": "integer" + } + } + }, + "previous_counts": { + "type": "object", + "properties": { + "log": { + "type": "integer" + }, + "challenge": { + "type": "integer" + }, + "block": { + "type": "integer" + } + } + }, + "counts_delta": { + "type": "object", + "properties": { + "log": { + "type": "integer" + }, + "challenge": { + "type": "integer" + }, + "block": { + "type": "integer" + } + } + }, + "accounts": { + "type": "integer" + }, + "previous_accounts": { + "type": "integer" + }, + "accounts_delta": { + "type": "integer" + } + } + } + }, + "challenges": { + "type": "object", + "properties": { + "passed": { + "type": "integer" + }, + "failed": { + "type": "integer" + }, + "previous_passed": { + "type": "integer" + }, + "previous_failed": { + "type": "integer" + } + } + } + } }, - "modules": { + "attack_mode": { "type": "object", - "additionalProperties": { - "type": "boolean" - }, - "description": "Module switches of the product, each `true` or `false`. `identity` has `user_verification`, `business_verification` and `case_management`. `transactions` has `travel_rule` and `case_management`. `authentication` has none (`{}`). `case_management` is one setting shown under both `identity` and `transactions`, so it has the same value on both.", - "example": { - "user_verification": true, - "business_verification": true, - "case_management": true + "required": [ + "active" + ], + "properties": { + "active": { + "type": "boolean" + }, + "started_at": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "expires_at": { + "type": "string", + "nullable": true, + "format": "date-time" + } } + }, + "selfie_available": { + "type": "boolean" } - }, - "required": [ - "product", - "status", - "modules" - ] + } }, - "EmailUndeliverableError": { + "SetupProtectionPolicy": { + "title": "Protection policy", "type": "object", - "description": "Returned by `POST /programmatic/register/` when the address cannot receive the verification code. The check runs before any account is created or changed, so nothing is left behind.", "required": [ - "detail", - "code", - "reason" + "key", + "mode", + "available", + "counts", + "accounts" ], "properties": { - "detail": { - "type": "string", - "description": "Human-readable message.", - "example": "This email can't receive messages. Please use a different email address." - }, - "code": { + "key": { "type": "string", "enum": [ - "email_undeliverable" - ], - "description": "Always `email_undeliverable`." + "bots", + "stuffing", + "brute", + "disposable", + "vpn", + "travel" + ] }, - "reason": { + "mode": { "type": "string", "enum": [ - "invalid_address", - "reserved_domain", - "no_mail_records", - "disposable_domain", - "possible_typo", - "suppressed" - ], - "description": "Why the address was refused: `invalid_address` (not a valid address), `reserved_domain` (a reserved or test domain such as `example.com`), `no_mail_records` (the domain has no mail server), `disposable_domain` (a throwaway mailbox provider), `possible_typo` (a likely misspelling of a common provider; see `suggestion`), `suppressed` (the address previously bounced or complained)." + "off", + "log", + "challenge", + "block" + ] }, - "suggestion": { - "type": "string", - "description": "The likely intended domain, present only when the domain looks like a typo (for example `gmail.com` for `gmial.com`). The API does not accept a confirmation: register again with the corrected address.", - "example": "gmail.com" + "available": { + "type": "boolean", + "description": "`vpn` and `travel` need the IP lookup; `false` when it cannot be attempted." + }, + "counts": { + "type": "object", + "properties": { + "log": { + "type": "integer" + }, + "challenge": { + "type": "integer" + }, + "block": { + "type": "integer" + } + } + }, + "accounts": { + "type": "integer", + "description": "How many people the policy matched in the last 14 days." } } }, - "RecoveryHoldError": { + "SetupProtectionUpdate": { + "title": "Bot protection update", "type": "object", - "description": "Returned for 72 hours after the account was recovered (lost sign-in methods were reset). Actions that create organizations, applications or secrets are refused until `until`; read operations keep working.", - "required": [ - "detail", - "code", - "until" - ], + "description": "Every field is optional. The policies you send are merged into the stored ones; an unknown policy answers `unknown_protection`.", "properties": { - "detail": { - "type": "string", - "example": "This action is on hold because you recovered your account." + "enabled": { + "type": "boolean" }, - "code": { - "type": "string", - "enum": [ - "recovery_hold" - ], - "example": "recovery_hold" + "breached_password_check": { + "type": "boolean" }, - "until": { - "type": "string", - "format": "date-time", - "description": "When the hold ends (ISO 8601). Retry the request after this time.", - "example": "2026-11-04T10:15:00+00:00" + "policies": { + "type": "object", + "additionalProperties": { + "type": "string", + "enum": [ + "off", + "log", + "challenge", + "block" + ] + }, + "description": "A mode per policy: `bots`, `stuffing`, `brute`, `disposable`, `vpn` and `travel`." } } }, - "SsoRequiredError": { + "SetupProviderCredentials": { + "title": "Social app credentials", "type": "object", - "description": "The account belongs to an organization that requires SSO sign-in. No tokens, API keys or organizations are issued; sign in through the organization's SSO in a browser instead.", "required": [ - "error", - "message", - "organization_name", - "organization_slug", - "sso_url" + "client_id", + "client_secret" ], + "description": "Your own OAuth app's credentials. The secret is write-only: no response returns it.", "properties": { - "error": { - "type": "string", - "enum": [ - "sso_required" - ], - "example": "sso_required" - }, - "message": { - "type": "string", - "example": "Your organization 'Acme Corp' requires SSO login." - }, - "organization_name": { - "type": "string", - "example": "Acme Corp" - }, - "organization_slug": { + "client_id": { "type": "string", - "example": "acme-corp" + "maxLength": 255 }, - "sso_url": { + "client_secret": { "type": "string", - "description": "Path of the organization's SSO sign-in page, relative to the console.", - "example": "/sso/acme-corp" + "maxLength": 8192, + "writeOnly": true } } }, - "RecoverySetupRequiredError": { + "SetupSettings": { + "title": "Application settings", "type": "object", - "description": "The account was recovered and has no sign-in method set up yet. No tokens are issued; a one-time link to set up a new method was emailed to the account's address. Open it, set up the method, then log in again.", - "required": [ - "recovery_setup_required", - "setup_link_sent", - "message", - "code" - ], "properties": { - "recovery_setup_required": { - "type": "boolean", - "example": true + "sign_in_ui": { + "type": "string", + "enum": [ + "hosted", + "own" + ] }, - "setup_link_sent": { - "type": "boolean", - "example": true + "agent_humans_only": { + "type": "boolean" }, - "message": { - "type": "string", - "example": "You recovered your account. Open the link we emailed you to set up a new sign-in method." + "agents_enabled": { + "type": "boolean" }, - "code": { + "agent_scopes": { + "type": "array", + "maxItems": 2, + "items": { + "type": "string", + "enum": [ + "read", + "act" + ] + } + }, + "agent_lifetime": { + "type": "integer", + "enum": [ + 86400, + 604800, + 2592000 + ] + }, + "agent_idle_timeout": { + "type": "integer", + "enum": [ + 1800, + 7200, + 86400 + ] + }, + "agent_approval": { "type": "string", "enum": [ - "recovery_setup_required" - ], - "example": "recovery_setup_required" - } - } - }, - "ServiceUnavailableError": { - "type": "object", - "description": "The request could not be completed right now and nothing was changed. Retry it in a moment.", - "properties": { - "detail": { + "passkey", + "sign_in" + ] + }, + "organizations_enabled": { + "type": "boolean" + }, + "mfa_policy": { "type": "string", - "example": "We couldn't confirm that this application is unused. Try again in a moment." + "enum": [ + "optional", + "everyone", + "organization_admins" + ] }, - "code": { + "default_member_role": { "type": "string", - "example": "data_location_check_unavailable" + "enum": [ + "admin", + "member", + "billing" + ] + }, + "webhook_events_disabled": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "auth.sign_in", + "auth.sign_in_failed", + "auth.new_device", + "auth.account_locked", + "auth.two_factor_changed", + "auth.session_revoked", + "auth.agent_access_approved", + "auth.agent_access_revoked" + ] + } } } }, - "ApplicationInitiateLoginURI": { - "type": "string", - "maxLength": 2048, - "default": "", - "example": "https://acme.example/login", - "description": "Application sign-in URL for an admin-sent sign-in link. Optional; an empty string disables sending. A nonempty value must use HTTPS and the exact hostname of website_url (subdomains must match), with no userinfo, query, fragment or whitespace and no port other than 443. The server also revalidates the saved URI when website_url changes; update or clear initiate_login_uri in the same PATCH if needed. The hosted handoff adds iss and login_hint, but creates no session or tokens. See /authentication/sign-in-methods#admin-sent-sign-in-link." - }, - "ConsoleIdentityActionRequest": { + "SetupSettingsUpdate": { + "title": "Application settings update", "type": "object", - "additionalProperties": false, - "required": [ - "action" - ], - "description": "Console-only action. reset_mfa deletes TOTP, passkeys and recovery codes, invalidates pending challenges, revokes sessions and agent grants, and queues a notice and audit when anything changes. It leaves the password unchanged. send_sign_in_link sends only to the identity email and requires initiate_login_uri. send_password_reset uses the existing 30-minute password-reset flow; it is limited to once per minute per identity. Status actions return the identity; reset and send actions return the corresponding result.", + "description": "Every field is optional. Changing the application’s `agent_humans_only` setting requires an owner or admin. Enabling it also requires an enrolled passkey. A named key receives 403 `owner_or_admin_required`.", "properties": { - "action": { + "sign_in_ui": { "type": "string", "enum": [ - "block", - "unblock", - "unlock", - "revoke_sessions", - "send_password_reset", - "reset_mfa", - "send_sign_in_link" - ], - "description": "Identity action to perform." + "hosted", + "own" + ] }, - "notify_users": { - "type": "boolean", - "default": false, - "description": "Only block and unblock accept true. Emails the person when their blocked status changes. Repeating an unchanged status does not send another notice. Requires an email address." - } - }, - "example": { - "action": "reset_mfa" - } - }, - "ConsoleBulkIdentityActionRequest": { - "type": "object", - "additionalProperties": false, - "required": [ - "action", - "ids" - ], - "description": "Console-only bulk action. Each identity is handled independently. send_password_reset is single-identity only. Duplicate IDs or an invalid request reject the entire request before processing.", - "properties": { - "action": { + "agent_humans_only": { + "type": "boolean" + }, + "agents_enabled": { + "type": "boolean" + }, + "agent_scopes": { + "type": "array", + "maxItems": 2, + "items": { + "type": "string", + "enum": [ + "read", + "act" + ] + } + }, + "agent_lifetime": { + "type": "integer", + "enum": [ + 86400, + 604800, + 2592000 + ] + }, + "agent_idle_timeout": { + "type": "integer", + "enum": [ + 1800, + 7200, + 86400 + ] + }, + "agent_approval": { "type": "string", "enum": [ - "block", - "unblock", - "unlock", - "revoke_sessions", - "reset_mfa", - "send_sign_in_link" - ], - "description": "Action applied to each identity." + "passkey", + "sign_in" + ] + }, + "organizations_enabled": { + "type": "boolean" + }, + "mfa_policy": { + "type": "string", + "enum": [ + "optional", + "everyone", + "organization_admins" + ] }, - "ids": { + "default_member_role": { + "type": "string", + "enum": [ + "admin", + "member", + "billing" + ] + }, + "webhook_events_disabled": { "type": "array", - "minItems": 1, - "maxItems": 100, - "uniqueItems": true, "items": { - "type": "string", - "format": "uuid" - }, - "description": "One to 100 distinct identity IDs in this application." - }, - "notify_users": { - "type": "boolean", - "default": false, - "description": "Only block and unblock accept true. Emails the person when their blocked status changes. Repeating an unchanged status does not send another notice. Requires an email address." + "type": "string" + } } - }, - "example": { - "action": "reset_mfa", - "ids": [ - "00000000-0000-4000-8000-000000000001" - ] } }, - "ConsoleMFAResetResult": { + "SetupVerified": { + "title": "Verified sign-in", "type": "object", "required": [ - "status", - "requires_sign_in_link" + "signup_level", + "rules", + "claims", + "available_claims", + "workflows", + "wallet", + "since" ], - "description": "Successful console MFA reset. A repeated reset with nothing remaining to reset returns the same result without duplicate notices or audit events. An identity without email cannot be reset.", "properties": { - "status": { + "signup_level": { "type": "string", "enum": [ - "applied" + "none", + "liveness", + "full_id" ] }, - "requires_sign_in_link": { - "type": "boolean", - "description": "True when the person has no usable password. Offer a sign-in link after resetting MFA so they can sign in and enroll a new factor." + "signup": { + "type": "object", + "properties": { + "checks": { + "type": "integer" + }, + "passed": { + "type": "integer" + }, + "failed": { + "type": "integer" + } + } + }, + "rules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SetupVerifiedRule" + } + }, + "claims": { + "type": "array", + "description": "The claims your tokens carry once the person is verified.", + "items": { + "type": "string", + "enum": [ + "over_18", + "over_21", + "given_name", + "family_name", + "birthdate", + "nationality", + "country", + "document_verified", + "liveness" + ] + } + }, + "available_claims": { + "type": "array", + "items": { + "type": "string" + } + }, + "workflows": { + "type": "object", + "description": "The verification workflow behind each method; `null` until one is created.", + "properties": { + "liveness": { + "type": "string", + "nullable": true, + "format": "uuid" + }, + "selfie": { + "type": "string", + "nullable": true, + "format": "uuid" + }, + "full_id": { + "type": "string", + "nullable": true, + "format": "uuid" + } + } + }, + "wallet": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "sign_ins": { + "type": "integer" + }, + "people": { + "type": "integer" + } + } + }, + "since": { + "type": "string", + "format": "date-time" } - }, - "example": { - "status": "applied", - "requires_sign_in_link": true } }, - "ConsoleSignInLinkResult": { + "SetupVerifiedRule": { + "title": "Step-up rule", "type": "object", "required": [ - "status", - "expires_in" + "rule" ], - "description": "Console sign-in email sent. Never contains the link or token. Missing application URI returns HTTP 400 with error initiate_login_uri_required. An identity without email or a blocked identity is rejected. Rate limits return 429 and delivery failure returns 503.", "properties": { - "status": { + "rule": { "type": "string", "enum": [ - "sent" + "payout", + "bank", + "contact", + "device", + "sign_in" ] }, - "expires_in": { - "type": "integer", - "enum": [ - 900 - ], - "description": "Single-use handoff lifetime in seconds; the handoff does not authenticate the person." - } - }, - "example": { - "status": "sent", - "expires_in": 900 - } - }, - "ConsoleBulkIdentityActionResult": { - "type": "object", - "required": [ - "id", - "status" - ], - "description": "Per-identity result. Successful sign-in email uses sent, not applied. Missing identities, including identities from another application, return not_found. An action-level error returns invalid_request; error is included for failed sign-in-link actions only.", - "properties": { - "id": { - "type": "string", - "format": "uuid" + "enabled": { + "type": "boolean" }, - "status": { + "method": { "type": "string", "enum": [ - "applied", - "sent", - "not_found", - "invalid_request" + "liveness", + "selfie", + "full_id" ] }, - "requires_sign_in_link": { - "type": "boolean", - "description": "Present only for a successful reset_mfa." + "threshold": { + "type": "string", + "description": "`payout` only: the amount above which the rule applies, as a decimal string.", + "example": "500.00" }, - "expires_in": { + "currency": { + "type": "string", + "description": "`payout` only: the ISO 4217 currency of `threshold`.", + "example": "EUR" + }, + "checks": { "type": "integer", - "enum": [ - 900 - ], - "description": "Present only for a successful send_sign_in_link." + "description": "Checks this month." }, - "error": { - "type": "string", - "description": "Sign-in-link failure code, such as initiate_login_uri_required, identity_has_no_email, identity_blocked, rate_limited or delivery_unavailable." + "passed": { + "type": "integer" + }, + "failed": { + "type": "integer" } } }, - "ConsoleBulkIdentityActionResponse": { + "SetupVerifiedUpdate": { + "title": "Verified sign-in update", "type": "object", - "required": [ - "results" - ], + "description": "Every field is optional. Each supplied rule updates only the fields you send for its kind. Omitted rules keep their settings. Two rules of the same kind answer `duplicate_rule`, and `threshold` or `currency` on a rule other than `payout` answer `not_supported`.", "properties": { - "results": { + "signup_level": { + "type": "string", + "enum": [ + "none", + "liveness", + "full_id" + ] + }, + "rules": { "type": "array", "items": { - "$ref": "#/components/schemas/ConsoleBulkIdentityActionResult" + "title": "Step-up rule update", + "type": "object", + "required": [ + "rule" + ], + "properties": { + "rule": { + "type": "string", + "enum": [ + "payout", + "bank", + "contact", + "device", + "sign_in" + ] + }, + "enabled": { + "type": "boolean" + }, + "method": { + "type": "string", + "enum": [ + "liveness", + "selfie", + "full_id" + ] + }, + "threshold": { + "type": "string" + }, + "currency": { + "type": "string", + "pattern": "^[A-Z]{3}$" + } + } + } + }, + "claims": { + "type": "array", + "items": { + "type": "string" + } + }, + "workflows": { + "type": "object", + "properties": { + "liveness": { + "type": "string", + "nullable": true, + "format": "uuid" + }, + "selfie": { + "type": "string", + "nullable": true, + "format": "uuid" + }, + "full_id": { + "type": "string", + "nullable": true, + "format": "uuid" + } + } + } + } + } + }, + "responses": { + "RateLimited": { + "description": "Too many requests from this IP address for this endpoint, or, on a `POST` or `DELETE`, a bot protection bucket is empty. Nothing ran: wait `Retry-After` seconds, then retry.", + "headers": { + "Retry-After": { + "description": "Seconds to wait before retrying.", + "schema": { + "type": "integer", + "example": 60 + } + }, + "Cache-Control": { + "description": "Always `no-store`: never cache this response.", + "schema": { + "type": "string", + "example": "no-store" + } + }, + "Pragma": { + "description": "Always `no-cache`.", + "schema": { + "type": "string", + "example": "no-cache" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Detail" }, - "description": "One result per requested identity, in request order. Check each status even when the HTTP response is 200." + "examples": { + "RateLimited": { + "summary": "Endpoint limit", + "value": { + "detail": "Too many requests from this IP address. Please wait before trying again. Expected available in 60 seconds." + } + }, + "BotProtection": { + "summary": "Bot protection limit (POST and DELETE)", + "value": { + "detail": "rate_limited Expected available in 2 seconds." + } + } + } + } + } + }, + "SetupConflict": { + "description": "The application already holds a custom domain that is claimed, verified or active. Remove it before claiming another. With a management grant or a named key, `{\"detail\": \"product_disabled\"}` means Authentication is turned off for the application; a person turns it on in the console.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FieldErrors" + }, + "examples": { + "CustomDomainExists": { + "summary": "A custom domain is already claimed", + "value": { + "domain": "custom_domain_exists" + } + }, + "ProductDisabled": { + "summary": "Authentication is turned off for the application", + "value": { + "detail": "product_disabled" + } + } + } + } + } + }, + "SetupNotAuthenticated": { + "description": "The request carried no credential. Send a management grant as `Authorization: Bearer `, or a named key as `x-api-key`.", + "headers": { + "WWW-Authenticate": { + "description": "`Bearer`.", + "schema": { + "type": "string", + "example": "Bearer" + } } }, - "example": { - "results": [ - { - "id": "00000000-0000-4000-8000-000000000001", - "status": "applied", - "requires_sign_in_link": true + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Detail" + }, + "examples": { + "NoCredential": { + "summary": "No credential", + "value": { + "detail": "Authentication credentials were not provided." + } + } } - ] + } + } + }, + "SetupNotFound": { + "description": "The requested setup resource could not be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Detail" + } + } + } + }, + "SetupPermissionDenied": { + "description": "The credential cannot set up this application: a grant without `didit:management`, a grant approved for another organization, a key without the `authentication` scope, a read-only key on a write route, a key of another application, the application's primary secret, a `/programmatic/login` token, a key outside its IP allowlist or past its expiry, or a person whose role in the organization is not allowed. The body is `{\"detail\": \"\"}`; a named key's own limit answers with its reason, such as `ip_not_allowed`. A console session that changes the setup while Authentication is turned off gets `authentication_product_disabled`; a management grant or a named key gets `409 product_disabled` instead.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Detail" + }, + "examples": { + "NotPermitted": { + "summary": "A credential that cannot configure this application", + "value": { + "detail": "You do not have permission to perform this action." + } + }, + "OwnerOrAdmin": { + "summary": "A setting only a person can change", + "value": { + "detail": "owner_or_admin_required" + } + }, + "ProductDisabled": { + "summary": "A console session while Authentication is turned off", + "value": { + "detail": "authentication_product_disabled" + } + } + } + } + } + }, + "SetupProductDisabled": { + "description": "Authentication is turned off for this application, so a management grant or a named API key cannot change its setup (`{\"detail\": \"product_disabled\"}`). Nothing is written. Reads still answer, and the root `GET` shows `enabled: false`. No setup call turns the product on: a person turns Authentication on for the application in the console.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Detail" + }, + "examples": { + "ProductDisabled": { + "summary": "Authentication is turned off for the application", + "value": { + "detail": "product_disabled" + } + } + } + } + } + }, + "SetupUnavailable": { + "description": "The edge that serves custom domains is briefly unavailable, or has not finished removing the previous one. The domain is unchanged; retry with backoff.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FieldErrors" + }, + "examples": { + "EdgeUnavailable": { + "summary": "The edge is unavailable", + "value": { + "domain": "edge_deletion_pending" + } + } + } + } + } + }, + "SetupValidation": { + "description": "A field failed validation, in the body shape of `FieldErrors`. A value is a code (`sandbox_only`, `unavailable`, `not_supported`, `required`, `always_on`, `method_unavailable`, `unknown_field`, `invalid_domain`, `follows_product`) or a list of messages.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FieldErrors" + }, + "examples": { + "SandboxOnly": { + "summary": "Didit's test app on a live application", + "value": { + "credential_source": "sandbox_only" + } + }, + "Unavailable": { + "summary": "A test app this application cannot use", + "value": { + "credential_source": "unavailable" + } + }, + "NotSupported": { + "summary": "Credentials on a method that does not take them", + "value": { + "credentials": "not_supported" + } + }, + "SecretRequired": { + "summary": "A social method switched on without credentials", + "value": { + "credentials": "required" + } + } + } + } } } } diff --git a/openapi/verification.json b/openapi/verification.json index 165a7d8..312ef4e 100644 --- a/openapi/verification.json +++ b/openapi/verification.json @@ -87086,7 +87086,8 @@ "additionalProperties": true, "properties": { "stage": { - "type": "string" + "type": "string", + "description": "`none` (not set up; free reports still run while `free_reports.remaining` is above 0), `shadow` or `live`." }, "last_report_at": { "type": "string", @@ -87111,6 +87112,21 @@ }, "preparing": { "type": "integer" + }, + "free_reports": { + "type": "object", + "description": "The organization's free reports: the first reports run with no setup, on any plan, and are never charged.", + "properties": { + "limit": { + "type": "integer" + }, + "used": { + "type": "integer" + }, + "remaining": { + "type": "integer" + } + } } } } @@ -99436,6 +99452,109 @@ } ] } + }, + "/v3/investigator/offer/": { + "get": { + "operationId": "investigator_offer", + "summary": "Investigator agent offer", + "description": "Whether to offer the Investigator agent to this application: its decisions taken by hand in the last 30 days, the average handling time, the people who stopped halfway and whether follow-ups are on. Read from the daily analytics, never from a scan of sessions. `show` is true when 20 or more decisions were taken by hand and the agent is not set up, or when follow-ups are off and 50 or more people stopped halfway.", + "tags": [ + "Investigator" + ], + "security": [ + { + "ApiKeyAuth": [] + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "show": { + "type": "boolean" + }, + "manual_decisions_30d": { + "type": "integer" + }, + "avg_handling_seconds": { + "type": "integer", + "nullable": true + }, + "stopped_halfway_30d": { + "type": "integer" + }, + "stage": { + "type": "string", + "enum": [ + "none", + "shadow", + "live" + ] + }, + "followups_on": { + "type": "boolean" + } + } + } + } + } + }, + "401": { + "description": "Missing or invalid API key." + }, + "403": { + "description": "The key lacks read access to the application settings." + } + }, + "parameters": [], + "x-didit-sdk": { + "resource": "investigator", + "method": "retrieve_offer", + "auth": "api_key", + "server": true + }, + "x-codeSamples": [ + { + "lang": "python", + "label": "Python", + "source": "from didit import Didit\n\n# Reads DIDIT_API_KEY.\nclient = Didit()\n\nresult = client.investigator.retrieve_offer()\nprint(result)" + }, + { + "lang": "javascript", + "label": "Node.js", + "source": "import Didit from \"@didit-protocol/sdk-node\";\n\n// Reads DIDIT_API_KEY.\nconst didit = new Didit();\n\nconst result = await didit.investigator.retrieveOffer();\nconsole.log(result);" + }, + { + "lang": "go", + "label": "Go", + "source": "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Investigator.RetrieveOffer(ctx)\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)" + }, + { + "lang": "java", + "label": "Java", + "source": "import me.didit.Didit;\n\n// Reads DIDIT_API_KEY.\nDidit client = new Didit();\n\nvar result = client.investigator().retrieveOffer();\nSystem.out.println(result);" + }, + { + "lang": "php", + "label": "PHP", + "source": "investigator->retrieveOffer();\nprint_r($result->toArray());" + }, + { + "lang": "ruby", + "label": "Ruby", + "source": "require \"didit\"\n\n# Reads DIDIT_API_KEY.\ndidit = Didit::Client.new\n\nresult = didit.investigator.retrieve_offer\nputs result.to_h" + }, + { + "lang": "csharp", + "label": ".NET", + "source": "using System;\nusing System.Text.Json;\nusing Didit;\n\n// Reads DIDIT_API_KEY.\nusing var client = new DiditClient();\n\nvar result = await client.Investigator.RetrieveOfferAsync();\nConsole.WriteLine(JsonSerializer.Serialize(result));" + } + ] + } } }, "components": { @@ -132090,6 +132209,7 @@ "stage": { "type": "string", "enum": [ + "none", "shadow", "live" ] @@ -132145,6 +132265,14 @@ "type": "string", "format": "date-time", "nullable": true + }, + "free_report": { + "type": "boolean", + "description": "True for one of the organization's free reports: a review run at stage `none`, with no setup, never charged." + }, + "example": { + "type": "boolean", + "description": "True for an example report shown on a sandbox application. Example reports are read only and never cost anything." } } }, diff --git a/src/main/java/me/didit/resources/AuthenticationSetupResource.java b/src/main/java/me/didit/resources/AuthenticationSetupResource.java new file mode 100644 index 0000000..46a67fb --- /dev/null +++ b/src/main/java/me/didit/resources/AuthenticationSetupResource.java @@ -0,0 +1,3258 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.resources; + +import java.util.concurrent.CompletableFuture; +import me.didit.core.ApiClient; +import me.didit.core.ApiRequest; +import me.didit.core.Conv; +import me.didit.core.RawResponse; +import me.didit.core.RequestOptions; +import me.didit.core.ResponseHandler; +import me.didit.core.Responses; +import me.didit.types.AuthenticationSetupGetBrandingParams; +import me.didit.types.AuthenticationSetupGetEmailsParams; +import me.didit.types.SetupBranding; +import me.didit.types.SetupBrandingUpdate; +import me.didit.types.SetupConfiguration; +import me.didit.types.SetupConfigurationUpdate; +import me.didit.types.SetupDomain; +import me.didit.types.SetupDomainRequest; +import me.didit.types.SetupEmail; +import me.didit.types.SetupEmails; +import me.didit.types.SetupMethodResult; +import me.didit.types.SetupMethodUpdate; +import me.didit.types.SetupNativeApps; +import me.didit.types.SetupNativeAppsUpdate; +import me.didit.types.SetupOnboarding; +import me.didit.types.SetupOnboardingUpdate; +import me.didit.types.SetupProtection; +import me.didit.types.SetupProtectionUpdate; +import me.didit.types.SetupSettings; +import me.didit.types.SetupSettingsUpdate; +import me.didit.types.SetupVerified; +import me.didit.types.SetupVerifiedUpdate; + +/** The {@code authentication_setup} resource: {@code client.authenticationSetup()}. */ +public final class AuthenticationSetupResource { + private final ApiClient client; + private final WithRawResponse withRawResponse; + + AuthenticationSetupResource(ApiClient client) { + this.client = client; + this.withRawResponse = new WithRawResponse(client); + } + + /** + * The same operations, returning the HTTP status, headers and request id with the parsed body. + * + * @return the raw response view + */ + public WithRawResponse withRawResponse() { + return withRawResponse; + } + + /** + * Get the Authentication setup + * + *

Returns the application's Authentication configuration and every sign-in method with its enabled state and credential_source, which is how an agent verifies the setup it made. Disabled methods are listed too, and credential_source is null for a method that holds no social credentials. The top-level enabled is false when Authentication is disabled for the application. + * + *

{@code GET /organizations/{organization_id}/applications/{application_id}/authentication/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param options per-request options that override the client options + * @return the response body + */ + public SetupConfiguration getConfiguration(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getConfigurationRequest(organizationId, applicationId), options, GET_CONFIGURATION_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getConfiguration(String, String, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture getConfigurationAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getConfigurationRequest(organizationId, applicationId), options, GET_CONFIGURATION_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #getConfiguration(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupConfiguration getConfiguration(String organizationId, String applicationId) { + return client.execute(getConfigurationRequest(organizationId, applicationId), RequestOptions.none(), GET_CONFIGURATION_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getConfiguration(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture getConfigurationAsync(String organizationId, String applicationId) { + return client.executeAsync(getConfigurationRequest(organizationId, applicationId), RequestOptions.none(), GET_CONFIGURATION_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Update the Authentication setup + * + *

Changes the settings in the body: callback URLs, allowed origins, session lifetime, idle timeout, password rules and the sign-up policy. Send only the fields you change. enabled is refused with {"enabled": "follows_product"} because the product's state decides it, and an unknown field with {"<field>": "unknown_field"}. + * + *

{@code PATCH /organizations/{organization_id}/applications/{application_id}/authentication/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param params the request parameters + * @param options per-request options that override the client options + * @return the response body + */ + public SetupConfiguration updateConfiguration(String organizationId, String applicationId, SetupConfigurationUpdate params, RequestOptions options) { + return client.execute(updateConfigurationRequest(organizationId, applicationId, params), options, UPDATE_CONFIGURATION_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateConfiguration(String, String, SetupConfigurationUpdate, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture updateConfigurationAsync(String organizationId, String applicationId, SetupConfigurationUpdate params, RequestOptions options) { + return client.executeAsync(updateConfigurationRequest(organizationId, applicationId, params), options, UPDATE_CONFIGURATION_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateConfiguration(String, String, SetupConfigurationUpdate, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public SetupConfiguration updateConfiguration(String organizationId, String applicationId, SetupConfigurationUpdate params) { + return client.execute(updateConfigurationRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_CONFIGURATION_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateConfiguration(String, String, SetupConfigurationUpdate, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture updateConfigurationAsync(String organizationId, String applicationId, SetupConfigurationUpdate params) { + return client.executeAsync(updateConfigurationRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_CONFIGURATION_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateConfiguration(String, String, SetupConfigurationUpdate, RequestOptions)}, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public SetupConfiguration updateConfiguration(String organizationId, String applicationId, RequestOptions options) { + return client.execute(updateConfigurationRequest(organizationId, applicationId, SetupConfigurationUpdate.builder().build()), options, UPDATE_CONFIGURATION_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateConfiguration(String, String, SetupConfigurationUpdate, RequestOptions)}, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture updateConfigurationAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(updateConfigurationRequest(organizationId, applicationId, SetupConfigurationUpdate.builder().build()), options, UPDATE_CONFIGURATION_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateConfiguration(String, String, SetupConfigurationUpdate, RequestOptions)}, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupConfiguration updateConfiguration(String organizationId, String applicationId) { + return client.execute(updateConfigurationRequest(organizationId, applicationId, SetupConfigurationUpdate.builder().build()), RequestOptions.none(), UPDATE_CONFIGURATION_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateConfiguration(String, String, SetupConfigurationUpdate, RequestOptions)}, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture updateConfigurationAsync(String organizationId, String applicationId) { + return client.executeAsync(updateConfigurationRequest(organizationId, applicationId, SetupConfigurationUpdate.builder().build()), RequestOptions.none(), UPDATE_CONFIGURATION_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Enable or disable a sign-in method + * + *

Enables or disables one method; enabled is required. A social method (google, microsoft, apple, github) takes either your own credentials or credential_source: "didit_test", which uses Didit's own sandbox app and is refused on a live application with {"credential_source": "sandbox_only"}; a test app the application cannot use answers {"credential_source": "unavailable"}. phone takes the workflow_id of a phone verification workflow. credentials, workflow_id or credential_source on a method that does not use them answer not_supported, turning off a method that is always on answers {"enabled": "always_on"}, and an unknown method answers {"name": "method_unavailable"}. + * + *

{@code PUT /organizations/{organization_id}/applications/{application_id}/authentication/methods/{name}/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param name The method: `password`, `code`, `magic`, `phone`, `passkey`, `google`, `microsoft`, `apple`, `github`, `sso` or `wallet`. + * @param params the request parameters + * @param options per-request options that override the client options + * @return the response body + */ + public SetupMethodResult setMethod(String organizationId, String applicationId, String name, SetupMethodUpdate params, RequestOptions options) { + return client.execute(setMethodRequest(organizationId, applicationId, name, params), options, SET_METHOD_RESPONSE).data(); + } + + /** + * Asynchronous {@link #setMethod(String, String, String, SetupMethodUpdate, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param name the {@code name} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture setMethodAsync(String organizationId, String applicationId, String name, SetupMethodUpdate params, RequestOptions options) { + return client.executeAsync(setMethodRequest(organizationId, applicationId, name, params), options, SET_METHOD_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #setMethod(String, String, String, SetupMethodUpdate, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param name the {@code name} + * @param params the request parameters + * @return the result + */ + public SetupMethodResult setMethod(String organizationId, String applicationId, String name, SetupMethodUpdate params) { + return client.execute(setMethodRequest(organizationId, applicationId, name, params), RequestOptions.none(), SET_METHOD_RESPONSE).data(); + } + + /** + * Asynchronous {@link #setMethod(String, String, String, SetupMethodUpdate, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param name the {@code name} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture setMethodAsync(String organizationId, String applicationId, String name, SetupMethodUpdate params) { + return client.executeAsync(setMethodRequest(organizationId, applicationId, name, params), RequestOptions.none(), SET_METHOD_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Get the onboarding progress + * + *

Returns which setup steps are done, whether the application is ready and how people sign in. A grant or a key gets progress only: the console session's sample sign-in details, which name an end user, are left out. + * + *

{@code GET /organizations/{organization_id}/applications/{application_id}/authentication/onboarding/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param options per-request options that override the client options + * @return the response body + */ + public SetupOnboarding getOnboarding(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getOnboardingRequest(organizationId, applicationId), options, GET_ONBOARDING_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getOnboarding(String, String, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture getOnboardingAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getOnboardingRequest(organizationId, applicationId), options, GET_ONBOARDING_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #getOnboarding(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupOnboarding getOnboarding(String organizationId, String applicationId) { + return client.execute(getOnboardingRequest(organizationId, applicationId), RequestOptions.none(), GET_ONBOARDING_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getOnboarding(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture getOnboardingAsync(String organizationId, String applicationId) { + return client.executeAsync(getOnboardingRequest(organizationId, applicationId), RequestOptions.none(), GET_ONBOARDING_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Update the onboarding progress + * + *

Records a setup step: skip the test sign-in, skip the user import, or choose the hosted sign-in page or your own screens. An empty body answers {"non_field_errors": ["empty_update"]}. + * + *

{@code PATCH /organizations/{organization_id}/applications/{application_id}/authentication/onboarding/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param params the request parameters + * @param options per-request options that override the client options + * @return the response body + */ + public SetupOnboarding updateOnboarding(String organizationId, String applicationId, SetupOnboardingUpdate params, RequestOptions options) { + return client.execute(updateOnboardingRequest(organizationId, applicationId, params), options, UPDATE_ONBOARDING_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateOnboarding(String, String, SetupOnboardingUpdate, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture updateOnboardingAsync(String organizationId, String applicationId, SetupOnboardingUpdate params, RequestOptions options) { + return client.executeAsync(updateOnboardingRequest(organizationId, applicationId, params), options, UPDATE_ONBOARDING_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateOnboarding(String, String, SetupOnboardingUpdate, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public SetupOnboarding updateOnboarding(String organizationId, String applicationId, SetupOnboardingUpdate params) { + return client.execute(updateOnboardingRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_ONBOARDING_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateOnboarding(String, String, SetupOnboardingUpdate, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture updateOnboardingAsync(String organizationId, String applicationId, SetupOnboardingUpdate params) { + return client.executeAsync(updateOnboardingRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_ONBOARDING_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateOnboarding(String, String, SetupOnboardingUpdate, RequestOptions)}, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public SetupOnboarding updateOnboarding(String organizationId, String applicationId, RequestOptions options) { + return client.execute(updateOnboardingRequest(organizationId, applicationId, SetupOnboardingUpdate.builder().build()), options, UPDATE_ONBOARDING_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateOnboarding(String, String, SetupOnboardingUpdate, RequestOptions)}, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture updateOnboardingAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(updateOnboardingRequest(organizationId, applicationId, SetupOnboardingUpdate.builder().build()), options, UPDATE_ONBOARDING_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateOnboarding(String, String, SetupOnboardingUpdate, RequestOptions)}, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupOnboarding updateOnboarding(String organizationId, String applicationId) { + return client.execute(updateOnboardingRequest(organizationId, applicationId, SetupOnboardingUpdate.builder().build()), RequestOptions.none(), UPDATE_ONBOARDING_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateOnboarding(String, String, SetupOnboardingUpdate, RequestOptions)}, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture updateOnboardingAsync(String organizationId, String applicationId) { + return client.executeAsync(updateOnboardingRequest(organizationId, applicationId, SetupOnboardingUpdate.builder().build()), RequestOptions.none(), UPDATE_ONBOARDING_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Get the application settings + * + *

Returns agent access, organizations, the MFA policy, the default member role and the webhook events switched off. + * + *

{@code GET /organizations/{organization_id}/applications/{application_id}/authentication/settings/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param options per-request options that override the client options + * @return the response body + */ + public SetupSettings getSettings(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getSettingsRequest(organizationId, applicationId), options, GET_SETTINGS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getSettings(String, String, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture getSettingsAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getSettingsRequest(organizationId, applicationId), options, GET_SETTINGS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #getSettings(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupSettings getSettings(String organizationId, String applicationId) { + return client.execute(getSettingsRequest(organizationId, applicationId), RequestOptions.none(), GET_SETTINGS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getSettings(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture getSettingsAsync(String organizationId, String applicationId) { + return client.executeAsync(getSettingsRequest(organizationId, applicationId), RequestOptions.none(), GET_SETTINGS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Update the application settings + * + *

Changes the settings in the body. agent_humans_only needs a person: a named API key answers 403 owner_or_admin_required, and turning it on needs an owner or admin with an enrolled passkey. + * + *

{@code PATCH /organizations/{organization_id}/applications/{application_id}/authentication/settings/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param params the request parameters + * @param options per-request options that override the client options + * @return the response body + */ + public SetupSettings updateSettings(String organizationId, String applicationId, SetupSettingsUpdate params, RequestOptions options) { + return client.execute(updateSettingsRequest(organizationId, applicationId, params), options, UPDATE_SETTINGS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateSettings(String, String, SetupSettingsUpdate, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture updateSettingsAsync(String organizationId, String applicationId, SetupSettingsUpdate params, RequestOptions options) { + return client.executeAsync(updateSettingsRequest(organizationId, applicationId, params), options, UPDATE_SETTINGS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateSettings(String, String, SetupSettingsUpdate, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public SetupSettings updateSettings(String organizationId, String applicationId, SetupSettingsUpdate params) { + return client.execute(updateSettingsRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_SETTINGS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateSettings(String, String, SetupSettingsUpdate, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture updateSettingsAsync(String organizationId, String applicationId, SetupSettingsUpdate params) { + return client.executeAsync(updateSettingsRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_SETTINGS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateSettings(String, String, SetupSettingsUpdate, RequestOptions)}, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public SetupSettings updateSettings(String organizationId, String applicationId, RequestOptions options) { + return client.execute(updateSettingsRequest(organizationId, applicationId, SetupSettingsUpdate.builder().build()), options, UPDATE_SETTINGS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateSettings(String, String, SetupSettingsUpdate, RequestOptions)}, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture updateSettingsAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(updateSettingsRequest(organizationId, applicationId, SetupSettingsUpdate.builder().build()), options, UPDATE_SETTINGS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateSettings(String, String, SetupSettingsUpdate, RequestOptions)}, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupSettings updateSettings(String organizationId, String applicationId) { + return client.execute(updateSettingsRequest(organizationId, applicationId, SetupSettingsUpdate.builder().build()), RequestOptions.none(), UPDATE_SETTINGS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateSettings(String, String, SetupSettingsUpdate, RequestOptions)}, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture updateSettingsAsync(String organizationId, String applicationId) { + return client.executeAsync(updateSettingsRequest(organizationId, applicationId, SetupSettingsUpdate.builder().build()), RequestOptions.none(), UPDATE_SETTINGS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Get the hosted pages' branding + * + *

Returns the application's brand as the hosted pages show it, the texts set per language, the legal links and the hosted URL. + * + *

{@code GET /organizations/{organization_id}/applications/{application_id}/authentication/branding/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param params the request parameters + * @param options per-request options that override the client options + * @return the response body + */ + public SetupBranding getBranding(String organizationId, String applicationId, AuthenticationSetupGetBrandingParams params, RequestOptions options) { + return client.execute(getBrandingRequest(organizationId, applicationId, params), options, GET_BRANDING_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getBranding(String, String, AuthenticationSetupGetBrandingParams, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture getBrandingAsync(String organizationId, String applicationId, AuthenticationSetupGetBrandingParams params, RequestOptions options) { + return client.executeAsync(getBrandingRequest(organizationId, applicationId, params), options, GET_BRANDING_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #getBranding(String, String, AuthenticationSetupGetBrandingParams, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public SetupBranding getBranding(String organizationId, String applicationId, AuthenticationSetupGetBrandingParams params) { + return client.execute(getBrandingRequest(organizationId, applicationId, params), RequestOptions.none(), GET_BRANDING_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getBranding(String, String, AuthenticationSetupGetBrandingParams, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture getBrandingAsync(String organizationId, String applicationId, AuthenticationSetupGetBrandingParams params) { + return client.executeAsync(getBrandingRequest(organizationId, applicationId, params), RequestOptions.none(), GET_BRANDING_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #getBranding(String, String, AuthenticationSetupGetBrandingParams, RequestOptions)}, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public SetupBranding getBranding(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getBrandingRequest(organizationId, applicationId, AuthenticationSetupGetBrandingParams.builder().build()), options, GET_BRANDING_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getBranding(String, String, AuthenticationSetupGetBrandingParams, RequestOptions)}, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture getBrandingAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getBrandingRequest(organizationId, applicationId, AuthenticationSetupGetBrandingParams.builder().build()), options, GET_BRANDING_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #getBranding(String, String, AuthenticationSetupGetBrandingParams, RequestOptions)}, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupBranding getBranding(String organizationId, String applicationId) { + return client.execute(getBrandingRequest(organizationId, applicationId, AuthenticationSetupGetBrandingParams.builder().build()), RequestOptions.none(), GET_BRANDING_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getBranding(String, String, AuthenticationSetupGetBrandingParams, RequestOptions)}, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture getBrandingAsync(String organizationId, String applicationId) { + return client.executeAsync(getBrandingRequest(organizationId, applicationId, AuthenticationSetupGetBrandingParams.builder().build()), RequestOptions.none(), GET_BRANDING_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Update the hosted pages' branding + * + *

Changes the hosted pages' own texts and legal links. The logo, colours and fonts are read-only here: they come from Customization. A language Didit does not publish answers {"<language>": "unsupported_language"}, and a legal link that is not https:// answers https_required. + * + *

{@code PATCH /organizations/{organization_id}/applications/{application_id}/authentication/branding/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param params the request parameters + * @param options per-request options that override the client options + * @return the response body + */ + public SetupBranding updateBranding(String organizationId, String applicationId, SetupBrandingUpdate params, RequestOptions options) { + return client.execute(updateBrandingRequest(organizationId, applicationId, params), options, UPDATE_BRANDING_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateBranding(String, String, SetupBrandingUpdate, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture updateBrandingAsync(String organizationId, String applicationId, SetupBrandingUpdate params, RequestOptions options) { + return client.executeAsync(updateBrandingRequest(organizationId, applicationId, params), options, UPDATE_BRANDING_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateBranding(String, String, SetupBrandingUpdate, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public SetupBranding updateBranding(String organizationId, String applicationId, SetupBrandingUpdate params) { + return client.execute(updateBrandingRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_BRANDING_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateBranding(String, String, SetupBrandingUpdate, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture updateBrandingAsync(String organizationId, String applicationId, SetupBrandingUpdate params) { + return client.executeAsync(updateBrandingRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_BRANDING_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateBranding(String, String, SetupBrandingUpdate, RequestOptions)}, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public SetupBranding updateBranding(String organizationId, String applicationId, RequestOptions options) { + return client.execute(updateBrandingRequest(organizationId, applicationId, SetupBrandingUpdate.builder().build()), options, UPDATE_BRANDING_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateBranding(String, String, SetupBrandingUpdate, RequestOptions)}, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture updateBrandingAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(updateBrandingRequest(organizationId, applicationId, SetupBrandingUpdate.builder().build()), options, UPDATE_BRANDING_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateBranding(String, String, SetupBrandingUpdate, RequestOptions)}, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupBranding updateBranding(String organizationId, String applicationId) { + return client.execute(updateBrandingRequest(organizationId, applicationId, SetupBrandingUpdate.builder().build()), RequestOptions.none(), UPDATE_BRANDING_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateBranding(String, String, SetupBrandingUpdate, RequestOptions)}, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture updateBrandingAsync(String organizationId, String applicationId) { + return client.executeAsync(updateBrandingRequest(organizationId, applicationId, SetupBrandingUpdate.builder().build()), RequestOptions.none(), UPDATE_BRANDING_RESPONSE).thenApply(RawResponse::data); + } + + /** + * List the sign-in emails + * + *

Lists the emails Didit Authentication sends, with the ones this application sends switched on and their subject in the language you ask for. The senders in the response are read-only here: they come from Customization. + * + *

{@code GET /organizations/{organization_id}/applications/{application_id}/authentication/emails/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param params the request parameters + * @param options per-request options that override the client options + * @return the response body + */ + public SetupEmails getEmails(String organizationId, String applicationId, AuthenticationSetupGetEmailsParams params, RequestOptions options) { + return client.execute(getEmailsRequest(organizationId, applicationId, params), options, GET_EMAILS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getEmails(String, String, AuthenticationSetupGetEmailsParams, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture getEmailsAsync(String organizationId, String applicationId, AuthenticationSetupGetEmailsParams params, RequestOptions options) { + return client.executeAsync(getEmailsRequest(organizationId, applicationId, params), options, GET_EMAILS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #getEmails(String, String, AuthenticationSetupGetEmailsParams, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public SetupEmails getEmails(String organizationId, String applicationId, AuthenticationSetupGetEmailsParams params) { + return client.execute(getEmailsRequest(organizationId, applicationId, params), RequestOptions.none(), GET_EMAILS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getEmails(String, String, AuthenticationSetupGetEmailsParams, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture getEmailsAsync(String organizationId, String applicationId, AuthenticationSetupGetEmailsParams params) { + return client.executeAsync(getEmailsRequest(organizationId, applicationId, params), RequestOptions.none(), GET_EMAILS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #getEmails(String, String, AuthenticationSetupGetEmailsParams, RequestOptions)}, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public SetupEmails getEmails(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getEmailsRequest(organizationId, applicationId, AuthenticationSetupGetEmailsParams.builder().build()), options, GET_EMAILS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getEmails(String, String, AuthenticationSetupGetEmailsParams, RequestOptions)}, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture getEmailsAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getEmailsRequest(organizationId, applicationId, AuthenticationSetupGetEmailsParams.builder().build()), options, GET_EMAILS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #getEmails(String, String, AuthenticationSetupGetEmailsParams, RequestOptions)}, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupEmails getEmails(String organizationId, String applicationId) { + return client.execute(getEmailsRequest(organizationId, applicationId, AuthenticationSetupGetEmailsParams.builder().build()), RequestOptions.none(), GET_EMAILS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getEmails(String, String, AuthenticationSetupGetEmailsParams, RequestOptions)}, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture getEmailsAsync(String organizationId, String applicationId) { + return client.executeAsync(getEmailsRequest(organizationId, applicationId, AuthenticationSetupGetEmailsParams.builder().build()), RequestOptions.none(), GET_EMAILS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Preview a sign-in email + * + *

Returns one email as it renders, with sample codes and links. An invitation preview uses a sample organization for a grant or named key. A console session can see a customer organization's name. The address of a console member is left out for a grant or a key, which have no mailbox. An email Authentication does not send answers {"error": "email_not_sent_by_authentication"}. + * + *

{@code GET /organizations/{organization_id}/applications/{application_id}/authentication/emails/{key}/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param key The email: `code`, `magic`, `reset`, `device`, `invite`, `org`, `agent` or `agentoff`. + * @param options per-request options that override the client options + * @return the response body + */ + public SetupEmail getEmail(String organizationId, String applicationId, String key, RequestOptions options) { + return client.execute(getEmailRequest(organizationId, applicationId, key), options, GET_EMAIL_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getEmail(String, String, String, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param key the {@code key} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture getEmailAsync(String organizationId, String applicationId, String key, RequestOptions options) { + return client.executeAsync(getEmailRequest(organizationId, applicationId, key), options, GET_EMAIL_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #getEmail(String, String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param key the {@code key} + * @return the result + */ + public SetupEmail getEmail(String organizationId, String applicationId, String key) { + return client.execute(getEmailRequest(organizationId, applicationId, key), RequestOptions.none(), GET_EMAIL_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getEmail(String, String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param key the {@code key} + * @return a future completed with the result + */ + public CompletableFuture getEmailAsync(String organizationId, String applicationId, String key) { + return client.executeAsync(getEmailRequest(organizationId, applicationId, key), RequestOptions.none(), GET_EMAIL_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Get bot protection + * + *

Returns whether protection is on, each policy's mode and the last 14 days of detections. Console sessions, grants and named keys receive the same aggregate counters. + * + *

{@code GET /organizations/{organization_id}/applications/{application_id}/authentication/protection/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param options per-request options that override the client options + * @return the response body + */ + public SetupProtection getProtection(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getProtectionRequest(organizationId, applicationId), options, GET_PROTECTION_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getProtection(String, String, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture getProtectionAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getProtectionRequest(organizationId, applicationId), options, GET_PROTECTION_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #getProtection(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupProtection getProtection(String organizationId, String applicationId) { + return client.execute(getProtectionRequest(organizationId, applicationId), RequestOptions.none(), GET_PROTECTION_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getProtection(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture getProtectionAsync(String organizationId, String applicationId) { + return client.executeAsync(getProtectionRequest(organizationId, applicationId), RequestOptions.none(), GET_PROTECTION_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Update bot protection + * + *

Turns protection on or off, turns the breached-password check on or off and sets a mode per policy. The policies you send are merged into the stored ones. An unknown policy answers {"policies": ["unknown_protection"]}. + * + *

{@code PATCH /organizations/{organization_id}/applications/{application_id}/authentication/protection/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param params the request parameters + * @param options per-request options that override the client options + * @return the response body + */ + public SetupProtection updateProtection(String organizationId, String applicationId, SetupProtectionUpdate params, RequestOptions options) { + return client.execute(updateProtectionRequest(organizationId, applicationId, params), options, UPDATE_PROTECTION_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateProtection(String, String, SetupProtectionUpdate, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture updateProtectionAsync(String organizationId, String applicationId, SetupProtectionUpdate params, RequestOptions options) { + return client.executeAsync(updateProtectionRequest(organizationId, applicationId, params), options, UPDATE_PROTECTION_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateProtection(String, String, SetupProtectionUpdate, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public SetupProtection updateProtection(String organizationId, String applicationId, SetupProtectionUpdate params) { + return client.execute(updateProtectionRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_PROTECTION_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateProtection(String, String, SetupProtectionUpdate, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture updateProtectionAsync(String organizationId, String applicationId, SetupProtectionUpdate params) { + return client.executeAsync(updateProtectionRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_PROTECTION_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateProtection(String, String, SetupProtectionUpdate, RequestOptions)}, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public SetupProtection updateProtection(String organizationId, String applicationId, RequestOptions options) { + return client.execute(updateProtectionRequest(organizationId, applicationId, SetupProtectionUpdate.builder().build()), options, UPDATE_PROTECTION_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateProtection(String, String, SetupProtectionUpdate, RequestOptions)}, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture updateProtectionAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(updateProtectionRequest(organizationId, applicationId, SetupProtectionUpdate.builder().build()), options, UPDATE_PROTECTION_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateProtection(String, String, SetupProtectionUpdate, RequestOptions)}, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupProtection updateProtection(String organizationId, String applicationId) { + return client.execute(updateProtectionRequest(organizationId, applicationId, SetupProtectionUpdate.builder().build()), RequestOptions.none(), UPDATE_PROTECTION_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateProtection(String, String, SetupProtectionUpdate, RequestOptions)}, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture updateProtectionAsync(String organizationId, String applicationId) { + return client.executeAsync(updateProtectionRequest(organizationId, applicationId, SetupProtectionUpdate.builder().build()), RequestOptions.none(), UPDATE_PROTECTION_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Get verified sign-in + * + *

Returns the sign-up verification level, the step-up rules with this month's counters, the claims your tokens carry and the verification workflows behind them. + * + *

{@code GET /organizations/{organization_id}/applications/{application_id}/authentication/verified/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param options per-request options that override the client options + * @return the response body + */ + public SetupVerified getVerified(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getVerifiedRequest(organizationId, applicationId), options, GET_VERIFIED_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getVerified(String, String, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture getVerifiedAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getVerifiedRequest(organizationId, applicationId), options, GET_VERIFIED_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #getVerified(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupVerified getVerified(String organizationId, String applicationId) { + return client.execute(getVerifiedRequest(organizationId, applicationId), RequestOptions.none(), GET_VERIFIED_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getVerified(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture getVerifiedAsync(String organizationId, String applicationId) { + return client.executeAsync(getVerifiedRequest(organizationId, applicationId), RequestOptions.none(), GET_VERIFIED_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Update verified sign-in + * + *

Sets the sign-up verification level, the step-up rules, the claims your tokens carry and the workflows the rules use. Each supplied rule updates only the fields you send for its kind. Omitted rules keep their settings. Two rules of the same kind answer duplicate_rule, and threshold or currency on a rule other than payout answer not_supported. + * + *

{@code PATCH /organizations/{organization_id}/applications/{application_id}/authentication/verified/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param params the request parameters + * @param options per-request options that override the client options + * @return the response body + */ + public SetupVerified updateVerified(String organizationId, String applicationId, SetupVerifiedUpdate params, RequestOptions options) { + return client.execute(updateVerifiedRequest(organizationId, applicationId, params), options, UPDATE_VERIFIED_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateVerified(String, String, SetupVerifiedUpdate, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture updateVerifiedAsync(String organizationId, String applicationId, SetupVerifiedUpdate params, RequestOptions options) { + return client.executeAsync(updateVerifiedRequest(organizationId, applicationId, params), options, UPDATE_VERIFIED_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateVerified(String, String, SetupVerifiedUpdate, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public SetupVerified updateVerified(String organizationId, String applicationId, SetupVerifiedUpdate params) { + return client.execute(updateVerifiedRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_VERIFIED_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateVerified(String, String, SetupVerifiedUpdate, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture updateVerifiedAsync(String organizationId, String applicationId, SetupVerifiedUpdate params) { + return client.executeAsync(updateVerifiedRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_VERIFIED_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateVerified(String, String, SetupVerifiedUpdate, RequestOptions)}, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public SetupVerified updateVerified(String organizationId, String applicationId, RequestOptions options) { + return client.execute(updateVerifiedRequest(organizationId, applicationId, SetupVerifiedUpdate.builder().build()), options, UPDATE_VERIFIED_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateVerified(String, String, SetupVerifiedUpdate, RequestOptions)}, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture updateVerifiedAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(updateVerifiedRequest(organizationId, applicationId, SetupVerifiedUpdate.builder().build()), options, UPDATE_VERIFIED_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateVerified(String, String, SetupVerifiedUpdate, RequestOptions)}, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupVerified updateVerified(String organizationId, String applicationId) { + return client.execute(updateVerifiedRequest(organizationId, applicationId, SetupVerifiedUpdate.builder().build()), RequestOptions.none(), UPDATE_VERIFIED_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateVerified(String, String, SetupVerifiedUpdate, RequestOptions)}, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture updateVerifiedAsync(String organizationId, String applicationId) { + return client.executeAsync(updateVerifiedRequest(organizationId, applicationId, SetupVerifiedUpdate.builder().build()), RequestOptions.none(), UPDATE_VERIFIED_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Get the hosted domain + * + *

Returns the hosted origin, the issuer and passkey relying party that follow from it, and the custom domain with its DNS record, certificate and status. origin names the custom domain once it is active and the default host until then. + * + *

{@code GET /organizations/{organization_id}/applications/{application_id}/authentication/domain/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param options per-request options that override the client options + * @return the response body + */ + public SetupDomain getDomain(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getDomainRequest(organizationId, applicationId), options, GET_DOMAIN_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getDomain(String, String, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture getDomainAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getDomainRequest(organizationId, applicationId), options, GET_DOMAIN_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #getDomain(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupDomain getDomain(String organizationId, String applicationId) { + return client.execute(getDomainRequest(organizationId, applicationId), RequestOptions.none(), GET_DOMAIN_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getDomain(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture getDomainAsync(String organizationId, String applicationId) { + return client.executeAsync(getDomainRequest(organizationId, applicationId), RequestOptions.none(), GET_DOMAIN_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Claim a custom domain + * + *

Claims a domain for the application's hosted pages: pending until DNS points at the application's default host. Claiming a second domain while one is claimed, verified or active answers 409 {"domain": "custom_domain_exists"}; an apex, an IP or one of Didit's own hosts answers {"domain": "invalid_domain"}. + * + *

{@code PUT /organizations/{organization_id}/applications/{application_id}/authentication/domain/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param params the request parameters + * @param options per-request options that override the client options + * @return the response body + */ + public SetupDomain setDomain(String organizationId, String applicationId, SetupDomainRequest params, RequestOptions options) { + return client.execute(setDomainRequest(organizationId, applicationId, params), options, SET_DOMAIN_RESPONSE).data(); + } + + /** + * Asynchronous {@link #setDomain(String, String, SetupDomainRequest, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture setDomainAsync(String organizationId, String applicationId, SetupDomainRequest params, RequestOptions options) { + return client.executeAsync(setDomainRequest(organizationId, applicationId, params), options, SET_DOMAIN_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #setDomain(String, String, SetupDomainRequest, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public SetupDomain setDomain(String organizationId, String applicationId, SetupDomainRequest params) { + return client.execute(setDomainRequest(organizationId, applicationId, params), RequestOptions.none(), SET_DOMAIN_RESPONSE).data(); + } + + /** + * Asynchronous {@link #setDomain(String, String, SetupDomainRequest, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture setDomainAsync(String organizationId, String applicationId, SetupDomainRequest params) { + return client.executeAsync(setDomainRequest(organizationId, applicationId, params), RequestOptions.none(), SET_DOMAIN_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Remove the custom domain + * + *

Removes the custom domain and returns the application to its default host. When the edge does not confirm the removal the call answers 503 and the domain stays claimed; retry it. + * + *

{@code DELETE /organizations/{organization_id}/applications/{application_id}/authentication/domain/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param options per-request options that override the client options + * @return the response body + */ + public SetupDomain removeDomain(String organizationId, String applicationId, RequestOptions options) { + return client.execute(removeDomainRequest(organizationId, applicationId), options, REMOVE_DOMAIN_RESPONSE).data(); + } + + /** + * Asynchronous {@link #removeDomain(String, String, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture removeDomainAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(removeDomainRequest(organizationId, applicationId), options, REMOVE_DOMAIN_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #removeDomain(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupDomain removeDomain(String organizationId, String applicationId) { + return client.execute(removeDomainRequest(organizationId, applicationId), RequestOptions.none(), REMOVE_DOMAIN_RESPONSE).data(); + } + + /** + * Asynchronous {@link #removeDomain(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture removeDomainAsync(String organizationId, String applicationId) { + return client.executeAsync(removeDomainRequest(organizationId, applicationId), RequestOptions.none(), REMOVE_DOMAIN_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Verify the custom domain + * + *

Checks the DNS record now and asks the edge for the certificate. A missing or mismatched DNS record returns 200 with a failure_reason. Read domain/ afterwards for the result: verified once the certificate is issued, failed with a failure_reason when it cannot be issued. + * + *

{@code POST /organizations/{organization_id}/applications/{application_id}/authentication/domain/verify/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param options per-request options that override the client options + * @return the response body + */ + public SetupDomain verifyDomain(String organizationId, String applicationId, RequestOptions options) { + return client.execute(verifyDomainRequest(organizationId, applicationId), options, VERIFY_DOMAIN_RESPONSE).data(); + } + + /** + * Asynchronous {@link #verifyDomain(String, String, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture verifyDomainAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(verifyDomainRequest(organizationId, applicationId), options, VERIFY_DOMAIN_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #verifyDomain(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupDomain verifyDomain(String organizationId, String applicationId) { + return client.execute(verifyDomainRequest(organizationId, applicationId), RequestOptions.none(), VERIFY_DOMAIN_RESPONSE).data(); + } + + /** + * Asynchronous {@link #verifyDomain(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture verifyDomainAsync(String organizationId, String applicationId) { + return client.executeAsync(verifyDomainRequest(organizationId, applicationId), RequestOptions.none(), VERIFY_DOMAIN_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Activate the custom domain + * + *

Makes the verified domain the application's canonical origin, which moves the issuer and the passkey relying party to it. After activation, /session/ immediately rejects access tokens issued under the old host. Refresh them to obtain access tokens for the new issuer. + * + *

{@code POST /organizations/{organization_id}/applications/{application_id}/authentication/domain/activate/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param options per-request options that override the client options + * @return the response body + */ + public SetupDomain activateDomain(String organizationId, String applicationId, RequestOptions options) { + return client.execute(activateDomainRequest(organizationId, applicationId), options, ACTIVATE_DOMAIN_RESPONSE).data(); + } + + /** + * Asynchronous {@link #activateDomain(String, String, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture activateDomainAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(activateDomainRequest(organizationId, applicationId), options, ACTIVATE_DOMAIN_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #activateDomain(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupDomain activateDomain(String organizationId, String applicationId) { + return client.execute(activateDomainRequest(organizationId, applicationId), RequestOptions.none(), ACTIVATE_DOMAIN_RESPONSE).data(); + } + + /** + * Asynchronous {@link #activateDomain(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture activateDomainAsync(String organizationId, String applicationId) { + return client.executeAsync(activateDomainRequest(organizationId, applicationId), RequestOptions.none(), ACTIVATE_DOMAIN_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Get the native apps + * + *

Returns the iOS app IDs and Android apps that share this application's passkeys, as the association files at the hosted origin publish them. + * + *

{@code GET /organizations/{organization_id}/applications/{application_id}/authentication/native-apps/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param options per-request options that override the client options + * @return the response body + */ + public SetupNativeApps getNativeApps(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getNativeAppsRequest(organizationId, applicationId), options, GET_NATIVE_APPS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getNativeApps(String, String, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture getNativeAppsAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getNativeAppsRequest(organizationId, applicationId), options, GET_NATIVE_APPS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #getNativeApps(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public SetupNativeApps getNativeApps(String organizationId, String applicationId) { + return client.execute(getNativeAppsRequest(organizationId, applicationId), RequestOptions.none(), GET_NATIVE_APPS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #getNativeApps(String, String, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture getNativeAppsAsync(String organizationId, String applicationId) { + return client.executeAsync(getNativeAppsRequest(organizationId, applicationId), RequestOptions.none(), GET_NATIVE_APPS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Update the native apps + * + *

Replaces the lists of iOS app IDs and Android apps. A malformed entry answers a field error in the shape {"ios_app_ids": ["This field is invalid."]}; duplicates are dropped. + * + *

{@code PUT /organizations/{organization_id}/applications/{application_id}/authentication/native-apps/} + * + * @param organizationId UUID of the organization that owns the application. + * @param applicationId UUID of the application: live or sandbox. A named key configures its own application only. + * @param params the request parameters + * @param options per-request options that override the client options + * @return the response body + */ + public SetupNativeApps updateNativeApps(String organizationId, String applicationId, SetupNativeAppsUpdate params, RequestOptions options) { + return client.execute(updateNativeAppsRequest(organizationId, applicationId, params), options, UPDATE_NATIVE_APPS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateNativeApps(String, String, SetupNativeAppsUpdate, RequestOptions)}. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture updateNativeAppsAsync(String organizationId, String applicationId, SetupNativeAppsUpdate params, RequestOptions options) { + return client.executeAsync(updateNativeAppsRequest(organizationId, applicationId, params), options, UPDATE_NATIVE_APPS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #updateNativeApps(String, String, SetupNativeAppsUpdate, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public SetupNativeApps updateNativeApps(String organizationId, String applicationId, SetupNativeAppsUpdate params) { + return client.execute(updateNativeAppsRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_NATIVE_APPS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #updateNativeApps(String, String, SetupNativeAppsUpdate, RequestOptions)}, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture updateNativeAppsAsync(String organizationId, String applicationId, SetupNativeAppsUpdate params) { + return client.executeAsync(updateNativeAppsRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_NATIVE_APPS_RESPONSE).thenApply(RawResponse::data); + } + + private static final ResponseHandler GET_CONFIGURATION_RESPONSE = Responses.json(Conv.model(SetupConfiguration::fromJson)); + + private static ApiRequest getConfigurationRequest(String organizationId, String applicationId) { + return ApiRequest.builder("GET", "/organizations/{organization_id}/applications/{application_id}/authentication/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .build(); + } + + private static final ResponseHandler UPDATE_CONFIGURATION_RESPONSE = Responses.json(Conv.model(SetupConfiguration::fromJson)); + + private static ApiRequest updateConfigurationRequest(String organizationId, String applicationId, SetupConfigurationUpdate params) { + return ApiRequest.builder("PATCH", "/organizations/{organization_id}/applications/{application_id}/authentication/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .params(params) + .body(ApiRequest.BodyEncoding.JSON) + .build(); + } + + private static final ResponseHandler SET_METHOD_RESPONSE = Responses.json(Conv.model(SetupMethodResult::fromJson)); + + private static ApiRequest setMethodRequest(String organizationId, String applicationId, String name, SetupMethodUpdate params) { + return ApiRequest.builder("PUT", "/organizations/{organization_id}/applications/{application_id}/authentication/methods/{name}/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .pathParam("name", name) + .params(params) + .body(ApiRequest.BodyEncoding.JSON) + .build(); + } + + private static final ResponseHandler GET_ONBOARDING_RESPONSE = Responses.json(Conv.model(SetupOnboarding::fromJson)); + + private static ApiRequest getOnboardingRequest(String organizationId, String applicationId) { + return ApiRequest.builder("GET", "/organizations/{organization_id}/applications/{application_id}/authentication/onboarding/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .build(); + } + + private static final ResponseHandler UPDATE_ONBOARDING_RESPONSE = Responses.json(Conv.model(SetupOnboarding::fromJson)); + + private static ApiRequest updateOnboardingRequest(String organizationId, String applicationId, SetupOnboardingUpdate params) { + return ApiRequest.builder("PATCH", "/organizations/{organization_id}/applications/{application_id}/authentication/onboarding/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .params(params) + .body(ApiRequest.BodyEncoding.JSON) + .build(); + } + + private static final ResponseHandler GET_SETTINGS_RESPONSE = Responses.json(Conv.model(SetupSettings::fromJson)); + + private static ApiRequest getSettingsRequest(String organizationId, String applicationId) { + return ApiRequest.builder("GET", "/organizations/{organization_id}/applications/{application_id}/authentication/settings/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .build(); + } + + private static final ResponseHandler UPDATE_SETTINGS_RESPONSE = Responses.json(Conv.model(SetupSettings::fromJson)); + + private static ApiRequest updateSettingsRequest(String organizationId, String applicationId, SetupSettingsUpdate params) { + return ApiRequest.builder("PATCH", "/organizations/{organization_id}/applications/{application_id}/authentication/settings/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .params(params) + .body(ApiRequest.BodyEncoding.JSON) + .build(); + } + + private static final ResponseHandler GET_BRANDING_RESPONSE = Responses.json(Conv.model(SetupBranding::fromJson)); + + private static ApiRequest getBrandingRequest(String organizationId, String applicationId, AuthenticationSetupGetBrandingParams params) { + return ApiRequest.builder("GET", "/organizations/{organization_id}/applications/{application_id}/authentication/branding/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .params(params) + .queryFields("language") + .build(); + } + + private static final ResponseHandler UPDATE_BRANDING_RESPONSE = Responses.json(Conv.model(SetupBranding::fromJson)); + + private static ApiRequest updateBrandingRequest(String organizationId, String applicationId, SetupBrandingUpdate params) { + return ApiRequest.builder("PATCH", "/organizations/{organization_id}/applications/{application_id}/authentication/branding/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .params(params) + .body(ApiRequest.BodyEncoding.JSON) + .build(); + } + + private static final ResponseHandler GET_EMAILS_RESPONSE = Responses.json(Conv.model(SetupEmails::fromJson)); + + private static ApiRequest getEmailsRequest(String organizationId, String applicationId, AuthenticationSetupGetEmailsParams params) { + return ApiRequest.builder("GET", "/organizations/{organization_id}/applications/{application_id}/authentication/emails/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .params(params) + .queryFields("language") + .build(); + } + + private static final ResponseHandler GET_EMAIL_RESPONSE = Responses.json(Conv.model(SetupEmail::fromJson)); + + private static ApiRequest getEmailRequest(String organizationId, String applicationId, String key) { + return ApiRequest.builder("GET", "/organizations/{organization_id}/applications/{application_id}/authentication/emails/{key}/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .pathParam("key", key) + .build(); + } + + private static final ResponseHandler GET_PROTECTION_RESPONSE = Responses.json(Conv.model(SetupProtection::fromJson)); + + private static ApiRequest getProtectionRequest(String organizationId, String applicationId) { + return ApiRequest.builder("GET", "/organizations/{organization_id}/applications/{application_id}/authentication/protection/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .build(); + } + + private static final ResponseHandler UPDATE_PROTECTION_RESPONSE = Responses.json(Conv.model(SetupProtection::fromJson)); + + private static ApiRequest updateProtectionRequest(String organizationId, String applicationId, SetupProtectionUpdate params) { + return ApiRequest.builder("PATCH", "/organizations/{organization_id}/applications/{application_id}/authentication/protection/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .params(params) + .body(ApiRequest.BodyEncoding.JSON) + .build(); + } + + private static final ResponseHandler GET_VERIFIED_RESPONSE = Responses.json(Conv.model(SetupVerified::fromJson)); + + private static ApiRequest getVerifiedRequest(String organizationId, String applicationId) { + return ApiRequest.builder("GET", "/organizations/{organization_id}/applications/{application_id}/authentication/verified/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .build(); + } + + private static final ResponseHandler UPDATE_VERIFIED_RESPONSE = Responses.json(Conv.model(SetupVerified::fromJson)); + + private static ApiRequest updateVerifiedRequest(String organizationId, String applicationId, SetupVerifiedUpdate params) { + return ApiRequest.builder("PATCH", "/organizations/{organization_id}/applications/{application_id}/authentication/verified/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .params(params) + .body(ApiRequest.BodyEncoding.JSON) + .build(); + } + + private static final ResponseHandler GET_DOMAIN_RESPONSE = Responses.json(Conv.model(SetupDomain::fromJson)); + + private static ApiRequest getDomainRequest(String organizationId, String applicationId) { + return ApiRequest.builder("GET", "/organizations/{organization_id}/applications/{application_id}/authentication/domain/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .build(); + } + + private static final ResponseHandler SET_DOMAIN_RESPONSE = Responses.json(Conv.model(SetupDomain::fromJson)); + + private static ApiRequest setDomainRequest(String organizationId, String applicationId, SetupDomainRequest params) { + return ApiRequest.builder("PUT", "/organizations/{organization_id}/applications/{application_id}/authentication/domain/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .params(params) + .body(ApiRequest.BodyEncoding.JSON) + .build(); + } + + private static final ResponseHandler REMOVE_DOMAIN_RESPONSE = Responses.json(Conv.model(SetupDomain::fromJson)); + + private static ApiRequest removeDomainRequest(String organizationId, String applicationId) { + return ApiRequest.builder("DELETE", "/organizations/{organization_id}/applications/{application_id}/authentication/domain/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .build(); + } + + private static final ResponseHandler VERIFY_DOMAIN_RESPONSE = Responses.json(Conv.model(SetupDomain::fromJson)); + + private static ApiRequest verifyDomainRequest(String organizationId, String applicationId) { + return ApiRequest.builder("POST", "/organizations/{organization_id}/applications/{application_id}/authentication/domain/verify/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .build(); + } + + private static final ResponseHandler ACTIVATE_DOMAIN_RESPONSE = Responses.json(Conv.model(SetupDomain::fromJson)); + + private static ApiRequest activateDomainRequest(String organizationId, String applicationId) { + return ApiRequest.builder("POST", "/organizations/{organization_id}/applications/{application_id}/authentication/domain/activate/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .build(); + } + + private static final ResponseHandler GET_NATIVE_APPS_RESPONSE = Responses.json(Conv.model(SetupNativeApps::fromJson)); + + private static ApiRequest getNativeAppsRequest(String organizationId, String applicationId) { + return ApiRequest.builder("GET", "/organizations/{organization_id}/applications/{application_id}/authentication/native-apps/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .build(); + } + + private static final ResponseHandler UPDATE_NATIVE_APPS_RESPONSE = Responses.json(Conv.model(SetupNativeApps::fromJson)); + + private static ApiRequest updateNativeAppsRequest(String organizationId, String applicationId, SetupNativeAppsUpdate params) { + return ApiRequest.builder("PUT", "/organizations/{organization_id}/applications/{application_id}/authentication/native-apps/") + .account() + .pathParam("organization_id", organizationId) + .pathParam("application_id", applicationId) + .params(params) + .body(ApiRequest.BodyEncoding.JSON) + .build(); + } + + /** The {@code authentication_setup} operations returning {@link RawResponse}. */ + public static final class WithRawResponse { + private final ApiClient client; + + WithRawResponse(ApiClient client) { + this.client = client; + } + + /** + * {@link #getConfiguration(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse getConfiguration(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getConfigurationRequest(organizationId, applicationId), options, GET_CONFIGURATION_RESPONSE); + } + + /** + * Asynchronous {@link #getConfiguration(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> getConfigurationAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getConfigurationRequest(organizationId, applicationId), options, GET_CONFIGURATION_RESPONSE); + } + + /** + * {@link #getConfiguration(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse getConfiguration(String organizationId, String applicationId) { + return client.execute(getConfigurationRequest(organizationId, applicationId), RequestOptions.none(), GET_CONFIGURATION_RESPONSE); + } + + /** + * Asynchronous {@link #getConfiguration(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> getConfigurationAsync(String organizationId, String applicationId) { + return client.executeAsync(getConfigurationRequest(organizationId, applicationId), RequestOptions.none(), GET_CONFIGURATION_RESPONSE); + } + + /** + * {@link #updateConfiguration(String, String, SetupConfigurationUpdate, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return the result + */ + public RawResponse updateConfiguration(String organizationId, String applicationId, SetupConfigurationUpdate params, RequestOptions options) { + return client.execute(updateConfigurationRequest(organizationId, applicationId, params), options, UPDATE_CONFIGURATION_RESPONSE); + } + + /** + * Asynchronous {@link #updateConfiguration(String, String, SetupConfigurationUpdate, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> updateConfigurationAsync(String organizationId, String applicationId, SetupConfigurationUpdate params, RequestOptions options) { + return client.executeAsync(updateConfigurationRequest(organizationId, applicationId, params), options, UPDATE_CONFIGURATION_RESPONSE); + } + + /** + * {@link #updateConfiguration(String, String, SetupConfigurationUpdate, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public RawResponse updateConfiguration(String organizationId, String applicationId, SetupConfigurationUpdate params) { + return client.execute(updateConfigurationRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_CONFIGURATION_RESPONSE); + } + + /** + * Asynchronous {@link #updateConfiguration(String, String, SetupConfigurationUpdate, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture> updateConfigurationAsync(String organizationId, String applicationId, SetupConfigurationUpdate params) { + return client.executeAsync(updateConfigurationRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_CONFIGURATION_RESPONSE); + } + + /** + * {@link #updateConfiguration(String, String, SetupConfigurationUpdate, RequestOptions)} with the raw response, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse updateConfiguration(String organizationId, String applicationId, RequestOptions options) { + return client.execute(updateConfigurationRequest(organizationId, applicationId, SetupConfigurationUpdate.builder().build()), options, UPDATE_CONFIGURATION_RESPONSE); + } + + /** + * Asynchronous {@link #updateConfiguration(String, String, SetupConfigurationUpdate, RequestOptions)} with the raw response, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> updateConfigurationAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(updateConfigurationRequest(organizationId, applicationId, SetupConfigurationUpdate.builder().build()), options, UPDATE_CONFIGURATION_RESPONSE); + } + + /** + * {@link #updateConfiguration(String, String, SetupConfigurationUpdate, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse updateConfiguration(String organizationId, String applicationId) { + return client.execute(updateConfigurationRequest(organizationId, applicationId, SetupConfigurationUpdate.builder().build()), RequestOptions.none(), UPDATE_CONFIGURATION_RESPONSE); + } + + /** + * Asynchronous {@link #updateConfiguration(String, String, SetupConfigurationUpdate, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> updateConfigurationAsync(String organizationId, String applicationId) { + return client.executeAsync(updateConfigurationRequest(organizationId, applicationId, SetupConfigurationUpdate.builder().build()), RequestOptions.none(), UPDATE_CONFIGURATION_RESPONSE); + } + + /** + * {@link #setMethod(String, String, String, SetupMethodUpdate, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param name the {@code name} + * @param params the request parameters + * @param options per-request options + * @return the result + */ + public RawResponse setMethod(String organizationId, String applicationId, String name, SetupMethodUpdate params, RequestOptions options) { + return client.execute(setMethodRequest(organizationId, applicationId, name, params), options, SET_METHOD_RESPONSE); + } + + /** + * Asynchronous {@link #setMethod(String, String, String, SetupMethodUpdate, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param name the {@code name} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> setMethodAsync(String organizationId, String applicationId, String name, SetupMethodUpdate params, RequestOptions options) { + return client.executeAsync(setMethodRequest(organizationId, applicationId, name, params), options, SET_METHOD_RESPONSE); + } + + /** + * {@link #setMethod(String, String, String, SetupMethodUpdate, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param name the {@code name} + * @param params the request parameters + * @return the result + */ + public RawResponse setMethod(String organizationId, String applicationId, String name, SetupMethodUpdate params) { + return client.execute(setMethodRequest(organizationId, applicationId, name, params), RequestOptions.none(), SET_METHOD_RESPONSE); + } + + /** + * Asynchronous {@link #setMethod(String, String, String, SetupMethodUpdate, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param name the {@code name} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture> setMethodAsync(String organizationId, String applicationId, String name, SetupMethodUpdate params) { + return client.executeAsync(setMethodRequest(organizationId, applicationId, name, params), RequestOptions.none(), SET_METHOD_RESPONSE); + } + + /** + * {@link #getOnboarding(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse getOnboarding(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getOnboardingRequest(organizationId, applicationId), options, GET_ONBOARDING_RESPONSE); + } + + /** + * Asynchronous {@link #getOnboarding(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> getOnboardingAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getOnboardingRequest(organizationId, applicationId), options, GET_ONBOARDING_RESPONSE); + } + + /** + * {@link #getOnboarding(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse getOnboarding(String organizationId, String applicationId) { + return client.execute(getOnboardingRequest(organizationId, applicationId), RequestOptions.none(), GET_ONBOARDING_RESPONSE); + } + + /** + * Asynchronous {@link #getOnboarding(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> getOnboardingAsync(String organizationId, String applicationId) { + return client.executeAsync(getOnboardingRequest(organizationId, applicationId), RequestOptions.none(), GET_ONBOARDING_RESPONSE); + } + + /** + * {@link #updateOnboarding(String, String, SetupOnboardingUpdate, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return the result + */ + public RawResponse updateOnboarding(String organizationId, String applicationId, SetupOnboardingUpdate params, RequestOptions options) { + return client.execute(updateOnboardingRequest(organizationId, applicationId, params), options, UPDATE_ONBOARDING_RESPONSE); + } + + /** + * Asynchronous {@link #updateOnboarding(String, String, SetupOnboardingUpdate, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> updateOnboardingAsync(String organizationId, String applicationId, SetupOnboardingUpdate params, RequestOptions options) { + return client.executeAsync(updateOnboardingRequest(organizationId, applicationId, params), options, UPDATE_ONBOARDING_RESPONSE); + } + + /** + * {@link #updateOnboarding(String, String, SetupOnboardingUpdate, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public RawResponse updateOnboarding(String organizationId, String applicationId, SetupOnboardingUpdate params) { + return client.execute(updateOnboardingRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_ONBOARDING_RESPONSE); + } + + /** + * Asynchronous {@link #updateOnboarding(String, String, SetupOnboardingUpdate, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture> updateOnboardingAsync(String organizationId, String applicationId, SetupOnboardingUpdate params) { + return client.executeAsync(updateOnboardingRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_ONBOARDING_RESPONSE); + } + + /** + * {@link #updateOnboarding(String, String, SetupOnboardingUpdate, RequestOptions)} with the raw response, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse updateOnboarding(String organizationId, String applicationId, RequestOptions options) { + return client.execute(updateOnboardingRequest(organizationId, applicationId, SetupOnboardingUpdate.builder().build()), options, UPDATE_ONBOARDING_RESPONSE); + } + + /** + * Asynchronous {@link #updateOnboarding(String, String, SetupOnboardingUpdate, RequestOptions)} with the raw response, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> updateOnboardingAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(updateOnboardingRequest(organizationId, applicationId, SetupOnboardingUpdate.builder().build()), options, UPDATE_ONBOARDING_RESPONSE); + } + + /** + * {@link #updateOnboarding(String, String, SetupOnboardingUpdate, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse updateOnboarding(String organizationId, String applicationId) { + return client.execute(updateOnboardingRequest(organizationId, applicationId, SetupOnboardingUpdate.builder().build()), RequestOptions.none(), UPDATE_ONBOARDING_RESPONSE); + } + + /** + * Asynchronous {@link #updateOnboarding(String, String, SetupOnboardingUpdate, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> updateOnboardingAsync(String organizationId, String applicationId) { + return client.executeAsync(updateOnboardingRequest(organizationId, applicationId, SetupOnboardingUpdate.builder().build()), RequestOptions.none(), UPDATE_ONBOARDING_RESPONSE); + } + + /** + * {@link #getSettings(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse getSettings(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getSettingsRequest(organizationId, applicationId), options, GET_SETTINGS_RESPONSE); + } + + /** + * Asynchronous {@link #getSettings(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> getSettingsAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getSettingsRequest(organizationId, applicationId), options, GET_SETTINGS_RESPONSE); + } + + /** + * {@link #getSettings(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse getSettings(String organizationId, String applicationId) { + return client.execute(getSettingsRequest(organizationId, applicationId), RequestOptions.none(), GET_SETTINGS_RESPONSE); + } + + /** + * Asynchronous {@link #getSettings(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> getSettingsAsync(String organizationId, String applicationId) { + return client.executeAsync(getSettingsRequest(organizationId, applicationId), RequestOptions.none(), GET_SETTINGS_RESPONSE); + } + + /** + * {@link #updateSettings(String, String, SetupSettingsUpdate, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return the result + */ + public RawResponse updateSettings(String organizationId, String applicationId, SetupSettingsUpdate params, RequestOptions options) { + return client.execute(updateSettingsRequest(organizationId, applicationId, params), options, UPDATE_SETTINGS_RESPONSE); + } + + /** + * Asynchronous {@link #updateSettings(String, String, SetupSettingsUpdate, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> updateSettingsAsync(String organizationId, String applicationId, SetupSettingsUpdate params, RequestOptions options) { + return client.executeAsync(updateSettingsRequest(organizationId, applicationId, params), options, UPDATE_SETTINGS_RESPONSE); + } + + /** + * {@link #updateSettings(String, String, SetupSettingsUpdate, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public RawResponse updateSettings(String organizationId, String applicationId, SetupSettingsUpdate params) { + return client.execute(updateSettingsRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_SETTINGS_RESPONSE); + } + + /** + * Asynchronous {@link #updateSettings(String, String, SetupSettingsUpdate, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture> updateSettingsAsync(String organizationId, String applicationId, SetupSettingsUpdate params) { + return client.executeAsync(updateSettingsRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_SETTINGS_RESPONSE); + } + + /** + * {@link #updateSettings(String, String, SetupSettingsUpdate, RequestOptions)} with the raw response, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse updateSettings(String organizationId, String applicationId, RequestOptions options) { + return client.execute(updateSettingsRequest(organizationId, applicationId, SetupSettingsUpdate.builder().build()), options, UPDATE_SETTINGS_RESPONSE); + } + + /** + * Asynchronous {@link #updateSettings(String, String, SetupSettingsUpdate, RequestOptions)} with the raw response, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> updateSettingsAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(updateSettingsRequest(organizationId, applicationId, SetupSettingsUpdate.builder().build()), options, UPDATE_SETTINGS_RESPONSE); + } + + /** + * {@link #updateSettings(String, String, SetupSettingsUpdate, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse updateSettings(String organizationId, String applicationId) { + return client.execute(updateSettingsRequest(organizationId, applicationId, SetupSettingsUpdate.builder().build()), RequestOptions.none(), UPDATE_SETTINGS_RESPONSE); + } + + /** + * Asynchronous {@link #updateSettings(String, String, SetupSettingsUpdate, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> updateSettingsAsync(String organizationId, String applicationId) { + return client.executeAsync(updateSettingsRequest(organizationId, applicationId, SetupSettingsUpdate.builder().build()), RequestOptions.none(), UPDATE_SETTINGS_RESPONSE); + } + + /** + * {@link #getBranding(String, String, AuthenticationSetupGetBrandingParams, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return the result + */ + public RawResponse getBranding(String organizationId, String applicationId, AuthenticationSetupGetBrandingParams params, RequestOptions options) { + return client.execute(getBrandingRequest(organizationId, applicationId, params), options, GET_BRANDING_RESPONSE); + } + + /** + * Asynchronous {@link #getBranding(String, String, AuthenticationSetupGetBrandingParams, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> getBrandingAsync(String organizationId, String applicationId, AuthenticationSetupGetBrandingParams params, RequestOptions options) { + return client.executeAsync(getBrandingRequest(organizationId, applicationId, params), options, GET_BRANDING_RESPONSE); + } + + /** + * {@link #getBranding(String, String, AuthenticationSetupGetBrandingParams, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public RawResponse getBranding(String organizationId, String applicationId, AuthenticationSetupGetBrandingParams params) { + return client.execute(getBrandingRequest(organizationId, applicationId, params), RequestOptions.none(), GET_BRANDING_RESPONSE); + } + + /** + * Asynchronous {@link #getBranding(String, String, AuthenticationSetupGetBrandingParams, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture> getBrandingAsync(String organizationId, String applicationId, AuthenticationSetupGetBrandingParams params) { + return client.executeAsync(getBrandingRequest(organizationId, applicationId, params), RequestOptions.none(), GET_BRANDING_RESPONSE); + } + + /** + * {@link #getBranding(String, String, AuthenticationSetupGetBrandingParams, RequestOptions)} with the raw response, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse getBranding(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getBrandingRequest(organizationId, applicationId, AuthenticationSetupGetBrandingParams.builder().build()), options, GET_BRANDING_RESPONSE); + } + + /** + * Asynchronous {@link #getBranding(String, String, AuthenticationSetupGetBrandingParams, RequestOptions)} with the raw response, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> getBrandingAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getBrandingRequest(organizationId, applicationId, AuthenticationSetupGetBrandingParams.builder().build()), options, GET_BRANDING_RESPONSE); + } + + /** + * {@link #getBranding(String, String, AuthenticationSetupGetBrandingParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse getBranding(String organizationId, String applicationId) { + return client.execute(getBrandingRequest(organizationId, applicationId, AuthenticationSetupGetBrandingParams.builder().build()), RequestOptions.none(), GET_BRANDING_RESPONSE); + } + + /** + * Asynchronous {@link #getBranding(String, String, AuthenticationSetupGetBrandingParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> getBrandingAsync(String organizationId, String applicationId) { + return client.executeAsync(getBrandingRequest(organizationId, applicationId, AuthenticationSetupGetBrandingParams.builder().build()), RequestOptions.none(), GET_BRANDING_RESPONSE); + } + + /** + * {@link #updateBranding(String, String, SetupBrandingUpdate, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return the result + */ + public RawResponse updateBranding(String organizationId, String applicationId, SetupBrandingUpdate params, RequestOptions options) { + return client.execute(updateBrandingRequest(organizationId, applicationId, params), options, UPDATE_BRANDING_RESPONSE); + } + + /** + * Asynchronous {@link #updateBranding(String, String, SetupBrandingUpdate, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> updateBrandingAsync(String organizationId, String applicationId, SetupBrandingUpdate params, RequestOptions options) { + return client.executeAsync(updateBrandingRequest(organizationId, applicationId, params), options, UPDATE_BRANDING_RESPONSE); + } + + /** + * {@link #updateBranding(String, String, SetupBrandingUpdate, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public RawResponse updateBranding(String organizationId, String applicationId, SetupBrandingUpdate params) { + return client.execute(updateBrandingRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_BRANDING_RESPONSE); + } + + /** + * Asynchronous {@link #updateBranding(String, String, SetupBrandingUpdate, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture> updateBrandingAsync(String organizationId, String applicationId, SetupBrandingUpdate params) { + return client.executeAsync(updateBrandingRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_BRANDING_RESPONSE); + } + + /** + * {@link #updateBranding(String, String, SetupBrandingUpdate, RequestOptions)} with the raw response, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse updateBranding(String organizationId, String applicationId, RequestOptions options) { + return client.execute(updateBrandingRequest(organizationId, applicationId, SetupBrandingUpdate.builder().build()), options, UPDATE_BRANDING_RESPONSE); + } + + /** + * Asynchronous {@link #updateBranding(String, String, SetupBrandingUpdate, RequestOptions)} with the raw response, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> updateBrandingAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(updateBrandingRequest(organizationId, applicationId, SetupBrandingUpdate.builder().build()), options, UPDATE_BRANDING_RESPONSE); + } + + /** + * {@link #updateBranding(String, String, SetupBrandingUpdate, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse updateBranding(String organizationId, String applicationId) { + return client.execute(updateBrandingRequest(organizationId, applicationId, SetupBrandingUpdate.builder().build()), RequestOptions.none(), UPDATE_BRANDING_RESPONSE); + } + + /** + * Asynchronous {@link #updateBranding(String, String, SetupBrandingUpdate, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> updateBrandingAsync(String organizationId, String applicationId) { + return client.executeAsync(updateBrandingRequest(organizationId, applicationId, SetupBrandingUpdate.builder().build()), RequestOptions.none(), UPDATE_BRANDING_RESPONSE); + } + + /** + * {@link #getEmails(String, String, AuthenticationSetupGetEmailsParams, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return the result + */ + public RawResponse getEmails(String organizationId, String applicationId, AuthenticationSetupGetEmailsParams params, RequestOptions options) { + return client.execute(getEmailsRequest(organizationId, applicationId, params), options, GET_EMAILS_RESPONSE); + } + + /** + * Asynchronous {@link #getEmails(String, String, AuthenticationSetupGetEmailsParams, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> getEmailsAsync(String organizationId, String applicationId, AuthenticationSetupGetEmailsParams params, RequestOptions options) { + return client.executeAsync(getEmailsRequest(organizationId, applicationId, params), options, GET_EMAILS_RESPONSE); + } + + /** + * {@link #getEmails(String, String, AuthenticationSetupGetEmailsParams, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public RawResponse getEmails(String organizationId, String applicationId, AuthenticationSetupGetEmailsParams params) { + return client.execute(getEmailsRequest(organizationId, applicationId, params), RequestOptions.none(), GET_EMAILS_RESPONSE); + } + + /** + * Asynchronous {@link #getEmails(String, String, AuthenticationSetupGetEmailsParams, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture> getEmailsAsync(String organizationId, String applicationId, AuthenticationSetupGetEmailsParams params) { + return client.executeAsync(getEmailsRequest(organizationId, applicationId, params), RequestOptions.none(), GET_EMAILS_RESPONSE); + } + + /** + * {@link #getEmails(String, String, AuthenticationSetupGetEmailsParams, RequestOptions)} with the raw response, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse getEmails(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getEmailsRequest(organizationId, applicationId, AuthenticationSetupGetEmailsParams.builder().build()), options, GET_EMAILS_RESPONSE); + } + + /** + * Asynchronous {@link #getEmails(String, String, AuthenticationSetupGetEmailsParams, RequestOptions)} with the raw response, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> getEmailsAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getEmailsRequest(organizationId, applicationId, AuthenticationSetupGetEmailsParams.builder().build()), options, GET_EMAILS_RESPONSE); + } + + /** + * {@link #getEmails(String, String, AuthenticationSetupGetEmailsParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse getEmails(String organizationId, String applicationId) { + return client.execute(getEmailsRequest(organizationId, applicationId, AuthenticationSetupGetEmailsParams.builder().build()), RequestOptions.none(), GET_EMAILS_RESPONSE); + } + + /** + * Asynchronous {@link #getEmails(String, String, AuthenticationSetupGetEmailsParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> getEmailsAsync(String organizationId, String applicationId) { + return client.executeAsync(getEmailsRequest(organizationId, applicationId, AuthenticationSetupGetEmailsParams.builder().build()), RequestOptions.none(), GET_EMAILS_RESPONSE); + } + + /** + * {@link #getEmail(String, String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param key the {@code key} + * @param options per-request options + * @return the result + */ + public RawResponse getEmail(String organizationId, String applicationId, String key, RequestOptions options) { + return client.execute(getEmailRequest(organizationId, applicationId, key), options, GET_EMAIL_RESPONSE); + } + + /** + * Asynchronous {@link #getEmail(String, String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param key the {@code key} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> getEmailAsync(String organizationId, String applicationId, String key, RequestOptions options) { + return client.executeAsync(getEmailRequest(organizationId, applicationId, key), options, GET_EMAIL_RESPONSE); + } + + /** + * {@link #getEmail(String, String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param key the {@code key} + * @return the result + */ + public RawResponse getEmail(String organizationId, String applicationId, String key) { + return client.execute(getEmailRequest(organizationId, applicationId, key), RequestOptions.none(), GET_EMAIL_RESPONSE); + } + + /** + * Asynchronous {@link #getEmail(String, String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param key the {@code key} + * @return a future completed with the result + */ + public CompletableFuture> getEmailAsync(String organizationId, String applicationId, String key) { + return client.executeAsync(getEmailRequest(organizationId, applicationId, key), RequestOptions.none(), GET_EMAIL_RESPONSE); + } + + /** + * {@link #getProtection(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse getProtection(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getProtectionRequest(organizationId, applicationId), options, GET_PROTECTION_RESPONSE); + } + + /** + * Asynchronous {@link #getProtection(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> getProtectionAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getProtectionRequest(organizationId, applicationId), options, GET_PROTECTION_RESPONSE); + } + + /** + * {@link #getProtection(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse getProtection(String organizationId, String applicationId) { + return client.execute(getProtectionRequest(organizationId, applicationId), RequestOptions.none(), GET_PROTECTION_RESPONSE); + } + + /** + * Asynchronous {@link #getProtection(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> getProtectionAsync(String organizationId, String applicationId) { + return client.executeAsync(getProtectionRequest(organizationId, applicationId), RequestOptions.none(), GET_PROTECTION_RESPONSE); + } + + /** + * {@link #updateProtection(String, String, SetupProtectionUpdate, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return the result + */ + public RawResponse updateProtection(String organizationId, String applicationId, SetupProtectionUpdate params, RequestOptions options) { + return client.execute(updateProtectionRequest(organizationId, applicationId, params), options, UPDATE_PROTECTION_RESPONSE); + } + + /** + * Asynchronous {@link #updateProtection(String, String, SetupProtectionUpdate, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> updateProtectionAsync(String organizationId, String applicationId, SetupProtectionUpdate params, RequestOptions options) { + return client.executeAsync(updateProtectionRequest(organizationId, applicationId, params), options, UPDATE_PROTECTION_RESPONSE); + } + + /** + * {@link #updateProtection(String, String, SetupProtectionUpdate, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public RawResponse updateProtection(String organizationId, String applicationId, SetupProtectionUpdate params) { + return client.execute(updateProtectionRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_PROTECTION_RESPONSE); + } + + /** + * Asynchronous {@link #updateProtection(String, String, SetupProtectionUpdate, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture> updateProtectionAsync(String organizationId, String applicationId, SetupProtectionUpdate params) { + return client.executeAsync(updateProtectionRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_PROTECTION_RESPONSE); + } + + /** + * {@link #updateProtection(String, String, SetupProtectionUpdate, RequestOptions)} with the raw response, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse updateProtection(String organizationId, String applicationId, RequestOptions options) { + return client.execute(updateProtectionRequest(organizationId, applicationId, SetupProtectionUpdate.builder().build()), options, UPDATE_PROTECTION_RESPONSE); + } + + /** + * Asynchronous {@link #updateProtection(String, String, SetupProtectionUpdate, RequestOptions)} with the raw response, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> updateProtectionAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(updateProtectionRequest(organizationId, applicationId, SetupProtectionUpdate.builder().build()), options, UPDATE_PROTECTION_RESPONSE); + } + + /** + * {@link #updateProtection(String, String, SetupProtectionUpdate, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse updateProtection(String organizationId, String applicationId) { + return client.execute(updateProtectionRequest(organizationId, applicationId, SetupProtectionUpdate.builder().build()), RequestOptions.none(), UPDATE_PROTECTION_RESPONSE); + } + + /** + * Asynchronous {@link #updateProtection(String, String, SetupProtectionUpdate, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> updateProtectionAsync(String organizationId, String applicationId) { + return client.executeAsync(updateProtectionRequest(organizationId, applicationId, SetupProtectionUpdate.builder().build()), RequestOptions.none(), UPDATE_PROTECTION_RESPONSE); + } + + /** + * {@link #getVerified(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse getVerified(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getVerifiedRequest(organizationId, applicationId), options, GET_VERIFIED_RESPONSE); + } + + /** + * Asynchronous {@link #getVerified(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> getVerifiedAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getVerifiedRequest(organizationId, applicationId), options, GET_VERIFIED_RESPONSE); + } + + /** + * {@link #getVerified(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse getVerified(String organizationId, String applicationId) { + return client.execute(getVerifiedRequest(organizationId, applicationId), RequestOptions.none(), GET_VERIFIED_RESPONSE); + } + + /** + * Asynchronous {@link #getVerified(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> getVerifiedAsync(String organizationId, String applicationId) { + return client.executeAsync(getVerifiedRequest(organizationId, applicationId), RequestOptions.none(), GET_VERIFIED_RESPONSE); + } + + /** + * {@link #updateVerified(String, String, SetupVerifiedUpdate, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return the result + */ + public RawResponse updateVerified(String organizationId, String applicationId, SetupVerifiedUpdate params, RequestOptions options) { + return client.execute(updateVerifiedRequest(organizationId, applicationId, params), options, UPDATE_VERIFIED_RESPONSE); + } + + /** + * Asynchronous {@link #updateVerified(String, String, SetupVerifiedUpdate, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> updateVerifiedAsync(String organizationId, String applicationId, SetupVerifiedUpdate params, RequestOptions options) { + return client.executeAsync(updateVerifiedRequest(organizationId, applicationId, params), options, UPDATE_VERIFIED_RESPONSE); + } + + /** + * {@link #updateVerified(String, String, SetupVerifiedUpdate, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public RawResponse updateVerified(String organizationId, String applicationId, SetupVerifiedUpdate params) { + return client.execute(updateVerifiedRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_VERIFIED_RESPONSE); + } + + /** + * Asynchronous {@link #updateVerified(String, String, SetupVerifiedUpdate, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture> updateVerifiedAsync(String organizationId, String applicationId, SetupVerifiedUpdate params) { + return client.executeAsync(updateVerifiedRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_VERIFIED_RESPONSE); + } + + /** + * {@link #updateVerified(String, String, SetupVerifiedUpdate, RequestOptions)} with the raw response, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse updateVerified(String organizationId, String applicationId, RequestOptions options) { + return client.execute(updateVerifiedRequest(organizationId, applicationId, SetupVerifiedUpdate.builder().build()), options, UPDATE_VERIFIED_RESPONSE); + } + + /** + * Asynchronous {@link #updateVerified(String, String, SetupVerifiedUpdate, RequestOptions)} with the raw response, without parameters. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> updateVerifiedAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(updateVerifiedRequest(organizationId, applicationId, SetupVerifiedUpdate.builder().build()), options, UPDATE_VERIFIED_RESPONSE); + } + + /** + * {@link #updateVerified(String, String, SetupVerifiedUpdate, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse updateVerified(String organizationId, String applicationId) { + return client.execute(updateVerifiedRequest(organizationId, applicationId, SetupVerifiedUpdate.builder().build()), RequestOptions.none(), UPDATE_VERIFIED_RESPONSE); + } + + /** + * Asynchronous {@link #updateVerified(String, String, SetupVerifiedUpdate, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> updateVerifiedAsync(String organizationId, String applicationId) { + return client.executeAsync(updateVerifiedRequest(organizationId, applicationId, SetupVerifiedUpdate.builder().build()), RequestOptions.none(), UPDATE_VERIFIED_RESPONSE); + } + + /** + * {@link #getDomain(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse getDomain(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getDomainRequest(organizationId, applicationId), options, GET_DOMAIN_RESPONSE); + } + + /** + * Asynchronous {@link #getDomain(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> getDomainAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getDomainRequest(organizationId, applicationId), options, GET_DOMAIN_RESPONSE); + } + + /** + * {@link #getDomain(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse getDomain(String organizationId, String applicationId) { + return client.execute(getDomainRequest(organizationId, applicationId), RequestOptions.none(), GET_DOMAIN_RESPONSE); + } + + /** + * Asynchronous {@link #getDomain(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> getDomainAsync(String organizationId, String applicationId) { + return client.executeAsync(getDomainRequest(organizationId, applicationId), RequestOptions.none(), GET_DOMAIN_RESPONSE); + } + + /** + * {@link #setDomain(String, String, SetupDomainRequest, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return the result + */ + public RawResponse setDomain(String organizationId, String applicationId, SetupDomainRequest params, RequestOptions options) { + return client.execute(setDomainRequest(organizationId, applicationId, params), options, SET_DOMAIN_RESPONSE); + } + + /** + * Asynchronous {@link #setDomain(String, String, SetupDomainRequest, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> setDomainAsync(String organizationId, String applicationId, SetupDomainRequest params, RequestOptions options) { + return client.executeAsync(setDomainRequest(organizationId, applicationId, params), options, SET_DOMAIN_RESPONSE); + } + + /** + * {@link #setDomain(String, String, SetupDomainRequest, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public RawResponse setDomain(String organizationId, String applicationId, SetupDomainRequest params) { + return client.execute(setDomainRequest(organizationId, applicationId, params), RequestOptions.none(), SET_DOMAIN_RESPONSE); + } + + /** + * Asynchronous {@link #setDomain(String, String, SetupDomainRequest, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture> setDomainAsync(String organizationId, String applicationId, SetupDomainRequest params) { + return client.executeAsync(setDomainRequest(organizationId, applicationId, params), RequestOptions.none(), SET_DOMAIN_RESPONSE); + } + + /** + * {@link #removeDomain(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse removeDomain(String organizationId, String applicationId, RequestOptions options) { + return client.execute(removeDomainRequest(organizationId, applicationId), options, REMOVE_DOMAIN_RESPONSE); + } + + /** + * Asynchronous {@link #removeDomain(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> removeDomainAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(removeDomainRequest(organizationId, applicationId), options, REMOVE_DOMAIN_RESPONSE); + } + + /** + * {@link #removeDomain(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse removeDomain(String organizationId, String applicationId) { + return client.execute(removeDomainRequest(organizationId, applicationId), RequestOptions.none(), REMOVE_DOMAIN_RESPONSE); + } + + /** + * Asynchronous {@link #removeDomain(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> removeDomainAsync(String organizationId, String applicationId) { + return client.executeAsync(removeDomainRequest(organizationId, applicationId), RequestOptions.none(), REMOVE_DOMAIN_RESPONSE); + } + + /** + * {@link #verifyDomain(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse verifyDomain(String organizationId, String applicationId, RequestOptions options) { + return client.execute(verifyDomainRequest(organizationId, applicationId), options, VERIFY_DOMAIN_RESPONSE); + } + + /** + * Asynchronous {@link #verifyDomain(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> verifyDomainAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(verifyDomainRequest(organizationId, applicationId), options, VERIFY_DOMAIN_RESPONSE); + } + + /** + * {@link #verifyDomain(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse verifyDomain(String organizationId, String applicationId) { + return client.execute(verifyDomainRequest(organizationId, applicationId), RequestOptions.none(), VERIFY_DOMAIN_RESPONSE); + } + + /** + * Asynchronous {@link #verifyDomain(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> verifyDomainAsync(String organizationId, String applicationId) { + return client.executeAsync(verifyDomainRequest(organizationId, applicationId), RequestOptions.none(), VERIFY_DOMAIN_RESPONSE); + } + + /** + * {@link #activateDomain(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse activateDomain(String organizationId, String applicationId, RequestOptions options) { + return client.execute(activateDomainRequest(organizationId, applicationId), options, ACTIVATE_DOMAIN_RESPONSE); + } + + /** + * Asynchronous {@link #activateDomain(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> activateDomainAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(activateDomainRequest(organizationId, applicationId), options, ACTIVATE_DOMAIN_RESPONSE); + } + + /** + * {@link #activateDomain(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse activateDomain(String organizationId, String applicationId) { + return client.execute(activateDomainRequest(organizationId, applicationId), RequestOptions.none(), ACTIVATE_DOMAIN_RESPONSE); + } + + /** + * Asynchronous {@link #activateDomain(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> activateDomainAsync(String organizationId, String applicationId) { + return client.executeAsync(activateDomainRequest(organizationId, applicationId), RequestOptions.none(), ACTIVATE_DOMAIN_RESPONSE); + } + + /** + * {@link #getNativeApps(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return the result + */ + public RawResponse getNativeApps(String organizationId, String applicationId, RequestOptions options) { + return client.execute(getNativeAppsRequest(organizationId, applicationId), options, GET_NATIVE_APPS_RESPONSE); + } + + /** + * Asynchronous {@link #getNativeApps(String, String, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> getNativeAppsAsync(String organizationId, String applicationId, RequestOptions options) { + return client.executeAsync(getNativeAppsRequest(organizationId, applicationId), options, GET_NATIVE_APPS_RESPONSE); + } + + /** + * {@link #getNativeApps(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return the result + */ + public RawResponse getNativeApps(String organizationId, String applicationId) { + return client.execute(getNativeAppsRequest(organizationId, applicationId), RequestOptions.none(), GET_NATIVE_APPS_RESPONSE); + } + + /** + * Asynchronous {@link #getNativeApps(String, String, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @return a future completed with the result + */ + public CompletableFuture> getNativeAppsAsync(String organizationId, String applicationId) { + return client.executeAsync(getNativeAppsRequest(organizationId, applicationId), RequestOptions.none(), GET_NATIVE_APPS_RESPONSE); + } + + /** + * {@link #updateNativeApps(String, String, SetupNativeAppsUpdate, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return the result + */ + public RawResponse updateNativeApps(String organizationId, String applicationId, SetupNativeAppsUpdate params, RequestOptions options) { + return client.execute(updateNativeAppsRequest(organizationId, applicationId, params), options, UPDATE_NATIVE_APPS_RESPONSE); + } + + /** + * Asynchronous {@link #updateNativeApps(String, String, SetupNativeAppsUpdate, RequestOptions)} with the raw response. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> updateNativeAppsAsync(String organizationId, String applicationId, SetupNativeAppsUpdate params, RequestOptions options) { + return client.executeAsync(updateNativeAppsRequest(organizationId, applicationId, params), options, UPDATE_NATIVE_APPS_RESPONSE); + } + + /** + * {@link #updateNativeApps(String, String, SetupNativeAppsUpdate, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return the result + */ + public RawResponse updateNativeApps(String organizationId, String applicationId, SetupNativeAppsUpdate params) { + return client.execute(updateNativeAppsRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_NATIVE_APPS_RESPONSE); + } + + /** + * Asynchronous {@link #updateNativeApps(String, String, SetupNativeAppsUpdate, RequestOptions)} with the raw response, with the client's options. + * + * @param organizationId the {@code organization_id} + * @param applicationId the {@code application_id} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture> updateNativeAppsAsync(String organizationId, String applicationId, SetupNativeAppsUpdate params) { + return client.executeAsync(updateNativeAppsRequest(organizationId, applicationId, params), RequestOptions.none(), UPDATE_NATIVE_APPS_RESPONSE); + } + } +} diff --git a/src/main/java/me/didit/resources/DiditResources.java b/src/main/java/me/didit/resources/DiditResources.java index 49c3b03..9d9bace 100644 --- a/src/main/java/me/didit/resources/DiditResources.java +++ b/src/main/java/me/didit/resources/DiditResources.java @@ -14,6 +14,7 @@ public abstract class DiditResources { private final AmlResource aml; private final AmlMonitoringResource amlMonitoring; private final AnalyticsResource analytics; + private final AuthenticationSetupResource authenticationSetup; private final BankResource bank; private final BillingResource billing; private final BiometricTemplatesResource biometricTemplates; @@ -65,6 +66,7 @@ protected DiditResources(ApiClient client) { this.aml = new AmlResource(client); this.amlMonitoring = new AmlMonitoringResource(client); this.analytics = new AnalyticsResource(client); + this.authenticationSetup = new AuthenticationSetupResource(client); this.bank = new BankResource(client); this.billing = new BillingResource(client); this.biometricTemplates = new BiometricTemplatesResource(client); @@ -159,6 +161,15 @@ public final AnalyticsResource analytics() { return analytics; } + /** + * The {@code authentication_setup} resource. + * + * @return the resource + */ + public final AuthenticationSetupResource authenticationSetup() { + return authenticationSetup; + } + /** * The {@code bank} resource. * diff --git a/src/main/java/me/didit/resources/InvestigatorResource.java b/src/main/java/me/didit/resources/InvestigatorResource.java index e4f7d58..55850d3 100644 --- a/src/main/java/me/didit/resources/InvestigatorResource.java +++ b/src/main/java/me/didit/resources/InvestigatorResource.java @@ -25,6 +25,7 @@ import me.didit.types.InvestigatorQueueRow; import me.didit.types.InvestigatorRetrieveDashboardParams; import me.didit.types.InvestigatorRetrieveDashboardResponse; +import me.didit.types.InvestigatorRetrieveOfferResponse; import me.didit.types.InvestigatorRetrievePerformanceParams; import me.didit.types.InvestigatorRetrievePerformanceResponse; import me.didit.types.InvestigatorRetrieveSummaryParams; @@ -931,6 +932,48 @@ public CompletableFuture updateSettingsAsync(InvestigatorS return client.executeAsync(updateSettingsRequest(params), RequestOptions.none(), UPDATE_SETTINGS_RESPONSE).thenApply(RawResponse::data); } + /** + * Investigator agent offer + * + *

Whether to offer the Investigator agent to this application: its decisions taken by hand in the last 30 days, the average handling time, the people who stopped halfway and whether follow-ups are on. Read from the daily analytics, never from a scan of sessions. show is true when 20 or more decisions were taken by hand and the agent is not set up, or when follow-ups are off and 50 or more people stopped halfway. + * + *

{@code GET /v3/investigator/offer/} + * + * @param options per-request options that override the client options + * @return the response body + */ + public InvestigatorRetrieveOfferResponse retrieveOffer(RequestOptions options) { + return client.execute(retrieveOfferRequest(), options, RETRIEVE_OFFER_RESPONSE).data(); + } + + /** + * Asynchronous {@link #retrieveOffer(RequestOptions)}. + * + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture retrieveOfferAsync(RequestOptions options) { + return client.executeAsync(retrieveOfferRequest(), options, RETRIEVE_OFFER_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #retrieveOffer(RequestOptions)}, with the client's options. + * + * @return the result + */ + public InvestigatorRetrieveOfferResponse retrieveOffer() { + return client.execute(retrieveOfferRequest(), RequestOptions.none(), RETRIEVE_OFFER_RESPONSE).data(); + } + + /** + * Asynchronous {@link #retrieveOffer(RequestOptions)}, with the client's options. + * + * @return a future completed with the result + */ + public CompletableFuture retrieveOfferAsync() { + return client.executeAsync(retrieveOfferRequest(), RequestOptions.none(), RETRIEVE_OFFER_RESPONSE).thenApply(RawResponse::data); + } + private static final ResponseHandler RETRIEVE_SUMMARY_RESPONSE = Responses.json(Conv.model(InvestigatorRetrieveSummaryResponse::fromJson)); private static ApiRequest retrieveSummaryRequest(InvestigatorRetrieveSummaryParams params) { @@ -1054,6 +1097,13 @@ private static ApiRequest updateSettingsRequest(InvestigatorSettings params) { .build(); } + private static final ResponseHandler RETRIEVE_OFFER_RESPONSE = Responses.json(Conv.model(InvestigatorRetrieveOfferResponse::fromJson)); + + private static ApiRequest retrieveOfferRequest() { + return ApiRequest.builder("GET", "/v3/investigator/offer/") + .build(); + } + /** The {@code investigator} operations returning {@link RawResponse}. */ public static final class WithRawResponse { private final ApiClient client; @@ -1877,5 +1927,43 @@ public RawResponse updateSettings(InvestigatorSettings par public CompletableFuture> updateSettingsAsync(InvestigatorSettings params) { return client.executeAsync(updateSettingsRequest(params), RequestOptions.none(), UPDATE_SETTINGS_RESPONSE); } + + /** + * {@link #retrieveOffer(RequestOptions)} with the raw response. + * + * @param options per-request options + * @return the result + */ + public RawResponse retrieveOffer(RequestOptions options) { + return client.execute(retrieveOfferRequest(), options, RETRIEVE_OFFER_RESPONSE); + } + + /** + * Asynchronous {@link #retrieveOffer(RequestOptions)} with the raw response. + * + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> retrieveOfferAsync(RequestOptions options) { + return client.executeAsync(retrieveOfferRequest(), options, RETRIEVE_OFFER_RESPONSE); + } + + /** + * {@link #retrieveOffer(RequestOptions)} with the raw response, with the client's options. + * + * @return the result + */ + public RawResponse retrieveOffer() { + return client.execute(retrieveOfferRequest(), RequestOptions.none(), RETRIEVE_OFFER_RESPONSE); + } + + /** + * Asynchronous {@link #retrieveOffer(RequestOptions)} with the raw response, with the client's options. + * + * @return a future completed with the result + */ + public CompletableFuture> retrieveOfferAsync() { + return client.executeAsync(retrieveOfferRequest(), RequestOptions.none(), RETRIEVE_OFFER_RESPONSE); + } } } diff --git a/src/main/java/me/didit/types/AuthenticationSetupGetBrandingParams.java b/src/main/java/me/didit/types/AuthenticationSetupGetBrandingParams.java new file mode 100644 index 0000000..016d9ad --- /dev/null +++ b/src/main/java/me/didit/types/AuthenticationSetupGetBrandingParams.java @@ -0,0 +1,99 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; + +/** Parameters for {@code authentication_setup.get_branding}. */ +public final class AuthenticationSetupGetBrandingParams extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("language"); + + private AuthenticationSetupGetBrandingParams(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code AuthenticationSetupGetBrandingParams} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static AuthenticationSetupGetBrandingParams fromJson(JsonNode json) { + return new AuthenticationSetupGetBrandingParams(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * Language of the default texts and the previews: an unsupported code falls back to en. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional language() { + return Json.optional(json, "language", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link AuthenticationSetupGetBrandingParams}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(AuthenticationSetupGetBrandingParams from) { + super(from); + } + + /** + * Language of the default texts and the previews: an unsupported code falls back to en. + * + * @param language the value + * @return this builder + */ + public Builder language(String language) { + return set("language", Conv.STRING, language); + } + + /** + * Builds the value. + * + * @return a new immutable {@code AuthenticationSetupGetBrandingParams} + */ + public AuthenticationSetupGetBrandingParams build() { + return new AuthenticationSetupGetBrandingParams(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/AuthenticationSetupGetEmailsParams.java b/src/main/java/me/didit/types/AuthenticationSetupGetEmailsParams.java new file mode 100644 index 0000000..96d4393 --- /dev/null +++ b/src/main/java/me/didit/types/AuthenticationSetupGetEmailsParams.java @@ -0,0 +1,99 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; + +/** Parameters for {@code authentication_setup.get_emails}. */ +public final class AuthenticationSetupGetEmailsParams extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("language"); + + private AuthenticationSetupGetEmailsParams(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code AuthenticationSetupGetEmailsParams} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static AuthenticationSetupGetEmailsParams fromJson(JsonNode json) { + return new AuthenticationSetupGetEmailsParams(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * Language of the subjects and previews: an unsupported code falls back to en. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional language() { + return Json.optional(json, "language", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link AuthenticationSetupGetEmailsParams}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(AuthenticationSetupGetEmailsParams from) { + super(from); + } + + /** + * Language of the subjects and previews: an unsupported code falls back to en. + * + * @param language the value + * @return this builder + */ + public Builder language(String language) { + return set("language", Conv.STRING, language); + } + + /** + * Builds the value. + * + * @return a new immutable {@code AuthenticationSetupGetEmailsParams} + */ + public AuthenticationSetupGetEmailsParams build() { + return new AuthenticationSetupGetEmailsParams(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/Detail.java b/src/main/java/me/didit/types/Detail.java new file mode 100644 index 0000000..56755ca --- /dev/null +++ b/src/main/java/me/didit/types/Detail.java @@ -0,0 +1,99 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; + +public final class Detail extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("detail"); + + private Detail(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Detail} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Detail fromJson(JsonNode json) { + return new Detail(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The detail field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String detail() { + return Json.required(json, "detail", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Detail}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Detail from) { + super(from); + } + + /** + * The detail field. + * + * @param detail the value + * @return this builder + */ + public Builder detail(String detail) { + return set("detail", Conv.STRING, detail); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Detail} + * @throws IllegalStateException when a required field is missing + */ + public Detail build() { + require("detail", false); + return new Detail(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/FieldErrorsValue.java b/src/main/java/me/didit/types/FieldErrorsValue.java new file mode 100644 index 0000000..3a7a769 --- /dev/null +++ b/src/main/java/me/didit/types/FieldErrorsValue.java @@ -0,0 +1,86 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import java.util.List; +import java.util.Optional; +import me.didit.core.Conv; +import me.didit.core.Json; +import me.didit.core.JsonUnion; + +/** + * + *

One of: {@code String}, {@code List}. Check with the {@code is...} + * methods and read with the {@code as...} methods. + */ +public final class FieldErrorsValue extends JsonUnion { + private FieldErrorsValue(JsonNode json) { + super(json); + } + + /** + * Reads a {@code FieldErrorsValue} from JSON. + * + * @param json any JSON value + * @return the union + */ + public static FieldErrorsValue fromJson(JsonNode json) { + return new FieldErrorsValue(json.deepCopy()); + } + + /** + * Wraps a {@code String} value. + * + * @param value the value + * @return the union + */ + public static FieldErrorsValue ofString(String value) { + return new FieldErrorsValue(Conv.STRING.write(value)); + } + + /** + * Whether this value is a {@code String}. + * + * @return true when it matches + */ + public boolean isString() { + return json.isTextual(); + } + + /** + * Reads this value as a {@code String}. + * + * @return the value, or empty when {@link #isString()} is false + */ + public Optional asString() { + return isString() ? Optional.of(Conv.STRING.read(json)) : Optional.empty(); + } + + /** + * Wraps a {@code List} value. + * + * @param value the value + * @return the union + */ + public static FieldErrorsValue ofList(List value) { + return new FieldErrorsValue(Conv.list(Conv.STRING).write(value)); + } + + /** + * Whether this value is a {@code List}. + * + * @return true when it matches + */ + public boolean isList() { + return json.isArray(); + } + + /** + * Reads this value as a {@code List}. + * + * @return the value, or empty when {@link #isList()} is false + */ + public Optional> asList() { + return isList() ? Optional.of(Conv.list(Conv.STRING).read(json)) : Optional.empty(); + } +} diff --git a/src/main/java/me/didit/types/InvestigatorQueueRow.java b/src/main/java/me/didit/types/InvestigatorQueueRow.java index 61a2325..80fbd70 100644 --- a/src/main/java/me/didit/types/InvestigatorQueueRow.java +++ b/src/main/java/me/didit/types/InvestigatorQueueRow.java @@ -16,7 +16,7 @@ import org.jspecify.annotations.Nullable; public final class InvestigatorQueueRow extends JsonModel { - private static final Set KNOWN_FIELDS = Set.of("run_id", "kind", "queue", "stage", "subject", "recommendation", "recommendation_detail", "confidence", "summary", "sources_count", "ready_to_accept", "guardrails", "waiting_since", "due_at", "prepared_at"); + private static final Set KNOWN_FIELDS = Set.of("run_id", "kind", "queue", "stage", "subject", "recommendation", "recommendation_detail", "confidence", "summary", "sources_count", "ready_to_accept", "guardrails", "waiting_since", "due_at", "prepared_at", "free_report", "example"); private InvestigatorQueueRow(ObjectNode json, Map> files) { super(json, files); @@ -201,6 +201,26 @@ public Optional preparedAt() { return Json.optional(json, "prepared_at", Conv.DATE_TIME); } + /** + * True for one of the organization's free reports: a review run at stage none, with no setup, never charged. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional freeReport() { + return Json.optional(json, "free_report", Conv.BOOLEAN); + } + + /** + * True for an example report shown on a sandbox application. Example reports are read only and never cost anything. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional example() { + return Json.optional(json, "example", Conv.BOOLEAN); + } + @Override protected Set knownFields() { return KNOWN_FIELDS; @@ -364,6 +384,26 @@ public Builder preparedAt(@Nullable OffsetDateTime preparedAt) { return setNullable("prepared_at", Conv.DATE_TIME, preparedAt); } + /** + * True for one of the organization's free reports: a review run at stage none, with no setup, never charged. + * + * @param freeReport the value + * @return this builder + */ + public Builder freeReport(boolean freeReport) { + return set("free_report", Conv.BOOLEAN, freeReport); + } + + /** + * True for an example report shown on a sandbox application. Example reports are read only and never cost anything. + * + * @param example the value + * @return this builder + */ + public Builder example(boolean example) { + return set("example", Conv.BOOLEAN, example); + } + /** * Builds the value. * @@ -483,13 +523,16 @@ public boolean isKnown() { *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. */ public static final class Stage extends StringEnum { + /** The value {@code "none"}. */ + public static final Stage NONE = new Stage("none"); + /** The value {@code "shadow"}. */ public static final Stage SHADOW = new Stage("shadow"); /** The value {@code "live"}. */ public static final Stage LIVE = new Stage("live"); - private static final List KNOWN_VALUES = List.of(SHADOW, LIVE); + private static final List KNOWN_VALUES = List.of(NONE, SHADOW, LIVE); private Stage(String value) { super(value); diff --git a/src/main/java/me/didit/types/InvestigatorRetrieveOfferResponse.java b/src/main/java/me/didit/types/InvestigatorRetrieveOfferResponse.java new file mode 100644 index 0000000..670bea5 --- /dev/null +++ b/src/main/java/me/didit/types/InvestigatorRetrieveOfferResponse.java @@ -0,0 +1,245 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; +import org.jspecify.annotations.Nullable; + +public final class InvestigatorRetrieveOfferResponse extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("show", "manual_decisions_30d", "avg_handling_seconds", "stopped_halfway_30d", "stage", "followups_on"); + + private InvestigatorRetrieveOfferResponse(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code InvestigatorRetrieveOfferResponse} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static InvestigatorRetrieveOfferResponse fromJson(JsonNode json) { + return new InvestigatorRetrieveOfferResponse(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The show field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional show() { + return Json.optional(json, "show", Conv.BOOLEAN); + } + + /** + * The manual_decisions_30d field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional manualDecisions30D() { + return Json.optional(json, "manual_decisions_30d", Conv.LONG); + } + + /** + * The avg_handling_seconds field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional avgHandlingSeconds() { + return Json.optional(json, "avg_handling_seconds", Conv.LONG); + } + + /** + * The stopped_halfway_30d field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional stoppedHalfway30D() { + return Json.optional(json, "stopped_halfway_30d", Conv.LONG); + } + + /** + * The stage field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional stage() { + return Json.optional(json, "stage", Conv.enumeration(InvestigatorRetrieveOfferResponse.Stage::of)); + } + + /** + * The followups_on field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional followupsOn() { + return Json.optional(json, "followups_on", Conv.BOOLEAN); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link InvestigatorRetrieveOfferResponse}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(InvestigatorRetrieveOfferResponse from) { + super(from); + } + + /** + * The show field. + * + * @param show the value + * @return this builder + */ + public Builder show(boolean show) { + return set("show", Conv.BOOLEAN, show); + } + + /** + * The manual_decisions_30d field. + * + * @param manualDecisions30D the value + * @return this builder + */ + public Builder manualDecisions30D(long manualDecisions30D) { + return set("manual_decisions_30d", Conv.LONG, manualDecisions30D); + } + + /** + * The avg_handling_seconds field. + * + * @param avgHandlingSeconds the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder avgHandlingSeconds(@Nullable Long avgHandlingSeconds) { + return setNullable("avg_handling_seconds", Conv.LONG, avgHandlingSeconds); + } + + /** + * The stopped_halfway_30d field. + * + * @param stoppedHalfway30D the value + * @return this builder + */ + public Builder stoppedHalfway30D(long stoppedHalfway30D) { + return set("stopped_halfway_30d", Conv.LONG, stoppedHalfway30D); + } + + /** + * The stage field. + * + * @param stage the value + * @return this builder + */ + public Builder stage(InvestigatorRetrieveOfferResponse.Stage stage) { + return set("stage", Conv.enumeration(InvestigatorRetrieveOfferResponse.Stage::of), stage); + } + + /** + * The followups_on field. + * + * @param followupsOn the value + * @return this builder + */ + public Builder followupsOn(boolean followupsOn) { + return set("followups_on", Conv.BOOLEAN, followupsOn); + } + + /** + * Builds the value. + * + * @return a new immutable {@code InvestigatorRetrieveOfferResponse} + */ + public InvestigatorRetrieveOfferResponse build() { + return new InvestigatorRetrieveOfferResponse(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Stage extends StringEnum { + /** The value {@code "none"}. */ + public static final Stage NONE = new Stage("none"); + + /** The value {@code "shadow"}. */ + public static final Stage SHADOW = new Stage("shadow"); + + /** The value {@code "live"}. */ + public static final Stage LIVE = new Stage("live"); + + private static final List KNOWN_VALUES = List.of(NONE, SHADOW, LIVE); + + private Stage(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static Stage of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Stage::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } +} diff --git a/src/main/java/me/didit/types/InvestigatorRetrieveSummaryResponse.java b/src/main/java/me/didit/types/InvestigatorRetrieveSummaryResponse.java index 2c9a6b2..be5453a 100644 --- a/src/main/java/me/didit/types/InvestigatorRetrieveSummaryResponse.java +++ b/src/main/java/me/didit/types/InvestigatorRetrieveSummaryResponse.java @@ -15,7 +15,7 @@ import org.jspecify.annotations.Nullable; public final class InvestigatorRetrieveSummaryResponse extends JsonModel { - private static final Set KNOWN_FIELDS = Set.of("stage", "last_report_at", "prepared_today", "ready_to_accept", "open", "decided_today", "automation_rate_month", "preparing"); + private static final Set KNOWN_FIELDS = Set.of("stage", "last_report_at", "prepared_today", "ready_to_accept", "open", "decided_today", "automation_rate_month", "preparing", "free_reports"); private InvestigatorRetrieveSummaryResponse(ObjectNode json, Map> files) { super(json, files); @@ -51,7 +51,7 @@ public Builder toBuilder() { } /** - * The stage field. + * none (not set up; free reports still run while free_reports.remaining is above 0), shadow or live. * * @return the value, or empty when the field is absent or null * @throws me.didit.errors.UnexpectedResponseException when the field has another type @@ -130,6 +130,16 @@ public Optional preparing() { return Json.optional(json, "preparing", Conv.LONG); } + /** + * The organization's free reports: the first reports run with no setup, on any plan, and are never charged. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional freeReports() { + return Json.optional(json, "free_reports", Conv.model(InvestigatorRetrieveSummaryResponse.FreeReports::fromJson)); + } + @Override protected Set knownFields() { return KNOWN_FIELDS; @@ -144,7 +154,7 @@ private Builder(InvestigatorRetrieveSummaryResponse from) { } /** - * The stage field. + * none (not set up; free reports still run while free_reports.remaining is above 0), shadow or live. * * @param stage the value * @return this builder @@ -223,6 +233,16 @@ public Builder preparing(long preparing) { return set("preparing", Conv.LONG, preparing); } + /** + * The organization's free reports: the first reports run with no setup, on any plan, and are never charged. + * + * @param freeReports the value + * @return this builder + */ + public Builder freeReports(InvestigatorRetrieveSummaryResponse.FreeReports freeReports) { + return set("free_reports", Conv.model(InvestigatorRetrieveSummaryResponse.FreeReports::fromJson), freeReports); + } + /** * Builds the value. * @@ -237,4 +257,132 @@ protected Builder self() { return this; } } + + /** + * The organization's free reports: the first reports run with no setup, on any plan, and are never charged. + */ + public static final class FreeReports extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("limit", "used", "remaining"); + + private FreeReports(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code FreeReports} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static FreeReports fromJson(JsonNode json) { + return new FreeReports(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The limit field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional limit() { + return Json.optional(json, "limit", Conv.LONG); + } + + /** + * The used field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional used() { + return Json.optional(json, "used", Conv.LONG); + } + + /** + * The remaining field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional remaining() { + return Json.optional(json, "remaining", Conv.LONG); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link FreeReports}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(FreeReports from) { + super(from); + } + + /** + * The limit field. + * + * @param limit the value + * @return this builder + */ + public Builder limit(long limit) { + return set("limit", Conv.LONG, limit); + } + + /** + * The used field. + * + * @param used the value + * @return this builder + */ + public Builder used(long used) { + return set("used", Conv.LONG, used); + } + + /** + * The remaining field. + * + * @param remaining the value + * @return this builder + */ + public Builder remaining(long remaining) { + return set("remaining", Conv.LONG, remaining); + } + + /** + * Builds the value. + * + * @return a new immutable {@code FreeReports} + */ + public FreeReports build() { + return new FreeReports(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } } diff --git a/src/main/java/me/didit/types/InvestigatorRunDetail.java b/src/main/java/me/didit/types/InvestigatorRunDetail.java index eeabb0f..57a2e4a 100644 --- a/src/main/java/me/didit/types/InvestigatorRunDetail.java +++ b/src/main/java/me/didit/types/InvestigatorRunDetail.java @@ -15,7 +15,7 @@ import org.jspecify.annotations.Nullable; public final class InvestigatorRunDetail extends JsonModel { - private static final Set KNOWN_FIELDS = Set.of("run_id", "kind", "queue", "stage", "subject", "recommendation", "recommendation_detail", "confidence", "summary", "sources_count", "ready_to_accept", "guardrails", "waiting_since", "due_at", "prepared_at", "status", "is_open", "lookups", "duration_ms", "agent_version", "prepared_before_opened", "report", "trail", "decision", "autonomy"); + private static final Set KNOWN_FIELDS = Set.of("run_id", "kind", "queue", "stage", "subject", "recommendation", "recommendation_detail", "confidence", "summary", "sources_count", "ready_to_accept", "guardrails", "waiting_since", "due_at", "prepared_at", "free_report", "example", "status", "is_open", "lookups", "duration_ms", "agent_version", "prepared_before_opened", "report", "trail", "decision", "autonomy"); private InvestigatorRunDetail(ObjectNode json, Map> files) { super(json, files); @@ -200,6 +200,26 @@ public Optional preparedAt() { return Json.optional(json, "prepared_at", Conv.DATE_TIME); } + /** + * True for one of the organization's free reports: a review run at stage none, with no setup, never charged. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional freeReport() { + return Json.optional(json, "free_report", Conv.BOOLEAN); + } + + /** + * True for an example report shown on a sandbox application. Example reports are read only and never cost anything. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional example() { + return Json.optional(json, "example", Conv.BOOLEAN); + } + /** * The status field. * @@ -463,6 +483,26 @@ public Builder preparedAt(@Nullable OffsetDateTime preparedAt) { return setNullable("prepared_at", Conv.DATE_TIME, preparedAt); } + /** + * True for one of the organization's free reports: a review run at stage none, with no setup, never charged. + * + * @param freeReport the value + * @return this builder + */ + public Builder freeReport(boolean freeReport) { + return set("free_report", Conv.BOOLEAN, freeReport); + } + + /** + * True for an example report shown on a sandbox application. Example reports are read only and never cost anything. + * + * @param example the value + * @return this builder + */ + public Builder example(boolean example) { + return set("example", Conv.BOOLEAN, example); + } + /** * The status field. * diff --git a/src/main/java/me/didit/types/SetupAndroidApp.java b/src/main/java/me/didit/types/SetupAndroidApp.java new file mode 100644 index 0000000..0b20407 --- /dev/null +++ b/src/main/java/me/didit/types/SetupAndroidApp.java @@ -0,0 +1,121 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; + +/** Android app */ +public final class SetupAndroidApp extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("package_name", "sha256_cert_fingerprints"); + + private SetupAndroidApp(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupAndroidApp} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupAndroidApp fromJson(JsonNode json) { + return new SetupAndroidApp(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The package_name field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String packageName() { + return Json.required(json, "package_name", Conv.STRING); + } + + /** + * The sha256_cert_fingerprints field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public List sha256CertFingerprints() { + return Json.required(json, "sha256_cert_fingerprints", Conv.list(Conv.STRING)); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupAndroidApp}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupAndroidApp from) { + super(from); + } + + /** + * The package_name field. + * + * @param packageName the value + * @return this builder + */ + public Builder packageName(String packageName) { + return set("package_name", Conv.STRING, packageName); + } + + /** + * The sha256_cert_fingerprints field. + * + * @param sha256CertFingerprints the value + * @return this builder + */ + public Builder sha256CertFingerprints(List sha256CertFingerprints) { + return set("sha256_cert_fingerprints", Conv.list(Conv.STRING), sha256CertFingerprints); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupAndroidApp} + * @throws IllegalStateException when a required field is missing + */ + public SetupAndroidApp build() { + require("package_name", false); + require("sha256_cert_fingerprints", false); + return new SetupAndroidApp(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/SetupBrand.java b/src/main/java/me/didit/types/SetupBrand.java new file mode 100644 index 0000000..70ef2bc --- /dev/null +++ b/src/main/java/me/didit/types/SetupBrand.java @@ -0,0 +1,360 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; +import org.jspecify.annotations.Nullable; + +/** The brand as Customization sets it. Read-only here. */ +public final class SetupBrand extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("source", "name", "logo", "logo_dark", "brand_colour", "brand_colour_dark", "button_text_colour", "background", "background_dark", "corner_radius", "font", "theme"); + + private SetupBrand(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupBrand} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupBrand fromJson(JsonNode json) { + return new SetupBrand(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The source field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional source() { + return Json.optional(json, "source", Conv.STRING); + } + + /** + * The name field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional name() { + return Json.optional(json, "name", Conv.STRING); + } + + /** + * The logo field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional logo() { + return Json.optional(json, "logo", Conv.STRING); + } + + /** + * The logo_dark field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional logoDark() { + return Json.optional(json, "logo_dark", Conv.STRING); + } + + /** + * The brand_colour field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional brandColour() { + return Json.optional(json, "brand_colour", Conv.STRING); + } + + /** + * The brand_colour_dark field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional brandColourDark() { + return Json.optional(json, "brand_colour_dark", Conv.STRING); + } + + /** + * The button_text_colour field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional buttonTextColour() { + return Json.optional(json, "button_text_colour", Conv.STRING); + } + + /** + * The background field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional background() { + return Json.optional(json, "background", Conv.STRING); + } + + /** + * The background_dark field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional backgroundDark() { + return Json.optional(json, "background_dark", Conv.STRING); + } + + /** + * The corner_radius field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional cornerRadius() { + return Json.optional(json, "corner_radius", Conv.LONG); + } + + /** + * The font field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional font() { + return Json.optional(json, "font", Conv.STRING); + } + + /** + * The theme field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional theme() { + return Json.optional(json, "theme", Conv.enumeration(SetupBrand.Theme::of)); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupBrand}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupBrand from) { + super(from); + } + + /** + * The source field. + * + * @param source the value + * @return this builder + */ + public Builder source(String source) { + return set("source", Conv.STRING, source); + } + + /** + * The name field. + * + * @param name the value + * @return this builder + */ + public Builder name(String name) { + return set("name", Conv.STRING, name); + } + + /** + * The logo field. + * + * @param logo the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder logo(@Nullable String logo) { + return setNullable("logo", Conv.STRING, logo); + } + + /** + * The logo_dark field. + * + * @param logoDark the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder logoDark(@Nullable String logoDark) { + return setNullable("logo_dark", Conv.STRING, logoDark); + } + + /** + * The brand_colour field. + * + * @param brandColour the value + * @return this builder + */ + public Builder brandColour(String brandColour) { + return set("brand_colour", Conv.STRING, brandColour); + } + + /** + * The brand_colour_dark field. + * + * @param brandColourDark the value + * @return this builder + */ + public Builder brandColourDark(String brandColourDark) { + return set("brand_colour_dark", Conv.STRING, brandColourDark); + } + + /** + * The button_text_colour field. + * + * @param buttonTextColour the value + * @return this builder + */ + public Builder buttonTextColour(String buttonTextColour) { + return set("button_text_colour", Conv.STRING, buttonTextColour); + } + + /** + * The background field. + * + * @param background the value + * @return this builder + */ + public Builder background(String background) { + return set("background", Conv.STRING, background); + } + + /** + * The background_dark field. + * + * @param backgroundDark the value + * @return this builder + */ + public Builder backgroundDark(String backgroundDark) { + return set("background_dark", Conv.STRING, backgroundDark); + } + + /** + * The corner_radius field. + * + * @param cornerRadius the value + * @return this builder + */ + public Builder cornerRadius(long cornerRadius) { + return set("corner_radius", Conv.LONG, cornerRadius); + } + + /** + * The font field. + * + * @param font the value + * @return this builder + */ + public Builder font(String font) { + return set("font", Conv.STRING, font); + } + + /** + * The theme field. + * + * @param theme the value + * @return this builder + */ + public Builder theme(SetupBrand.Theme theme) { + return set("theme", Conv.enumeration(SetupBrand.Theme::of), theme); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupBrand} + */ + public SetupBrand build() { + return new SetupBrand(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Theme extends StringEnum { + /** The value {@code "device"}. */ + public static final Theme DEVICE = new Theme("device"); + + private static final List KNOWN_VALUES = List.of(DEVICE); + + private Theme(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static Theme of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Theme::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } +} diff --git a/src/main/java/me/didit/types/SetupBranding.java b/src/main/java/me/didit/types/SetupBranding.java new file mode 100644 index 0000000..20f6a8d --- /dev/null +++ b/src/main/java/me/didit/types/SetupBranding.java @@ -0,0 +1,498 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import org.jspecify.annotations.Nullable; + +/** Hosted pages branding */ +public final class SetupBranding extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("brand", "texts", "defaults", "terms_url", "privacy_url", "languages", "badge", "hosted_url"); + + private SetupBranding(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupBranding} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupBranding fromJson(JsonNode json) { + return new SetupBranding(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The brand as Customization sets it. Read-only here. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupBrand brand() { + return Json.required(json, "brand", Conv.model(SetupBrand::fromJson)); + } + + /** + * The texts this application set, by language code. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public Map texts() { + return Json.required(json, "texts", Conv.map(Conv.model(SetupBrandingTexts::fromJson))); + } + + /** + * Didit's own copy for the language you asked for. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupBranding.Defaults defaults() { + return Json.required(json, "defaults", Conv.model(SetupBranding.Defaults::fromJson)); + } + + /** + * The terms_url field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional termsUrl() { + return Json.optional(json, "terms_url", Conv.STRING); + } + + /** + * The privacy_url field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional privacyUrl() { + return Json.optional(json, "privacy_url", Conv.STRING); + } + + /** + * The language codes the hosted pages can show. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public List languages() { + return Json.required(json, "languages", Conv.list(Conv.STRING)); + } + + /** + * The badge field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupBranding.Badge badge() { + return Json.required(json, "badge", Conv.model(SetupBranding.Badge::fromJson)); + } + + /** + * The hosted_url field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String hostedUrl() { + return Json.required(json, "hosted_url", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupBranding}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupBranding from) { + super(from); + } + + /** + * The brand as Customization sets it. Read-only here. + * + * @param brand the value + * @return this builder + */ + public Builder brand(SetupBrand brand) { + return set("brand", Conv.model(SetupBrand::fromJson), brand); + } + + /** + * The texts this application set, by language code. + * + * @param texts the value + * @return this builder + */ + public Builder texts(Map texts) { + return set("texts", Conv.map(Conv.model(SetupBrandingTexts::fromJson)), texts); + } + + /** + * Didit's own copy for the language you asked for. + * + * @param defaults the value + * @return this builder + */ + public Builder defaults(SetupBranding.Defaults defaults) { + return set("defaults", Conv.model(SetupBranding.Defaults::fromJson), defaults); + } + + /** + * The terms_url field. + * + * @param termsUrl the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder termsUrl(@Nullable String termsUrl) { + return setNullable("terms_url", Conv.STRING, termsUrl); + } + + /** + * The privacy_url field. + * + * @param privacyUrl the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder privacyUrl(@Nullable String privacyUrl) { + return setNullable("privacy_url", Conv.STRING, privacyUrl); + } + + /** + * The language codes the hosted pages can show. + * + * @param languages the value + * @return this builder + */ + public Builder languages(List languages) { + return set("languages", Conv.list(Conv.STRING), languages); + } + + /** + * The badge field. + * + * @param badge the value + * @return this builder + */ + public Builder badge(SetupBranding.Badge badge) { + return set("badge", Conv.model(SetupBranding.Badge::fromJson), badge); + } + + /** + * The hosted_url field. + * + * @param hostedUrl the value + * @return this builder + */ + public Builder hostedUrl(String hostedUrl) { + return set("hosted_url", Conv.STRING, hostedUrl); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupBranding} + * @throws IllegalStateException when a required field is missing + */ + public SetupBranding build() { + require("brand", false); + require("texts", false); + require("defaults", false); + require("languages", false); + require("badge", false); + require("hosted_url", false); + return new SetupBranding(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** Didit's own copy for the language you asked for. */ + public static final class Defaults extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("sign_in_title", "subtitle", "sign_up_title"); + + private Defaults(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Defaults} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Defaults fromJson(JsonNode json) { + return new Defaults(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The sign_in_title field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional signInTitle() { + return Json.optional(json, "sign_in_title", Conv.STRING); + } + + /** + * The subtitle field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional subtitle() { + return Json.optional(json, "subtitle", Conv.STRING); + } + + /** + * The sign_up_title field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional signUpTitle() { + return Json.optional(json, "sign_up_title", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Defaults}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Defaults from) { + super(from); + } + + /** + * The sign_in_title field. + * + * @param signInTitle the value + * @return this builder + */ + public Builder signInTitle(String signInTitle) { + return set("sign_in_title", Conv.STRING, signInTitle); + } + + /** + * The subtitle field. + * + * @param subtitle the value + * @return this builder + */ + public Builder subtitle(String subtitle) { + return set("subtitle", Conv.STRING, subtitle); + } + + /** + * The sign_up_title field. + * + * @param signUpTitle the value + * @return this builder + */ + public Builder signUpTitle(String signUpTitle) { + return set("sign_up_title", Conv.STRING, signUpTitle); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Defaults} + */ + public Defaults build() { + return new Defaults(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } + + public static final class Badge extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("visible", "plan", "early_access"); + + private Badge(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Badge} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Badge fromJson(JsonNode json) { + return new Badge(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The visible field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional visible() { + return Json.optional(json, "visible", Conv.BOOLEAN); + } + + /** + * The plan field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional plan() { + return Json.optional(json, "plan", Conv.STRING); + } + + /** + * The early_access field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional earlyAccess() { + return Json.optional(json, "early_access", Conv.BOOLEAN); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Badge}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Badge from) { + super(from); + } + + /** + * The visible field. + * + * @param visible the value + * @return this builder + */ + public Builder visible(boolean visible) { + return set("visible", Conv.BOOLEAN, visible); + } + + /** + * The plan field. + * + * @param plan the value + * @return this builder + */ + public Builder plan(String plan) { + return set("plan", Conv.STRING, plan); + } + + /** + * The early_access field. + * + * @param earlyAccess the value + * @return this builder + */ + public Builder earlyAccess(boolean earlyAccess) { + return set("early_access", Conv.BOOLEAN, earlyAccess); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Badge} + */ + public Badge build() { + return new Badge(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } +} diff --git a/src/main/java/me/didit/types/SetupBrandingTexts.java b/src/main/java/me/didit/types/SetupBrandingTexts.java new file mode 100644 index 0000000..3bc8b29 --- /dev/null +++ b/src/main/java/me/didit/types/SetupBrandingTexts.java @@ -0,0 +1,141 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; + +/** + * The texts of the hosted sign-in, sign-up and subtitle lines. A field left empty falls back to Didit's copy. + */ +public final class SetupBrandingTexts extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("sign_in_title", "subtitle", "sign_up_title"); + + private SetupBrandingTexts(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupBrandingTexts} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupBrandingTexts fromJson(JsonNode json) { + return new SetupBrandingTexts(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The sign_in_title field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional signInTitle() { + return Json.optional(json, "sign_in_title", Conv.STRING); + } + + /** + * The subtitle field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional subtitle() { + return Json.optional(json, "subtitle", Conv.STRING); + } + + /** + * The sign_up_title field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional signUpTitle() { + return Json.optional(json, "sign_up_title", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupBrandingTexts}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupBrandingTexts from) { + super(from); + } + + /** + * The sign_in_title field. + * + * @param signInTitle the value + * @return this builder + */ + public Builder signInTitle(String signInTitle) { + return set("sign_in_title", Conv.STRING, signInTitle); + } + + /** + * The subtitle field. + * + * @param subtitle the value + * @return this builder + */ + public Builder subtitle(String subtitle) { + return set("subtitle", Conv.STRING, subtitle); + } + + /** + * The sign_up_title field. + * + * @param signUpTitle the value + * @return this builder + */ + public Builder signUpTitle(String signUpTitle) { + return set("sign_up_title", Conv.STRING, signUpTitle); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupBrandingTexts} + */ + public SetupBrandingTexts build() { + return new SetupBrandingTexts(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/SetupBrandingUpdate.java b/src/main/java/me/didit/types/SetupBrandingUpdate.java new file mode 100644 index 0000000..fa49aa4 --- /dev/null +++ b/src/main/java/me/didit/types/SetupBrandingUpdate.java @@ -0,0 +1,141 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; + +/** + * Every field is optional. A language Didit does not publish answers unsupported_language, and a legal link that is not https:// answers https_required. + */ +public final class SetupBrandingUpdate extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("texts", "terms_url", "privacy_url"); + + private SetupBrandingUpdate(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupBrandingUpdate} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupBrandingUpdate fromJson(JsonNode json) { + return new SetupBrandingUpdate(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The texts field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional> texts() { + return Json.optional(json, "texts", Conv.map(Conv.model(SetupBrandingTexts::fromJson))); + } + + /** + * The terms_url field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional termsUrl() { + return Json.optional(json, "terms_url", Conv.STRING); + } + + /** + * The privacy_url field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional privacyUrl() { + return Json.optional(json, "privacy_url", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupBrandingUpdate}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupBrandingUpdate from) { + super(from); + } + + /** + * The texts field. + * + * @param texts the value + * @return this builder + */ + public Builder texts(Map texts) { + return set("texts", Conv.map(Conv.model(SetupBrandingTexts::fromJson)), texts); + } + + /** + * The terms_url field. + * + * @param termsUrl the value + * @return this builder + */ + public Builder termsUrl(String termsUrl) { + return set("terms_url", Conv.STRING, termsUrl); + } + + /** + * The privacy_url field. + * + * @param privacyUrl the value + * @return this builder + */ + public Builder privacyUrl(String privacyUrl) { + return set("privacy_url", Conv.STRING, privacyUrl); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupBrandingUpdate} + */ + public SetupBrandingUpdate build() { + return new SetupBrandingUpdate(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/SetupConfiguration.java b/src/main/java/me/didit/types/SetupConfiguration.java new file mode 100644 index 0000000..607371d --- /dev/null +++ b/src/main/java/me/didit/types/SetupConfiguration.java @@ -0,0 +1,456 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; +import org.jspecify.annotations.Nullable; + +/** Authentication configuration */ +public final class SetupConfiguration extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("application_id", "publishable_key", "enabled", "methods", "didit_test_credentials", "redirect_uris", "allowed_origins", "post_logout_redirect_uri", "session_lifetime", "idle_timeout", "multiple_sessions", "password_min_length", "revoke_on_password_change", "allow_subaddresses", "signup_policy", "allowed_email_domains"); + + private SetupConfiguration(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupConfiguration} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupConfiguration fromJson(JsonNode json) { + return new SetupConfiguration(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The application_id field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String applicationId() { + return Json.required(json, "application_id", Conv.STRING); + } + + /** + * pk_live_ or pk_test_ followed by the base64url issuer. A public identifier, not a credential; null when the hosted origin is not usable yet. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional publishableKey() { + return Json.optional(json, "publishable_key", Conv.STRING); + } + + /** + * Whether Authentication is on for this application. Read-only: it follows the product. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public boolean enabled() { + return Json.required(json, "enabled", Conv.BOOLEAN); + } + + /** + * The methods field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public List methods() { + return Json.required(json, "methods", Conv.list(Conv.model(SetupMethodSummary::fromJson))); + } + + /** + * Which social providers Didit's own sandbox apps can serve for this application. Every value is false on a live application. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupDiditTestCredentials diditTestCredentials() { + return Json.required(json, "didit_test_credentials", Conv.model(SetupDiditTestCredentials::fromJson)); + } + + /** + * Where POST authorize/ may send the browser after sign-in. Exact match, and https:// only on a live application. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public List redirectUris() { + return Json.required(json, "redirect_uris", Conv.list(Conv.STRING)); + } + + /** + * Origins allowed to embed or call the hosted pages and the browser SDK. Scheme, host and optional port only. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public List allowedOrigins() { + return Json.required(json, "allowed_origins", Conv.list(Conv.STRING)); + } + + /** + * Where hosted sign-out sends the browser. Empty for none. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional postLogoutRedirectUri() { + return Json.optional(json, "post_logout_redirect_uri", Conv.STRING); + } + + /** + * The session_lifetime field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public long sessionLifetime() { + return Json.required(json, "session_lifetime", Conv.LONG); + } + + /** + * The idle_timeout field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public long idleTimeout() { + return Json.required(json, "idle_timeout", Conv.LONG); + } + + /** + * false signs the person out of their other sessions at each new sign-in. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional multipleSessions() { + return Json.optional(json, "multiple_sessions", Conv.BOOLEAN); + } + + /** + * The password_min_length field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional passwordMinLength() { + return Json.optional(json, "password_min_length", Conv.LONG); + } + + /** + * The revoke_on_password_change field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional revokeOnPasswordChange() { + return Json.optional(json, "revoke_on_password_change", Conv.BOOLEAN); + } + + /** + * Accept a + in the email's local part. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional allowSubaddresses() { + return Json.optional(json, "allow_subaddresses", Conv.BOOLEAN); + } + + /** + * The signup_policy field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupConfiguration.SignupPolicy signupPolicy() { + return Json.required(json, "signup_policy", Conv.enumeration(SetupConfiguration.SignupPolicy::of)); + } + + /** + * The domains signup_policy: "allowed_domains" accepts. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional> allowedEmailDomains() { + return Json.optional(json, "allowed_email_domains", Conv.list(Conv.STRING)); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupConfiguration}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupConfiguration from) { + super(from); + } + + /** + * The application_id field. + * + * @param applicationId the value + * @return this builder + */ + public Builder applicationId(String applicationId) { + return set("application_id", Conv.STRING, applicationId); + } + + /** + * pk_live_ or pk_test_ followed by the base64url issuer. A public identifier, not a credential; null when the hosted origin is not usable yet. + * + * @param publishableKey the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder publishableKey(@Nullable String publishableKey) { + return setNullable("publishable_key", Conv.STRING, publishableKey); + } + + /** + * Whether Authentication is on for this application. Read-only: it follows the product. + * + * @param enabled the value + * @return this builder + */ + public Builder enabled(boolean enabled) { + return set("enabled", Conv.BOOLEAN, enabled); + } + + /** + * The methods field. + * + * @param methods the value + * @return this builder + */ + public Builder methods(List methods) { + return set("methods", Conv.list(Conv.model(SetupMethodSummary::fromJson)), methods); + } + + /** + * Which social providers Didit's own sandbox apps can serve for this application. Every value is false on a live application. + * + * @param diditTestCredentials the value + * @return this builder + */ + public Builder diditTestCredentials(SetupDiditTestCredentials diditTestCredentials) { + return set("didit_test_credentials", Conv.model(SetupDiditTestCredentials::fromJson), diditTestCredentials); + } + + /** + * Where POST authorize/ may send the browser after sign-in. Exact match, and https:// only on a live application. + * + * @param redirectUris the value + * @return this builder + */ + public Builder redirectUris(List redirectUris) { + return set("redirect_uris", Conv.list(Conv.STRING), redirectUris); + } + + /** + * Origins allowed to embed or call the hosted pages and the browser SDK. Scheme, host and optional port only. + * + * @param allowedOrigins the value + * @return this builder + */ + public Builder allowedOrigins(List allowedOrigins) { + return set("allowed_origins", Conv.list(Conv.STRING), allowedOrigins); + } + + /** + * Where hosted sign-out sends the browser. Empty for none. + * + * @param postLogoutRedirectUri the value + * @return this builder + */ + public Builder postLogoutRedirectUri(String postLogoutRedirectUri) { + return set("post_logout_redirect_uri", Conv.STRING, postLogoutRedirectUri); + } + + /** + * The session_lifetime field. + * + * @param sessionLifetime the value + * @return this builder + */ + public Builder sessionLifetime(long sessionLifetime) { + return set("session_lifetime", Conv.LONG, sessionLifetime); + } + + /** + * The idle_timeout field. + * + * @param idleTimeout the value + * @return this builder + */ + public Builder idleTimeout(long idleTimeout) { + return set("idle_timeout", Conv.LONG, idleTimeout); + } + + /** + * false signs the person out of their other sessions at each new sign-in. + * + * @param multipleSessions the value + * @return this builder + */ + public Builder multipleSessions(boolean multipleSessions) { + return set("multiple_sessions", Conv.BOOLEAN, multipleSessions); + } + + /** + * The password_min_length field. + * + * @param passwordMinLength the value + * @return this builder + */ + public Builder passwordMinLength(long passwordMinLength) { + return set("password_min_length", Conv.LONG, passwordMinLength); + } + + /** + * The revoke_on_password_change field. + * + * @param revokeOnPasswordChange the value + * @return this builder + */ + public Builder revokeOnPasswordChange(boolean revokeOnPasswordChange) { + return set("revoke_on_password_change", Conv.BOOLEAN, revokeOnPasswordChange); + } + + /** + * Accept a + in the email's local part. + * + * @param allowSubaddresses the value + * @return this builder + */ + public Builder allowSubaddresses(boolean allowSubaddresses) { + return set("allow_subaddresses", Conv.BOOLEAN, allowSubaddresses); + } + + /** + * The signup_policy field. + * + * @param signupPolicy the value + * @return this builder + */ + public Builder signupPolicy(SetupConfiguration.SignupPolicy signupPolicy) { + return set("signup_policy", Conv.enumeration(SetupConfiguration.SignupPolicy::of), signupPolicy); + } + + /** + * The domains signup_policy: "allowed_domains" accepts. + * + * @param allowedEmailDomains the value + * @return this builder + */ + public Builder allowedEmailDomains(List allowedEmailDomains) { + return set("allowed_email_domains", Conv.list(Conv.STRING), allowedEmailDomains); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupConfiguration} + * @throws IllegalStateException when a required field is missing + */ + public SetupConfiguration build() { + require("application_id", false); + require("enabled", false); + require("methods", false); + require("didit_test_credentials", false); + require("redirect_uris", false); + require("allowed_origins", false); + require("session_lifetime", false); + require("idle_timeout", false); + require("signup_policy", false); + return new SetupConfiguration(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class SignupPolicy extends StringEnum { + /** The value {@code "anyone"}. */ + public static final SignupPolicy ANYONE = new SignupPolicy("anyone"); + + /** The value {@code "invited"}. */ + public static final SignupPolicy INVITED = new SignupPolicy("invited"); + + /** The value {@code "allowed_domains"}. */ + public static final SignupPolicy ALLOWED_DOMAINS = new SignupPolicy("allowed_domains"); + + private static final List KNOWN_VALUES = List.of(ANYONE, INVITED, ALLOWED_DOMAINS); + + private SignupPolicy(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static SignupPolicy of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, SignupPolicy::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } +} diff --git a/src/main/java/me/didit/types/SetupConfigurationUpdate.java b/src/main/java/me/didit/types/SetupConfigurationUpdate.java new file mode 100644 index 0000000..c82a6dc --- /dev/null +++ b/src/main/java/me/didit/types/SetupConfigurationUpdate.java @@ -0,0 +1,347 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; + +/** + * Every field is optional; send only what changes. enabled, publishable_key, methods and didit_test_credentials are read-only and answer follows_product or unknown_field. + */ +public final class SetupConfigurationUpdate extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("redirect_uris", "allowed_origins", "post_logout_redirect_uri", "session_lifetime", "idle_timeout", "multiple_sessions", "password_min_length", "revoke_on_password_change", "allow_subaddresses", "signup_policy", "allowed_email_domains"); + + private SetupConfigurationUpdate(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupConfigurationUpdate} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupConfigurationUpdate fromJson(JsonNode json) { + return new SetupConfigurationUpdate(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The redirect_uris field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional> redirectUris() { + return Json.optional(json, "redirect_uris", Conv.list(Conv.STRING)); + } + + /** + * The allowed_origins field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional> allowedOrigins() { + return Json.optional(json, "allowed_origins", Conv.list(Conv.STRING)); + } + + /** + * The post_logout_redirect_uri field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional postLogoutRedirectUri() { + return Json.optional(json, "post_logout_redirect_uri", Conv.STRING); + } + + /** + * The session_lifetime field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional sessionLifetime() { + return Json.optional(json, "session_lifetime", Conv.LONG); + } + + /** + * The idle_timeout field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional idleTimeout() { + return Json.optional(json, "idle_timeout", Conv.LONG); + } + + /** + * The multiple_sessions field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional multipleSessions() { + return Json.optional(json, "multiple_sessions", Conv.BOOLEAN); + } + + /** + * The password_min_length field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional passwordMinLength() { + return Json.optional(json, "password_min_length", Conv.LONG); + } + + /** + * The revoke_on_password_change field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional revokeOnPasswordChange() { + return Json.optional(json, "revoke_on_password_change", Conv.BOOLEAN); + } + + /** + * The allow_subaddresses field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional allowSubaddresses() { + return Json.optional(json, "allow_subaddresses", Conv.BOOLEAN); + } + + /** + * The signup_policy field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional signupPolicy() { + return Json.optional(json, "signup_policy", Conv.enumeration(SetupConfigurationUpdate.SignupPolicy::of)); + } + + /** + * The allowed_email_domains field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional> allowedEmailDomains() { + return Json.optional(json, "allowed_email_domains", Conv.list(Conv.STRING)); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupConfigurationUpdate}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupConfigurationUpdate from) { + super(from); + } + + /** + * The redirect_uris field. + * + * @param redirectUris the value + * @return this builder + */ + public Builder redirectUris(List redirectUris) { + return set("redirect_uris", Conv.list(Conv.STRING), redirectUris); + } + + /** + * The allowed_origins field. + * + * @param allowedOrigins the value + * @return this builder + */ + public Builder allowedOrigins(List allowedOrigins) { + return set("allowed_origins", Conv.list(Conv.STRING), allowedOrigins); + } + + /** + * The post_logout_redirect_uri field. + * + * @param postLogoutRedirectUri the value + * @return this builder + */ + public Builder postLogoutRedirectUri(String postLogoutRedirectUri) { + return set("post_logout_redirect_uri", Conv.STRING, postLogoutRedirectUri); + } + + /** + * The session_lifetime field. + * + * @param sessionLifetime the value + * @return this builder + */ + public Builder sessionLifetime(long sessionLifetime) { + return set("session_lifetime", Conv.LONG, sessionLifetime); + } + + /** + * The idle_timeout field. + * + * @param idleTimeout the value + * @return this builder + */ + public Builder idleTimeout(long idleTimeout) { + return set("idle_timeout", Conv.LONG, idleTimeout); + } + + /** + * The multiple_sessions field. + * + * @param multipleSessions the value + * @return this builder + */ + public Builder multipleSessions(boolean multipleSessions) { + return set("multiple_sessions", Conv.BOOLEAN, multipleSessions); + } + + /** + * The password_min_length field. + * + * @param passwordMinLength the value + * @return this builder + */ + public Builder passwordMinLength(long passwordMinLength) { + return set("password_min_length", Conv.LONG, passwordMinLength); + } + + /** + * The revoke_on_password_change field. + * + * @param revokeOnPasswordChange the value + * @return this builder + */ + public Builder revokeOnPasswordChange(boolean revokeOnPasswordChange) { + return set("revoke_on_password_change", Conv.BOOLEAN, revokeOnPasswordChange); + } + + /** + * The allow_subaddresses field. + * + * @param allowSubaddresses the value + * @return this builder + */ + public Builder allowSubaddresses(boolean allowSubaddresses) { + return set("allow_subaddresses", Conv.BOOLEAN, allowSubaddresses); + } + + /** + * The signup_policy field. + * + * @param signupPolicy the value + * @return this builder + */ + public Builder signupPolicy(SetupConfigurationUpdate.SignupPolicy signupPolicy) { + return set("signup_policy", Conv.enumeration(SetupConfigurationUpdate.SignupPolicy::of), signupPolicy); + } + + /** + * The allowed_email_domains field. + * + * @param allowedEmailDomains the value + * @return this builder + */ + public Builder allowedEmailDomains(List allowedEmailDomains) { + return set("allowed_email_domains", Conv.list(Conv.STRING), allowedEmailDomains); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupConfigurationUpdate} + */ + public SetupConfigurationUpdate build() { + return new SetupConfigurationUpdate(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class SignupPolicy extends StringEnum { + /** The value {@code "anyone"}. */ + public static final SignupPolicy ANYONE = new SignupPolicy("anyone"); + + /** The value {@code "invited"}. */ + public static final SignupPolicy INVITED = new SignupPolicy("invited"); + + /** The value {@code "allowed_domains"}. */ + public static final SignupPolicy ALLOWED_DOMAINS = new SignupPolicy("allowed_domains"); + + private static final List KNOWN_VALUES = List.of(ANYONE, INVITED, ALLOWED_DOMAINS); + + private SignupPolicy(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static SignupPolicy of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, SignupPolicy::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } +} diff --git a/src/main/java/me/didit/types/SetupCustomDomain.java b/src/main/java/me/didit/types/SetupCustomDomain.java new file mode 100644 index 0000000..3166369 --- /dev/null +++ b/src/main/java/me/didit/types/SetupCustomDomain.java @@ -0,0 +1,571 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; +import org.jspecify.annotations.Nullable; + +/** Custom domain */ +public final class SetupCustomDomain extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("domain", "status", "failure_reason", "dns_record", "certificate", "dns_checked_at", "verified_at", "activated_at"); + + private SetupCustomDomain(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupCustomDomain} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupCustomDomain fromJson(JsonNode json) { + return new SetupCustomDomain(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The domain field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String domain() { + return Json.required(json, "domain", Conv.STRING); + } + + /** + * The status field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupCustomDomain.Status status() { + return Json.required(json, "status", Conv.enumeration(SetupCustomDomain.Status::of)); + } + + /** + * The failure_reason field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional failureReason() { + return Json.optional(json, "failure_reason", Conv.STRING); + } + + /** + * The dns_record field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupCustomDomain.DnsRecord dnsRecord() { + return Json.required(json, "dns_record", Conv.model(SetupCustomDomain.DnsRecord::fromJson)); + } + + /** + * The certificate field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupCustomDomain.Certificate certificate() { + return Json.required(json, "certificate", Conv.model(SetupCustomDomain.Certificate::fromJson)); + } + + /** + * The dns_checked_at field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional dnsCheckedAt() { + return Json.optional(json, "dns_checked_at", Conv.DATE_TIME); + } + + /** + * The verified_at field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional verifiedAt() { + return Json.optional(json, "verified_at", Conv.DATE_TIME); + } + + /** + * The activated_at field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional activatedAt() { + return Json.optional(json, "activated_at", Conv.DATE_TIME); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupCustomDomain}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupCustomDomain from) { + super(from); + } + + /** + * The domain field. + * + * @param domain the value + * @return this builder + */ + public Builder domain(String domain) { + return set("domain", Conv.STRING, domain); + } + + /** + * The status field. + * + * @param status the value + * @return this builder + */ + public Builder status(SetupCustomDomain.Status status) { + return set("status", Conv.enumeration(SetupCustomDomain.Status::of), status); + } + + /** + * The failure_reason field. + * + * @param failureReason the value + * @return this builder + */ + public Builder failureReason(String failureReason) { + return set("failure_reason", Conv.STRING, failureReason); + } + + /** + * The dns_record field. + * + * @param dnsRecord the value + * @return this builder + */ + public Builder dnsRecord(SetupCustomDomain.DnsRecord dnsRecord) { + return set("dns_record", Conv.model(SetupCustomDomain.DnsRecord::fromJson), dnsRecord); + } + + /** + * The certificate field. + * + * @param certificate the value + * @return this builder + */ + public Builder certificate(SetupCustomDomain.Certificate certificate) { + return set("certificate", Conv.model(SetupCustomDomain.Certificate::fromJson), certificate); + } + + /** + * The dns_checked_at field. + * + * @param dnsCheckedAt the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder dnsCheckedAt(@Nullable OffsetDateTime dnsCheckedAt) { + return setNullable("dns_checked_at", Conv.DATE_TIME, dnsCheckedAt); + } + + /** + * The verified_at field. + * + * @param verifiedAt the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder verifiedAt(@Nullable OffsetDateTime verifiedAt) { + return setNullable("verified_at", Conv.DATE_TIME, verifiedAt); + } + + /** + * The activated_at field. + * + * @param activatedAt the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder activatedAt(@Nullable OffsetDateTime activatedAt) { + return setNullable("activated_at", Conv.DATE_TIME, activatedAt); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupCustomDomain} + * @throws IllegalStateException when a required field is missing + */ + public SetupCustomDomain build() { + require("domain", false); + require("status", false); + require("dns_record", false); + require("certificate", false); + return new SetupCustomDomain(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Status extends StringEnum { + /** The value {@code "pending"}. */ + public static final Status PENDING = new Status("pending"); + + /** The value {@code "issuing"}. */ + public static final Status ISSUING = new Status("issuing"); + + /** The value {@code "verified"}. */ + public static final Status VERIFIED = new Status("verified"); + + /** The value {@code "active"}. */ + public static final Status ACTIVE = new Status("active"); + + /** The value {@code "failed"}. */ + public static final Status FAILED = new Status("failed"); + + private static final List KNOWN_VALUES = List.of(PENDING, ISSUING, VERIFIED, ACTIVE, FAILED); + + private Status(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static Status of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Status::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + public static final class DnsRecord extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("type", "name", "value"); + + private DnsRecord(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code DnsRecord} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static DnsRecord fromJson(JsonNode json) { + return new DnsRecord(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The type field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupCustomDomain.DnsRecord.Type type() { + return Json.required(json, "type", Conv.enumeration(SetupCustomDomain.DnsRecord.Type::of)); + } + + /** + * The name field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String name() { + return Json.required(json, "name", Conv.STRING); + } + + /** + * The application's default host the domain points at. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String value() { + return Json.required(json, "value", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link DnsRecord}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(DnsRecord from) { + super(from); + } + + /** + * The type field. + * + * @param type the value + * @return this builder + */ + public Builder type(SetupCustomDomain.DnsRecord.Type type) { + return set("type", Conv.enumeration(SetupCustomDomain.DnsRecord.Type::of), type); + } + + /** + * The name field. + * + * @param name the value + * @return this builder + */ + public Builder name(String name) { + return set("name", Conv.STRING, name); + } + + /** + * The application's default host the domain points at. + * + * @param value the value + * @return this builder + */ + public Builder value(String value) { + return set("value", Conv.STRING, value); + } + + /** + * Builds the value. + * + * @return a new immutable {@code DnsRecord} + * @throws IllegalStateException when a required field is missing + */ + public DnsRecord build() { + require("type", false); + require("name", false); + require("value", false); + return new DnsRecord(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Type extends StringEnum { + /** The value {@code "CNAME"}. */ + public static final Type CNAME = new Type("CNAME"); + + private static final List KNOWN_VALUES = List.of(CNAME); + + private Type(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static Type of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Type::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + } + + public static final class Certificate extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("status", "expires_at"); + + private Certificate(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Certificate} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Certificate fromJson(JsonNode json) { + return new Certificate(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The status field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional status() { + return Json.optional(json, "status", Conv.STRING); + } + + /** + * The expires_at field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional expiresAt() { + return Json.optional(json, "expires_at", Conv.DATE_TIME); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Certificate}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Certificate from) { + super(from); + } + + /** + * The status field. + * + * @param status the value + * @return this builder + */ + public Builder status(String status) { + return set("status", Conv.STRING, status); + } + + /** + * The expires_at field. + * + * @param expiresAt the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder expiresAt(@Nullable OffsetDateTime expiresAt) { + return setNullable("expires_at", Conv.DATE_TIME, expiresAt); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Certificate} + */ + public Certificate build() { + return new Certificate(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } +} diff --git a/src/main/java/me/didit/types/SetupDiditTestCredentials.java b/src/main/java/me/didit/types/SetupDiditTestCredentials.java new file mode 100644 index 0000000..a719c84 --- /dev/null +++ b/src/main/java/me/didit/types/SetupDiditTestCredentials.java @@ -0,0 +1,161 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; + +/** + * Which social providers Didit's own sandbox apps can serve for this application. Every value is false on a live application. + */ +public final class SetupDiditTestCredentials extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("google", "microsoft", "apple", "github"); + + private SetupDiditTestCredentials(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupDiditTestCredentials} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupDiditTestCredentials fromJson(JsonNode json) { + return new SetupDiditTestCredentials(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The google field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional google() { + return Json.optional(json, "google", Conv.BOOLEAN); + } + + /** + * The microsoft field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional microsoft() { + return Json.optional(json, "microsoft", Conv.BOOLEAN); + } + + /** + * The apple field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional apple() { + return Json.optional(json, "apple", Conv.BOOLEAN); + } + + /** + * The github field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional github() { + return Json.optional(json, "github", Conv.BOOLEAN); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupDiditTestCredentials}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupDiditTestCredentials from) { + super(from); + } + + /** + * The google field. + * + * @param google the value + * @return this builder + */ + public Builder google(boolean google) { + return set("google", Conv.BOOLEAN, google); + } + + /** + * The microsoft field. + * + * @param microsoft the value + * @return this builder + */ + public Builder microsoft(boolean microsoft) { + return set("microsoft", Conv.BOOLEAN, microsoft); + } + + /** + * The apple field. + * + * @param apple the value + * @return this builder + */ + public Builder apple(boolean apple) { + return set("apple", Conv.BOOLEAN, apple); + } + + /** + * The github field. + * + * @param github the value + * @return this builder + */ + public Builder github(boolean github) { + return set("github", Conv.BOOLEAN, github); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupDiditTestCredentials} + */ + public SetupDiditTestCredentials build() { + return new SetupDiditTestCredentials(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/SetupDomain.java b/src/main/java/me/didit/types/SetupDomain.java new file mode 100644 index 0000000..d89ec32 --- /dev/null +++ b/src/main/java/me/didit/types/SetupDomain.java @@ -0,0 +1,289 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import org.jspecify.annotations.Nullable; + +/** Hosted domain */ +public final class SetupDomain extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("host", "default_origin", "origin", "hosted_url", "issuer", "passkey_rp_id", "sandbox", "sandbox_origin", "custom_domains_available", "custom_domain"); + + private SetupDomain(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupDomain} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupDomain fromJson(JsonNode json) { + return new SetupDomain(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The host field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String host() { + return Json.required(json, "host", Conv.STRING); + } + + /** + * The default_origin field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String defaultOrigin() { + return Json.required(json, "default_origin", Conv.STRING); + } + + /** + * The custom domain once it is active, the default origin until then. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String origin() { + return Json.required(json, "origin", Conv.STRING); + } + + /** + * The hosted_url field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String hostedUrl() { + return Json.required(json, "hosted_url", Conv.STRING); + } + + /** + * The issuer field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String issuer() { + return Json.required(json, "issuer", Conv.STRING); + } + + /** + * The passkey_rp_id field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String passkeyRpId() { + return Json.required(json, "passkey_rp_id", Conv.STRING); + } + + /** + * The sandbox field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public boolean sandbox() { + return Json.required(json, "sandbox", Conv.BOOLEAN); + } + + /** + * A live application's sandbox origin, shown beside its own. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional sandboxOrigin() { + return Json.optional(json, "sandbox_origin", Conv.STRING); + } + + /** + * Whether this deployment can serve a custom domain. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public boolean customDomainsAvailable() { + return Json.required(json, "custom_domains_available", Conv.BOOLEAN); + } + + /** + * The custom_domain field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional customDomain() { + return Json.optional(json, "custom_domain", Conv.model(SetupCustomDomain::fromJson)); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupDomain}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupDomain from) { + super(from); + } + + /** + * The host field. + * + * @param host the value + * @return this builder + */ + public Builder host(String host) { + return set("host", Conv.STRING, host); + } + + /** + * The default_origin field. + * + * @param defaultOrigin the value + * @return this builder + */ + public Builder defaultOrigin(String defaultOrigin) { + return set("default_origin", Conv.STRING, defaultOrigin); + } + + /** + * The custom domain once it is active, the default origin until then. + * + * @param origin the value + * @return this builder + */ + public Builder origin(String origin) { + return set("origin", Conv.STRING, origin); + } + + /** + * The hosted_url field. + * + * @param hostedUrl the value + * @return this builder + */ + public Builder hostedUrl(String hostedUrl) { + return set("hosted_url", Conv.STRING, hostedUrl); + } + + /** + * The issuer field. + * + * @param issuer the value + * @return this builder + */ + public Builder issuer(String issuer) { + return set("issuer", Conv.STRING, issuer); + } + + /** + * The passkey_rp_id field. + * + * @param passkeyRpId the value + * @return this builder + */ + public Builder passkeyRpId(String passkeyRpId) { + return set("passkey_rp_id", Conv.STRING, passkeyRpId); + } + + /** + * The sandbox field. + * + * @param sandbox the value + * @return this builder + */ + public Builder sandbox(boolean sandbox) { + return set("sandbox", Conv.BOOLEAN, sandbox); + } + + /** + * A live application's sandbox origin, shown beside its own. + * + * @param sandboxOrigin the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder sandboxOrigin(@Nullable String sandboxOrigin) { + return setNullable("sandbox_origin", Conv.STRING, sandboxOrigin); + } + + /** + * Whether this deployment can serve a custom domain. + * + * @param customDomainsAvailable the value + * @return this builder + */ + public Builder customDomainsAvailable(boolean customDomainsAvailable) { + return set("custom_domains_available", Conv.BOOLEAN, customDomainsAvailable); + } + + /** + * The custom_domain field. + * + * @param customDomain the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder customDomain(@Nullable SetupCustomDomain customDomain) { + return setNullable("custom_domain", Conv.model(SetupCustomDomain::fromJson), customDomain); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupDomain} + * @throws IllegalStateException when a required field is missing + */ + public SetupDomain build() { + require("host", false); + require("default_origin", false); + require("origin", false); + require("hosted_url", false); + require("issuer", false); + require("passkey_rp_id", false); + require("sandbox", false); + require("custom_domains_available", false); + return new SetupDomain(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/SetupDomainRequest.java b/src/main/java/me/didit/types/SetupDomainRequest.java new file mode 100644 index 0000000..6cc7460 --- /dev/null +++ b/src/main/java/me/didit/types/SetupDomainRequest.java @@ -0,0 +1,100 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; + +/** Custom domain */ +public final class SetupDomainRequest extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("domain"); + + private SetupDomainRequest(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupDomainRequest} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupDomainRequest fromJson(JsonNode json) { + return new SetupDomainRequest(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The domain to serve the hosted pages on. It must be a host under a zone: a CNAME cannot sit at an apex. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String domain() { + return Json.required(json, "domain", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupDomainRequest}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupDomainRequest from) { + super(from); + } + + /** + * The domain to serve the hosted pages on. It must be a host under a zone: a CNAME cannot sit at an apex. + * + * @param domain the value + * @return this builder + */ + public Builder domain(String domain) { + return set("domain", Conv.STRING, domain); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupDomainRequest} + * @throws IllegalStateException when a required field is missing + */ + public SetupDomainRequest build() { + require("domain", false); + return new SetupDomainRequest(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/SetupEmail.java b/src/main/java/me/didit/types/SetupEmail.java new file mode 100644 index 0000000..67f5be6 --- /dev/null +++ b/src/main/java/me/didit/types/SetupEmail.java @@ -0,0 +1,205 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; + +/** Rendered sign-in email */ +public final class SetupEmail extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("key", "from", "to", "subject", "html", "enabled"); + + private SetupEmail(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupEmail} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupEmail fromJson(JsonNode json) { + return new SetupEmail(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The key field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String key() { + return Json.required(json, "key", Conv.STRING); + } + + /** + * The from field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String from() { + return Json.required(json, "from", Conv.STRING); + } + + /** + * The console member's address. Empty for a grant or a key. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String to() { + return Json.required(json, "to", Conv.STRING); + } + + /** + * The subject field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String subject() { + return Json.required(json, "subject", Conv.STRING); + } + + /** + * The html field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String html() { + return Json.required(json, "html", Conv.STRING); + } + + /** + * The enabled field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public boolean enabled() { + return Json.required(json, "enabled", Conv.BOOLEAN); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupEmail}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupEmail from) { + super(from); + } + + /** + * The key field. + * + * @param key the value + * @return this builder + */ + public Builder key(String key) { + return set("key", Conv.STRING, key); + } + + /** + * The from field. + * + * @param from the value + * @return this builder + */ + public Builder from(String from) { + return set("from", Conv.STRING, from); + } + + /** + * The console member's address. Empty for a grant or a key. + * + * @param to the value + * @return this builder + */ + public Builder to(String to) { + return set("to", Conv.STRING, to); + } + + /** + * The subject field. + * + * @param subject the value + * @return this builder + */ + public Builder subject(String subject) { + return set("subject", Conv.STRING, subject); + } + + /** + * The html field. + * + * @param html the value + * @return this builder + */ + public Builder html(String html) { + return set("html", Conv.STRING, html); + } + + /** + * The enabled field. + * + * @param enabled the value + * @return this builder + */ + public Builder enabled(boolean enabled) { + return set("enabled", Conv.BOOLEAN, enabled); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupEmail} + * @throws IllegalStateException when a required field is missing + */ + public SetupEmail build() { + require("key", false); + require("from", false); + require("to", false); + require("subject", false); + require("html", false); + require("enabled", false); + return new SetupEmail(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/SetupEmailSummary.java b/src/main/java/me/didit/types/SetupEmailSummary.java new file mode 100644 index 0000000..b9a1b6b --- /dev/null +++ b/src/main/java/me/didit/types/SetupEmailSummary.java @@ -0,0 +1,244 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; + +/** Sign-in email */ +public final class SetupEmailSummary extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("key", "icon", "sent", "enabled", "subject"); + + private SetupEmailSummary(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupEmailSummary} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupEmailSummary fromJson(JsonNode json) { + return new SetupEmailSummary(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The key field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupEmailSummary.Key key() { + return Json.required(json, "key", Conv.enumeration(SetupEmailSummary.Key::of)); + } + + /** + * The icon field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional icon() { + return Json.optional(json, "icon", Conv.STRING); + } + + /** + * Whether Authentication sends this email at all. false for device, agent and agentoff, which are listing placeholders. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public boolean sent() { + return Json.required(json, "sent", Conv.BOOLEAN); + } + + /** + * Whether this application sends it. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public boolean enabled() { + return Json.required(json, "enabled", Conv.BOOLEAN); + } + + /** + * The subject field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional subject() { + return Json.optional(json, "subject", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupEmailSummary}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupEmailSummary from) { + super(from); + } + + /** + * The key field. + * + * @param key the value + * @return this builder + */ + public Builder key(SetupEmailSummary.Key key) { + return set("key", Conv.enumeration(SetupEmailSummary.Key::of), key); + } + + /** + * The icon field. + * + * @param icon the value + * @return this builder + */ + public Builder icon(String icon) { + return set("icon", Conv.STRING, icon); + } + + /** + * Whether Authentication sends this email at all. false for device, agent and agentoff, which are listing placeholders. + * + * @param sent the value + * @return this builder + */ + public Builder sent(boolean sent) { + return set("sent", Conv.BOOLEAN, sent); + } + + /** + * Whether this application sends it. + * + * @param enabled the value + * @return this builder + */ + public Builder enabled(boolean enabled) { + return set("enabled", Conv.BOOLEAN, enabled); + } + + /** + * The subject field. + * + * @param subject the value + * @return this builder + */ + public Builder subject(String subject) { + return set("subject", Conv.STRING, subject); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupEmailSummary} + * @throws IllegalStateException when a required field is missing + */ + public SetupEmailSummary build() { + require("key", false); + require("sent", false); + require("enabled", false); + return new SetupEmailSummary(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Key extends StringEnum { + /** The value {@code "code"}. */ + public static final Key CODE = new Key("code"); + + /** The value {@code "magic"}. */ + public static final Key MAGIC = new Key("magic"); + + /** The value {@code "reset"}. */ + public static final Key RESET = new Key("reset"); + + /** The value {@code "device"}. */ + public static final Key DEVICE = new Key("device"); + + /** The value {@code "invite"}. */ + public static final Key INVITE = new Key("invite"); + + /** The value {@code "org"}. */ + public static final Key ORG = new Key("org"); + + /** The value {@code "agent"}. */ + public static final Key AGENT = new Key("agent"); + + /** The value {@code "agentoff"}. */ + public static final Key AGENTOFF = new Key("agentoff"); + + private static final List KNOWN_VALUES = List.of(CODE, MAGIC, RESET, DEVICE, INVITE, ORG, AGENT, AGENTOFF); + + private Key(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static Key of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Key::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } +} diff --git a/src/main/java/me/didit/types/SetupEmails.java b/src/main/java/me/didit/types/SetupEmails.java new file mode 100644 index 0000000..fd44c65 --- /dev/null +++ b/src/main/java/me/didit/types/SetupEmails.java @@ -0,0 +1,480 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import org.jspecify.annotations.Nullable; + +/** Sign-in emails */ +public final class SetupEmails extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("senders", "emails", "language"); + + private SetupEmails(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupEmails} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupEmails fromJson(JsonNode json) { + return new SetupEmails(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * Read-only: they come from Customization. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupEmails.Senders senders() { + return Json.required(json, "senders", Conv.model(SetupEmails.Senders::fromJson)); + } + + /** + * The emails field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public List emails() { + return Json.required(json, "emails", Conv.list(Conv.model(SetupEmailSummary::fromJson))); + } + + /** + * The language field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String language() { + return Json.required(json, "language", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupEmails}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupEmails from) { + super(from); + } + + /** + * Read-only: they come from Customization. + * + * @param senders the value + * @return this builder + */ + public Builder senders(SetupEmails.Senders senders) { + return set("senders", Conv.model(SetupEmails.Senders::fromJson), senders); + } + + /** + * The emails field. + * + * @param emails the value + * @return this builder + */ + public Builder emails(List emails) { + return set("emails", Conv.list(Conv.model(SetupEmailSummary::fromJson)), emails); + } + + /** + * The language field. + * + * @param language the value + * @return this builder + */ + public Builder language(String language) { + return set("language", Conv.STRING, language); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupEmails} + * @throws IllegalStateException when a required field is missing + */ + public SetupEmails build() { + require("senders", false); + require("emails", false); + require("language", false); + return new SetupEmails(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** Read-only: they come from Customization. */ + public static final class Senders extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("email", "sms"); + + private Senders(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Senders} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Senders fromJson(JsonNode json) { + return new Senders(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The email field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional email() { + return Json.optional(json, "email", Conv.model(SetupEmails.Senders.Email::fromJson)); + } + + /** + * The sms field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional sms() { + return Json.optional(json, "sms", Conv.model(SetupEmails.Senders.Sms::fromJson)); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Senders}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Senders from) { + super(from); + } + + /** + * The email field. + * + * @param email the value + * @return this builder + */ + public Builder email(SetupEmails.Senders.Email email) { + return set("email", Conv.model(SetupEmails.Senders.Email::fromJson), email); + } + + /** + * The sms field. + * + * @param sms the value + * @return this builder + */ + public Builder sms(SetupEmails.Senders.Sms sms) { + return set("sms", Conv.model(SetupEmails.Senders.Sms::fromJson), sms); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Senders} + */ + public Senders build() { + return new Senders(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + public static final class Email extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("name", "email", "header", "own"); + + private Email(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Email} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Email fromJson(JsonNode json) { + return new Email(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The name field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional name() { + return Json.optional(json, "name", Conv.STRING); + } + + /** + * The email field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional email() { + return Json.optional(json, "email", Conv.STRING); + } + + /** + * The header field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional header() { + return Json.optional(json, "header", Conv.STRING); + } + + /** + * Whether the application sends from its own verified domain. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional own() { + return Json.optional(json, "own", Conv.BOOLEAN); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Email}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Email from) { + super(from); + } + + /** + * The name field. + * + * @param name the value + * @return this builder + */ + public Builder name(String name) { + return set("name", Conv.STRING, name); + } + + /** + * The email field. + * + * @param email the value + * @return this builder + */ + public Builder email(String email) { + return set("email", Conv.STRING, email); + } + + /** + * The header field. + * + * @param header the value + * @return this builder + */ + public Builder header(String header) { + return set("header", Conv.STRING, header); + } + + /** + * Whether the application sends from its own verified domain. + * + * @param own the value + * @return this builder + */ + public Builder own(boolean own) { + return set("own", Conv.BOOLEAN, own); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Email} + */ + public Email build() { + return new Email(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } + + public static final class Sms extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("name"); + + private Sms(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Sms} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Sms fromJson(JsonNode json) { + return new Sms(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The name field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional name() { + return Json.optional(json, "name", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Sms}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Sms from) { + super(from); + } + + /** + * The name field. + * + * @param name the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder name(@Nullable String name) { + return setNullable("name", Conv.STRING, name); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Sms} + */ + public Sms build() { + return new Sms(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } + } +} diff --git a/src/main/java/me/didit/types/SetupMethodResult.java b/src/main/java/me/didit/types/SetupMethodResult.java new file mode 100644 index 0000000..419a1da --- /dev/null +++ b/src/main/java/me/didit/types/SetupMethodResult.java @@ -0,0 +1,246 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; + +/** Sign-in method */ +public final class SetupMethodResult extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("name", "enabled", "credential_source", "configured", "client_id", "callback_uri"); + + private SetupMethodResult(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupMethodResult} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupMethodResult fromJson(JsonNode json) { + return new SetupMethodResult(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The name field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String name() { + return Json.required(json, "name", Conv.STRING); + } + + /** + * The enabled field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public boolean enabled() { + return Json.required(json, "enabled", Conv.BOOLEAN); + } + + /** + * Returned only for social methods. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional credentialSource() { + return Json.optional(json, "credential_source", Conv.enumeration(SetupMethodResult.CredentialSource::of)); + } + + /** + * Whether the method can now sign anyone in. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional configured() { + return Json.optional(json, "configured", Conv.BOOLEAN); + } + + /** + * The client_id field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional clientId() { + return Json.optional(json, "client_id", Conv.STRING); + } + + /** + * The callback_uri field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional callbackUri() { + return Json.optional(json, "callback_uri", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupMethodResult}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupMethodResult from) { + super(from); + } + + /** + * The name field. + * + * @param name the value + * @return this builder + */ + public Builder name(String name) { + return set("name", Conv.STRING, name); + } + + /** + * The enabled field. + * + * @param enabled the value + * @return this builder + */ + public Builder enabled(boolean enabled) { + return set("enabled", Conv.BOOLEAN, enabled); + } + + /** + * Returned only for social methods. + * + * @param credentialSource the value + * @return this builder + */ + public Builder credentialSource(SetupMethodResult.CredentialSource credentialSource) { + return set("credential_source", Conv.enumeration(SetupMethodResult.CredentialSource::of), credentialSource); + } + + /** + * Whether the method can now sign anyone in. + * + * @param configured the value + * @return this builder + */ + public Builder configured(boolean configured) { + return set("configured", Conv.BOOLEAN, configured); + } + + /** + * The client_id field. + * + * @param clientId the value + * @return this builder + */ + public Builder clientId(String clientId) { + return set("client_id", Conv.STRING, clientId); + } + + /** + * The callback_uri field. + * + * @param callbackUri the value + * @return this builder + */ + public Builder callbackUri(String callbackUri) { + return set("callback_uri", Conv.STRING, callbackUri); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupMethodResult} + * @throws IllegalStateException when a required field is missing + */ + public SetupMethodResult build() { + require("name", false); + require("enabled", false); + return new SetupMethodResult(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * Returned only for social methods. + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class CredentialSource extends StringEnum { + /** The value {@code "own"}. */ + public static final CredentialSource OWN = new CredentialSource("own"); + + /** The value {@code "didit_test"}. */ + public static final CredentialSource DIDIT_TEST = new CredentialSource("didit_test"); + + private static final List KNOWN_VALUES = List.of(OWN, DIDIT_TEST); + + private CredentialSource(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static CredentialSource of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, CredentialSource::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } +} diff --git a/src/main/java/me/didit/types/SetupMethodSummary.java b/src/main/java/me/didit/types/SetupMethodSummary.java new file mode 100644 index 0000000..2d22a7a --- /dev/null +++ b/src/main/java/me/didit/types/SetupMethodSummary.java @@ -0,0 +1,359 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; +import org.jspecify.annotations.Nullable; + +/** + * One sign-in method. credential_source is null for a method that holds no social credentials, and always_on appears on the methods that are on for every application. + */ +public final class SetupMethodSummary extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("name", "enabled", "credential_source", "always_on", "available", "configured", "client_id", "callback_uri"); + + private SetupMethodSummary(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupMethodSummary} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupMethodSummary fromJson(JsonNode json) { + return new SetupMethodSummary(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The name field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupMethodSummary.Name name() { + return Json.required(json, "name", Conv.enumeration(SetupMethodSummary.Name::of)); + } + + /** + * The enabled field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public boolean enabled() { + return Json.required(json, "enabled", Conv.BOOLEAN); + } + + /** + * own for the application's credentials, didit_test for Didit's sandbox app, null for a method that takes no social credentials. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional credentialSource() { + return Json.optional(json, "credential_source", Conv.enumeration(SetupMethodSummary.CredentialSource::of)); + } + + /** + * Present and true on a method no application can switch off. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional alwaysOn() { + return Json.optional(json, "always_on", Conv.BOOLEAN); + } + + /** + * wallet only: whether Didit ID Wallet sign-in can be offered. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional available() { + return Json.optional(json, "available", Conv.BOOLEAN); + } + + /** + * Whether the method has the credentials it needs to sign anyone in. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional configured() { + return Json.optional(json, "configured", Conv.BOOLEAN); + } + + /** + * The social client ID in use, or an empty string. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional clientId() { + return Json.optional(json, "client_id", Conv.STRING); + } + + /** + * The redirect URI to register with the provider; Didit's own broker for didit_test. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional callbackUri() { + return Json.optional(json, "callback_uri", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupMethodSummary}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupMethodSummary from) { + super(from); + } + + /** + * The name field. + * + * @param name the value + * @return this builder + */ + public Builder name(SetupMethodSummary.Name name) { + return set("name", Conv.enumeration(SetupMethodSummary.Name::of), name); + } + + /** + * The enabled field. + * + * @param enabled the value + * @return this builder + */ + public Builder enabled(boolean enabled) { + return set("enabled", Conv.BOOLEAN, enabled); + } + + /** + * own for the application's credentials, didit_test for Didit's sandbox app, null for a method that takes no social credentials. + * + * @param credentialSource the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder credentialSource(SetupMethodSummary.@Nullable CredentialSource credentialSource) { + return setNullable("credential_source", Conv.enumeration(SetupMethodSummary.CredentialSource::of), credentialSource); + } + + /** + * Present and true on a method no application can switch off. + * + * @param alwaysOn the value + * @return this builder + */ + public Builder alwaysOn(boolean alwaysOn) { + return set("always_on", Conv.BOOLEAN, alwaysOn); + } + + /** + * wallet only: whether Didit ID Wallet sign-in can be offered. + * + * @param available the value + * @return this builder + */ + public Builder available(boolean available) { + return set("available", Conv.BOOLEAN, available); + } + + /** + * Whether the method has the credentials it needs to sign anyone in. + * + * @param configured the value + * @return this builder + */ + public Builder configured(boolean configured) { + return set("configured", Conv.BOOLEAN, configured); + } + + /** + * The social client ID in use, or an empty string. + * + * @param clientId the value + * @return this builder + */ + public Builder clientId(String clientId) { + return set("client_id", Conv.STRING, clientId); + } + + /** + * The redirect URI to register with the provider; Didit's own broker for didit_test. + * + * @param callbackUri the value + * @return this builder + */ + public Builder callbackUri(String callbackUri) { + return set("callback_uri", Conv.STRING, callbackUri); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupMethodSummary} + * @throws IllegalStateException when a required field is missing + */ + public SetupMethodSummary build() { + require("name", false); + require("enabled", false); + require("credential_source", true); + return new SetupMethodSummary(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Name extends StringEnum { + /** The value {@code "password"}. */ + public static final Name PASSWORD = new Name("password"); + + /** The value {@code "code"}. */ + public static final Name CODE = new Name("code"); + + /** The value {@code "magic"}. */ + public static final Name MAGIC = new Name("magic"); + + /** The value {@code "phone"}. */ + public static final Name PHONE = new Name("phone"); + + /** The value {@code "passkey"}. */ + public static final Name PASSKEY = new Name("passkey"); + + /** The value {@code "google"}. */ + public static final Name GOOGLE = new Name("google"); + + /** The value {@code "microsoft"}. */ + public static final Name MICROSOFT = new Name("microsoft"); + + /** The value {@code "apple"}. */ + public static final Name APPLE = new Name("apple"); + + /** The value {@code "github"}. */ + public static final Name GITHUB = new Name("github"); + + /** The value {@code "sso"}. */ + public static final Name SSO = new Name("sso"); + + /** The value {@code "wallet"}. */ + public static final Name WALLET = new Name("wallet"); + + private static final List KNOWN_VALUES = List.of(PASSWORD, CODE, MAGIC, PHONE, PASSKEY, GOOGLE, MICROSOFT, APPLE, GITHUB, SSO, WALLET); + + private Name(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static Name of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Name::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + /** + * own for the application's credentials, didit_test for Didit's sandbox app, null for a method that takes no social credentials. + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class CredentialSource extends StringEnum { + /** The value {@code "own"}. */ + public static final CredentialSource OWN = new CredentialSource("own"); + + /** The value {@code "didit_test"}. */ + public static final CredentialSource DIDIT_TEST = new CredentialSource("didit_test"); + + private static final List KNOWN_VALUES = List.of(OWN, DIDIT_TEST); + + private CredentialSource(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static CredentialSource of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, CredentialSource::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } +} diff --git a/src/main/java/me/didit/types/SetupMethodUpdate.java b/src/main/java/me/didit/types/SetupMethodUpdate.java new file mode 100644 index 0000000..bf03204 --- /dev/null +++ b/src/main/java/me/didit/types/SetupMethodUpdate.java @@ -0,0 +1,207 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; + +/** + * enabled is required. credentials belongs to a social method, workflow_id to phone, and credential_source to a social method; anywhere else they answer not_supported. An unknown field answers unknown_field. + */ +public final class SetupMethodUpdate extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("enabled", "credentials", "credential_source", "workflow_id"); + + private SetupMethodUpdate(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupMethodUpdate} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupMethodUpdate fromJson(JsonNode json) { + return new SetupMethodUpdate(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The enabled field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public boolean enabled() { + return Json.required(json, "enabled", Conv.BOOLEAN); + } + + /** + * Your own OAuth app's credentials. The secret is write-only: no response returns it. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional credentials() { + return Json.optional(json, "credentials", Conv.model(SetupProviderCredentials::fromJson)); + } + + /** + * didit_test uses Didit's own sandbox app, and is refused on a live application with sandbox_only. Omitted: own when you send credentials, the stored source otherwise, and didit_test for a sandbox application's social method that was never configured. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional credentialSource() { + return Json.optional(json, "credential_source", Conv.enumeration(SetupMethodUpdate.CredentialSource::of)); + } + + /** + * phone only: the phone verification workflow whose codes it sends. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional workflowId() { + return Json.optional(json, "workflow_id", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupMethodUpdate}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupMethodUpdate from) { + super(from); + } + + /** + * The enabled field. + * + * @param enabled the value + * @return this builder + */ + public Builder enabled(boolean enabled) { + return set("enabled", Conv.BOOLEAN, enabled); + } + + /** + * Your own OAuth app's credentials. The secret is write-only: no response returns it. + * + * @param credentials the value + * @return this builder + */ + public Builder credentials(SetupProviderCredentials credentials) { + return set("credentials", Conv.model(SetupProviderCredentials::fromJson), credentials); + } + + /** + * didit_test uses Didit's own sandbox app, and is refused on a live application with sandbox_only. Omitted: own when you send credentials, the stored source otherwise, and didit_test for a sandbox application's social method that was never configured. + * + * @param credentialSource the value + * @return this builder + */ + public Builder credentialSource(SetupMethodUpdate.CredentialSource credentialSource) { + return set("credential_source", Conv.enumeration(SetupMethodUpdate.CredentialSource::of), credentialSource); + } + + /** + * phone only: the phone verification workflow whose codes it sends. + * + * @param workflowId the value + * @return this builder + */ + public Builder workflowId(String workflowId) { + return set("workflow_id", Conv.STRING, workflowId); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupMethodUpdate} + * @throws IllegalStateException when a required field is missing + */ + public SetupMethodUpdate build() { + require("enabled", false); + return new SetupMethodUpdate(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * didit_test uses Didit's own sandbox app, and is refused on a live application with sandbox_only. Omitted: own when you send credentials, the stored source otherwise, and didit_test for a sandbox application's social method that was never configured. + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class CredentialSource extends StringEnum { + /** The value {@code "own"}. */ + public static final CredentialSource OWN = new CredentialSource("own"); + + /** The value {@code "didit_test"}. */ + public static final CredentialSource DIDIT_TEST = new CredentialSource("didit_test"); + + private static final List KNOWN_VALUES = List.of(OWN, DIDIT_TEST); + + private CredentialSource(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static CredentialSource of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, CredentialSource::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } +} diff --git a/src/main/java/me/didit/types/SetupNativeApps.java b/src/main/java/me/didit/types/SetupNativeApps.java new file mode 100644 index 0000000..1ad15d8 --- /dev/null +++ b/src/main/java/me/didit/types/SetupNativeApps.java @@ -0,0 +1,121 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; + +/** Native apps */ +public final class SetupNativeApps extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("ios_app_ids", "android_apps"); + + private SetupNativeApps(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupNativeApps} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupNativeApps fromJson(JsonNode json) { + return new SetupNativeApps(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * Apple team ID and bundle identifier, as webcredentials names an app. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public List iosAppIds() { + return Json.required(json, "ios_app_ids", Conv.list(Conv.STRING)); + } + + /** + * The android_apps field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public List androidApps() { + return Json.required(json, "android_apps", Conv.list(Conv.model(SetupAndroidApp::fromJson))); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupNativeApps}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupNativeApps from) { + super(from); + } + + /** + * Apple team ID and bundle identifier, as webcredentials names an app. + * + * @param iosAppIds the value + * @return this builder + */ + public Builder iosAppIds(List iosAppIds) { + return set("ios_app_ids", Conv.list(Conv.STRING), iosAppIds); + } + + /** + * The android_apps field. + * + * @param androidApps the value + * @return this builder + */ + public Builder androidApps(List androidApps) { + return set("android_apps", Conv.list(Conv.model(SetupAndroidApp::fromJson)), androidApps); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupNativeApps} + * @throws IllegalStateException when a required field is missing + */ + public SetupNativeApps build() { + require("ios_app_ids", false); + require("android_apps", false); + return new SetupNativeApps(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/SetupNativeAppsUpdate.java b/src/main/java/me/didit/types/SetupNativeAppsUpdate.java new file mode 100644 index 0000000..637db1e --- /dev/null +++ b/src/main/java/me/didit/types/SetupNativeAppsUpdate.java @@ -0,0 +1,121 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; + +/** Both lists are replaced. Duplicates are dropped. */ +public final class SetupNativeAppsUpdate extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("ios_app_ids", "android_apps"); + + private SetupNativeAppsUpdate(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupNativeAppsUpdate} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupNativeAppsUpdate fromJson(JsonNode json) { + return new SetupNativeAppsUpdate(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The ios_app_ids field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public List iosAppIds() { + return Json.required(json, "ios_app_ids", Conv.list(Conv.STRING)); + } + + /** + * The android_apps field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public List androidApps() { + return Json.required(json, "android_apps", Conv.list(Conv.model(SetupAndroidApp::fromJson))); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupNativeAppsUpdate}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupNativeAppsUpdate from) { + super(from); + } + + /** + * The ios_app_ids field. + * + * @param iosAppIds the value + * @return this builder + */ + public Builder iosAppIds(List iosAppIds) { + return set("ios_app_ids", Conv.list(Conv.STRING), iosAppIds); + } + + /** + * The android_apps field. + * + * @param androidApps the value + * @return this builder + */ + public Builder androidApps(List androidApps) { + return set("android_apps", Conv.list(Conv.model(SetupAndroidApp::fromJson)), androidApps); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupNativeAppsUpdate} + * @throws IllegalStateException when a required field is missing + */ + public SetupNativeAppsUpdate build() { + require("ios_app_ids", false); + require("android_apps", false); + return new SetupNativeAppsUpdate(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/SetupOnboarding.java b/src/main/java/me/didit/types/SetupOnboarding.java new file mode 100644 index 0000000..9facee0 --- /dev/null +++ b/src/main/java/me/didit/types/SetupOnboarding.java @@ -0,0 +1,321 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; +import org.jspecify.annotations.Nullable; + +/** Onboarding progress */ +public final class SetupOnboarding extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("completed", "ready", "sign_in_ui", "test_sign_in", "test_status"); + + private SetupOnboarding(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupOnboarding} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupOnboarding fromJson(JsonNode json) { + return new SetupOnboarding(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The completed field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public List completed() { + return Json.required(json, "completed", Conv.list(Conv.enumeration(SetupOnboarding.Completed::of))); + } + + /** + * Every setup step is done. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public boolean ready() { + return Json.required(json, "ready", Conv.BOOLEAN); + } + + /** + * The sign_in_ui field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupOnboarding.SignInUi signInUi() { + return Json.required(json, "sign_in_ui", Conv.enumeration(SetupOnboarding.SignInUi::of)); + } + + /** + * Console session only: the sample sign-in the console shows, naming an end user. Left out for a grant or a key. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional> testSignIn() { + return Json.optional(json, "test_sign_in", Conv.OBJECT); + } + + /** + * The test_status field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupOnboarding.TestStatus testStatus() { + return Json.required(json, "test_status", Conv.enumeration(SetupOnboarding.TestStatus::of)); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupOnboarding}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupOnboarding from) { + super(from); + } + + /** + * The completed field. + * + * @param completed the value + * @return this builder + */ + public Builder completed(List completed) { + return set("completed", Conv.list(Conv.enumeration(SetupOnboarding.Completed::of)), completed); + } + + /** + * Every setup step is done. + * + * @param ready the value + * @return this builder + */ + public Builder ready(boolean ready) { + return set("ready", Conv.BOOLEAN, ready); + } + + /** + * The sign_in_ui field. + * + * @param signInUi the value + * @return this builder + */ + public Builder signInUi(SetupOnboarding.SignInUi signInUi) { + return set("sign_in_ui", Conv.enumeration(SetupOnboarding.SignInUi::of), signInUi); + } + + /** + * Console session only: the sample sign-in the console shows, naming an end user. Left out for a grant or a key. + * + * @param testSignIn the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder testSignIn(@Nullable Map testSignIn) { + return setAny("test_sign_in", testSignIn); + } + + /** + * The test_status field. + * + * @param testStatus the value + * @return this builder + */ + public Builder testStatus(SetupOnboarding.TestStatus testStatus) { + return set("test_status", Conv.enumeration(SetupOnboarding.TestStatus::of), testStatus); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupOnboarding} + * @throws IllegalStateException when a required field is missing + */ + public SetupOnboarding build() { + require("completed", false); + require("ready", false); + require("sign_in_ui", false); + require("test_status", false); + return new SetupOnboarding(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Completed extends StringEnum { + /** The value {@code "methods"}. */ + public static final Completed METHODS = new Completed("methods"); + + /** The value {@code "redirects"}. */ + public static final Completed REDIRECTS = new Completed("redirects"); + + /** The value {@code "import"}. */ + public static final Completed IMPORT = new Completed("import"); + + /** The value {@code "test"}. */ + public static final Completed TEST = new Completed("test"); + + private static final List KNOWN_VALUES = List.of(METHODS, REDIRECTS, IMPORT, TEST); + + private Completed(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static Completed of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Completed::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class SignInUi extends StringEnum { + /** The value {@code "hosted"}. */ + public static final SignInUi HOSTED = new SignInUi("hosted"); + + /** The value {@code "own"}. */ + public static final SignInUi OWN = new SignInUi("own"); + + private static final List KNOWN_VALUES = List.of(HOSTED, OWN); + + private SignInUi(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static SignInUi of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, SignInUi::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class TestStatus extends StringEnum { + /** The value {@code "verified"}. */ + public static final TestStatus VERIFIED = new TestStatus("verified"); + + /** The value {@code "skipped"}. */ + public static final TestStatus SKIPPED = new TestStatus("skipped"); + + /** The value {@code "not_started"}. */ + public static final TestStatus NOT_STARTED = new TestStatus("not_started"); + + private static final List KNOWN_VALUES = List.of(VERIFIED, SKIPPED, NOT_STARTED); + + private TestStatus(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static TestStatus of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, TestStatus::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } +} diff --git a/src/main/java/me/didit/types/SetupOnboardingUpdate.java b/src/main/java/me/didit/types/SetupOnboardingUpdate.java new file mode 100644 index 0000000..be9c0f0 --- /dev/null +++ b/src/main/java/me/didit/types/SetupOnboardingUpdate.java @@ -0,0 +1,184 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; + +/** + * At least one field is required; an empty body answers {"non_field_errors": ["empty_update"]}. + */ +public final class SetupOnboardingUpdate extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("test_skipped", "import_skipped", "sign_in_ui"); + + private SetupOnboardingUpdate(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupOnboardingUpdate} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupOnboardingUpdate fromJson(JsonNode json) { + return new SetupOnboardingUpdate(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The test_skipped field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional testSkipped() { + return Json.optional(json, "test_skipped", Conv.BOOLEAN); + } + + /** + * The import_skipped field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional importSkipped() { + return Json.optional(json, "import_skipped", Conv.BOOLEAN); + } + + /** + * The sign_in_ui field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional signInUi() { + return Json.optional(json, "sign_in_ui", Conv.enumeration(SetupOnboardingUpdate.SignInUi::of)); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupOnboardingUpdate}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupOnboardingUpdate from) { + super(from); + } + + /** + * The test_skipped field. + * + * @param testSkipped the value + * @return this builder + */ + public Builder testSkipped(boolean testSkipped) { + return set("test_skipped", Conv.BOOLEAN, testSkipped); + } + + /** + * The import_skipped field. + * + * @param importSkipped the value + * @return this builder + */ + public Builder importSkipped(boolean importSkipped) { + return set("import_skipped", Conv.BOOLEAN, importSkipped); + } + + /** + * The sign_in_ui field. + * + * @param signInUi the value + * @return this builder + */ + public Builder signInUi(SetupOnboardingUpdate.SignInUi signInUi) { + return set("sign_in_ui", Conv.enumeration(SetupOnboardingUpdate.SignInUi::of), signInUi); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupOnboardingUpdate} + */ + public SetupOnboardingUpdate build() { + return new SetupOnboardingUpdate(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class SignInUi extends StringEnum { + /** The value {@code "hosted"}. */ + public static final SignInUi HOSTED = new SignInUi("hosted"); + + /** The value {@code "own"}. */ + public static final SignInUi OWN = new SignInUi("own"); + + private static final List KNOWN_VALUES = List.of(HOSTED, OWN); + + private SignInUi(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static SignInUi of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, SignInUi::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } +} diff --git a/src/main/java/me/didit/types/SetupProtection.java b/src/main/java/me/didit/types/SetupProtection.java new file mode 100644 index 0000000..91fb760 --- /dev/null +++ b/src/main/java/me/didit/types/SetupProtection.java @@ -0,0 +1,1575 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import org.jspecify.annotations.Nullable; + +/** Bot protection */ +public final class SetupProtection extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("enabled", "breached_password_check", "protections", "daily", "challenges_daily", "period_days", "calendar_month", "attack_mode", "selfie_available"); + + private SetupProtection(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupProtection} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupProtection fromJson(JsonNode json) { + return new SetupProtection(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The enabled field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public boolean enabled() { + return Json.required(json, "enabled", Conv.BOOLEAN); + } + + /** + * The breached_password_check field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public boolean breachedPasswordCheck() { + return Json.required(json, "breached_password_check", Conv.BOOLEAN); + } + + /** + * The protections field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public List protections() { + return Json.required(json, "protections", Conv.list(Conv.model(SetupProtectionPolicy::fromJson))); + } + + /** + * Detections per day, policy and action. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional> daily() { + return Json.optional(json, "daily", Conv.list(Conv.model(SetupProtection.Daily::fromJson))); + } + + /** + * Extra proofs asked for and how they ended. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional> challengesDaily() { + return Json.optional(json, "challenges_daily", Conv.list(Conv.model(SetupProtection.ChallengesDaily::fromJson))); + } + + /** + * The period_days field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public long periodDays() { + return Json.required(json, "period_days", Conv.LONG); + } + + /** + * This calendar month against the previous one. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional calendarMonth() { + return Json.optional(json, "calendar_month", Conv.model(SetupProtection.CalendarMonth::fromJson)); + } + + /** + * The attack_mode field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional attackMode() { + return Json.optional(json, "attack_mode", Conv.model(SetupProtection.AttackMode::fromJson)); + } + + /** + * The selfie_available field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional selfieAvailable() { + return Json.optional(json, "selfie_available", Conv.BOOLEAN); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupProtection}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupProtection from) { + super(from); + } + + /** + * The enabled field. + * + * @param enabled the value + * @return this builder + */ + public Builder enabled(boolean enabled) { + return set("enabled", Conv.BOOLEAN, enabled); + } + + /** + * The breached_password_check field. + * + * @param breachedPasswordCheck the value + * @return this builder + */ + public Builder breachedPasswordCheck(boolean breachedPasswordCheck) { + return set("breached_password_check", Conv.BOOLEAN, breachedPasswordCheck); + } + + /** + * The protections field. + * + * @param protections the value + * @return this builder + */ + public Builder protections(List protections) { + return set("protections", Conv.list(Conv.model(SetupProtectionPolicy::fromJson)), protections); + } + + /** + * Detections per day, policy and action. + * + * @param daily the value + * @return this builder + */ + public Builder daily(List daily) { + return set("daily", Conv.list(Conv.model(SetupProtection.Daily::fromJson)), daily); + } + + /** + * Extra proofs asked for and how they ended. + * + * @param challengesDaily the value + * @return this builder + */ + public Builder challengesDaily(List challengesDaily) { + return set("challenges_daily", Conv.list(Conv.model(SetupProtection.ChallengesDaily::fromJson)), challengesDaily); + } + + /** + * The period_days field. + * + * @param periodDays the value + * @return this builder + */ + public Builder periodDays(long periodDays) { + return set("period_days", Conv.LONG, periodDays); + } + + /** + * This calendar month against the previous one. + * + * @param calendarMonth the value + * @return this builder + */ + public Builder calendarMonth(SetupProtection.CalendarMonth calendarMonth) { + return set("calendar_month", Conv.model(SetupProtection.CalendarMonth::fromJson), calendarMonth); + } + + /** + * The attack_mode field. + * + * @param attackMode the value + * @return this builder + */ + public Builder attackMode(SetupProtection.AttackMode attackMode) { + return set("attack_mode", Conv.model(SetupProtection.AttackMode::fromJson), attackMode); + } + + /** + * The selfie_available field. + * + * @param selfieAvailable the value + * @return this builder + */ + public Builder selfieAvailable(boolean selfieAvailable) { + return set("selfie_available", Conv.BOOLEAN, selfieAvailable); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupProtection} + * @throws IllegalStateException when a required field is missing + */ + public SetupProtection build() { + require("enabled", false); + require("breached_password_check", false); + require("protections", false); + require("period_days", false); + return new SetupProtection(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + public static final class Daily extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("date", "protection", "action", "count"); + + private Daily(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Daily} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Daily fromJson(JsonNode json) { + return new Daily(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The date field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional date() { + return Json.optional(json, "date", Conv.DATE); + } + + /** + * The protection field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional protection() { + return Json.optional(json, "protection", Conv.STRING); + } + + /** + * The action field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional action() { + return Json.optional(json, "action", Conv.STRING); + } + + /** + * The count field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional count() { + return Json.optional(json, "count", Conv.LONG); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Daily}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Daily from) { + super(from); + } + + /** + * The date field. + * + * @param date the value + * @return this builder + */ + public Builder date(LocalDate date) { + return set("date", Conv.DATE, date); + } + + /** + * The protection field. + * + * @param protection the value + * @return this builder + */ + public Builder protection(String protection) { + return set("protection", Conv.STRING, protection); + } + + /** + * The action field. + * + * @param action the value + * @return this builder + */ + public Builder action(String action) { + return set("action", Conv.STRING, action); + } + + /** + * The count field. + * + * @param count the value + * @return this builder + */ + public Builder count(long count) { + return set("count", Conv.LONG, count); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Daily} + */ + public Daily build() { + return new Daily(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } + + public static final class ChallengesDaily extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("date", "passed", "failed"); + + private ChallengesDaily(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code ChallengesDaily} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static ChallengesDaily fromJson(JsonNode json) { + return new ChallengesDaily(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The date field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional date() { + return Json.optional(json, "date", Conv.DATE); + } + + /** + * The passed field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional passed() { + return Json.optional(json, "passed", Conv.LONG); + } + + /** + * The failed field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional failed() { + return Json.optional(json, "failed", Conv.LONG); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link ChallengesDaily}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(ChallengesDaily from) { + super(from); + } + + /** + * The date field. + * + * @param date the value + * @return this builder + */ + public Builder date(LocalDate date) { + return set("date", Conv.DATE, date); + } + + /** + * The passed field. + * + * @param passed the value + * @return this builder + */ + public Builder passed(long passed) { + return set("passed", Conv.LONG, passed); + } + + /** + * The failed field. + * + * @param failed the value + * @return this builder + */ + public Builder failed(long failed) { + return set("failed", Conv.LONG, failed); + } + + /** + * Builds the value. + * + * @return a new immutable {@code ChallengesDaily} + */ + public ChallengesDaily build() { + return new ChallengesDaily(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } + + /** This calendar month against the previous one. */ + public static final class CalendarMonth extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("start", "as_of", "previous_start", "previous_end", "protections", "challenges"); + + private CalendarMonth(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code CalendarMonth} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static CalendarMonth fromJson(JsonNode json) { + return new CalendarMonth(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The start field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional start() { + return Json.optional(json, "start", Conv.DATE_TIME); + } + + /** + * The as_of field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional asOf() { + return Json.optional(json, "as_of", Conv.DATE_TIME); + } + + /** + * The previous_start field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional previousStart() { + return Json.optional(json, "previous_start", Conv.DATE_TIME); + } + + /** + * The previous_end field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional previousEnd() { + return Json.optional(json, "previous_end", Conv.DATE_TIME); + } + + /** + * The protections field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional> protections() { + return Json.optional(json, "protections", Conv.list(Conv.model(SetupProtection.CalendarMonth.Protections::fromJson))); + } + + /** + * The challenges field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional challenges() { + return Json.optional(json, "challenges", Conv.model(SetupProtection.CalendarMonth.Challenges::fromJson)); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link CalendarMonth}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(CalendarMonth from) { + super(from); + } + + /** + * The start field. + * + * @param start the value + * @return this builder + */ + public Builder start(OffsetDateTime start) { + return set("start", Conv.DATE_TIME, start); + } + + /** + * The as_of field. + * + * @param asOf the value + * @return this builder + */ + public Builder asOf(OffsetDateTime asOf) { + return set("as_of", Conv.DATE_TIME, asOf); + } + + /** + * The previous_start field. + * + * @param previousStart the value + * @return this builder + */ + public Builder previousStart(OffsetDateTime previousStart) { + return set("previous_start", Conv.DATE_TIME, previousStart); + } + + /** + * The previous_end field. + * + * @param previousEnd the value + * @return this builder + */ + public Builder previousEnd(OffsetDateTime previousEnd) { + return set("previous_end", Conv.DATE_TIME, previousEnd); + } + + /** + * The protections field. + * + * @param protections the value + * @return this builder + */ + public Builder protections(List protections) { + return set("protections", Conv.list(Conv.model(SetupProtection.CalendarMonth.Protections::fromJson)), protections); + } + + /** + * The challenges field. + * + * @param challenges the value + * @return this builder + */ + public Builder challenges(SetupProtection.CalendarMonth.Challenges challenges) { + return set("challenges", Conv.model(SetupProtection.CalendarMonth.Challenges::fromJson), challenges); + } + + /** + * Builds the value. + * + * @return a new immutable {@code CalendarMonth} + */ + public CalendarMonth build() { + return new CalendarMonth(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + public static final class Protections extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("key", "counts", "previous_counts", "counts_delta", "accounts", "previous_accounts", "accounts_delta"); + + private Protections(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Protections} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Protections fromJson(JsonNode json) { + return new Protections(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The key field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional key() { + return Json.optional(json, "key", Conv.STRING); + } + + /** + * The counts field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional counts() { + return Json.optional(json, "counts", Conv.model(SetupProtection.CalendarMonth.Protections.Counts::fromJson)); + } + + /** + * The previous_counts field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional previousCounts() { + return Json.optional(json, "previous_counts", Conv.model(SetupProtection.CalendarMonth.Protections.PreviousCounts::fromJson)); + } + + /** + * The counts_delta field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional countsDelta() { + return Json.optional(json, "counts_delta", Conv.model(SetupProtection.CalendarMonth.Protections.CountsDelta::fromJson)); + } + + /** + * The accounts field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional accounts() { + return Json.optional(json, "accounts", Conv.LONG); + } + + /** + * The previous_accounts field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional previousAccounts() { + return Json.optional(json, "previous_accounts", Conv.LONG); + } + + /** + * The accounts_delta field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional accountsDelta() { + return Json.optional(json, "accounts_delta", Conv.LONG); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Protections}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Protections from) { + super(from); + } + + /** + * The key field. + * + * @param key the value + * @return this builder + */ + public Builder key(String key) { + return set("key", Conv.STRING, key); + } + + /** + * The counts field. + * + * @param counts the value + * @return this builder + */ + public Builder counts(SetupProtection.CalendarMonth.Protections.Counts counts) { + return set("counts", Conv.model(SetupProtection.CalendarMonth.Protections.Counts::fromJson), counts); + } + + /** + * The previous_counts field. + * + * @param previousCounts the value + * @return this builder + */ + public Builder previousCounts(SetupProtection.CalendarMonth.Protections.PreviousCounts previousCounts) { + return set("previous_counts", Conv.model(SetupProtection.CalendarMonth.Protections.PreviousCounts::fromJson), previousCounts); + } + + /** + * The counts_delta field. + * + * @param countsDelta the value + * @return this builder + */ + public Builder countsDelta(SetupProtection.CalendarMonth.Protections.CountsDelta countsDelta) { + return set("counts_delta", Conv.model(SetupProtection.CalendarMonth.Protections.CountsDelta::fromJson), countsDelta); + } + + /** + * The accounts field. + * + * @param accounts the value + * @return this builder + */ + public Builder accounts(long accounts) { + return set("accounts", Conv.LONG, accounts); + } + + /** + * The previous_accounts field. + * + * @param previousAccounts the value + * @return this builder + */ + public Builder previousAccounts(long previousAccounts) { + return set("previous_accounts", Conv.LONG, previousAccounts); + } + + /** + * The accounts_delta field. + * + * @param accountsDelta the value + * @return this builder + */ + public Builder accountsDelta(long accountsDelta) { + return set("accounts_delta", Conv.LONG, accountsDelta); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Protections} + */ + public Protections build() { + return new Protections(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + public static final class Counts extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("log", "challenge", "block"); + + private Counts(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Counts} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Counts fromJson(JsonNode json) { + return new Counts(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The log field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional log() { + return Json.optional(json, "log", Conv.LONG); + } + + /** + * The challenge field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional challenge() { + return Json.optional(json, "challenge", Conv.LONG); + } + + /** + * The block field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional block() { + return Json.optional(json, "block", Conv.LONG); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Counts}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Counts from) { + super(from); + } + + /** + * The log field. + * + * @param log the value + * @return this builder + */ + public Builder log(long log) { + return set("log", Conv.LONG, log); + } + + /** + * The challenge field. + * + * @param challenge the value + * @return this builder + */ + public Builder challenge(long challenge) { + return set("challenge", Conv.LONG, challenge); + } + + /** + * The block field. + * + * @param block the value + * @return this builder + */ + public Builder block(long block) { + return set("block", Conv.LONG, block); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Counts} + */ + public Counts build() { + return new Counts(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } + + public static final class PreviousCounts extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("log", "challenge", "block"); + + private PreviousCounts(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code PreviousCounts} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static PreviousCounts fromJson(JsonNode json) { + return new PreviousCounts(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The log field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional log() { + return Json.optional(json, "log", Conv.LONG); + } + + /** + * The challenge field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional challenge() { + return Json.optional(json, "challenge", Conv.LONG); + } + + /** + * The block field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional block() { + return Json.optional(json, "block", Conv.LONG); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link PreviousCounts}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(PreviousCounts from) { + super(from); + } + + /** + * The log field. + * + * @param log the value + * @return this builder + */ + public Builder log(long log) { + return set("log", Conv.LONG, log); + } + + /** + * The challenge field. + * + * @param challenge the value + * @return this builder + */ + public Builder challenge(long challenge) { + return set("challenge", Conv.LONG, challenge); + } + + /** + * The block field. + * + * @param block the value + * @return this builder + */ + public Builder block(long block) { + return set("block", Conv.LONG, block); + } + + /** + * Builds the value. + * + * @return a new immutable {@code PreviousCounts} + */ + public PreviousCounts build() { + return new PreviousCounts(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } + + public static final class CountsDelta extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("log", "challenge", "block"); + + private CountsDelta(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code CountsDelta} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static CountsDelta fromJson(JsonNode json) { + return new CountsDelta(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The log field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional log() { + return Json.optional(json, "log", Conv.LONG); + } + + /** + * The challenge field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional challenge() { + return Json.optional(json, "challenge", Conv.LONG); + } + + /** + * The block field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional block() { + return Json.optional(json, "block", Conv.LONG); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link CountsDelta}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(CountsDelta from) { + super(from); + } + + /** + * The log field. + * + * @param log the value + * @return this builder + */ + public Builder log(long log) { + return set("log", Conv.LONG, log); + } + + /** + * The challenge field. + * + * @param challenge the value + * @return this builder + */ + public Builder challenge(long challenge) { + return set("challenge", Conv.LONG, challenge); + } + + /** + * The block field. + * + * @param block the value + * @return this builder + */ + public Builder block(long block) { + return set("block", Conv.LONG, block); + } + + /** + * Builds the value. + * + * @return a new immutable {@code CountsDelta} + */ + public CountsDelta build() { + return new CountsDelta(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } + } + + public static final class Challenges extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("passed", "failed", "previous_passed", "previous_failed"); + + private Challenges(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Challenges} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Challenges fromJson(JsonNode json) { + return new Challenges(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The passed field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional passed() { + return Json.optional(json, "passed", Conv.LONG); + } + + /** + * The failed field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional failed() { + return Json.optional(json, "failed", Conv.LONG); + } + + /** + * The previous_passed field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional previousPassed() { + return Json.optional(json, "previous_passed", Conv.LONG); + } + + /** + * The previous_failed field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional previousFailed() { + return Json.optional(json, "previous_failed", Conv.LONG); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Challenges}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Challenges from) { + super(from); + } + + /** + * The passed field. + * + * @param passed the value + * @return this builder + */ + public Builder passed(long passed) { + return set("passed", Conv.LONG, passed); + } + + /** + * The failed field. + * + * @param failed the value + * @return this builder + */ + public Builder failed(long failed) { + return set("failed", Conv.LONG, failed); + } + + /** + * The previous_passed field. + * + * @param previousPassed the value + * @return this builder + */ + public Builder previousPassed(long previousPassed) { + return set("previous_passed", Conv.LONG, previousPassed); + } + + /** + * The previous_failed field. + * + * @param previousFailed the value + * @return this builder + */ + public Builder previousFailed(long previousFailed) { + return set("previous_failed", Conv.LONG, previousFailed); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Challenges} + */ + public Challenges build() { + return new Challenges(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } + } + + public static final class AttackMode extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("active", "started_at", "expires_at"); + + private AttackMode(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code AttackMode} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static AttackMode fromJson(JsonNode json) { + return new AttackMode(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The active field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public boolean active() { + return Json.required(json, "active", Conv.BOOLEAN); + } + + /** + * The started_at field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional startedAt() { + return Json.optional(json, "started_at", Conv.DATE_TIME); + } + + /** + * The expires_at field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional expiresAt() { + return Json.optional(json, "expires_at", Conv.DATE_TIME); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link AttackMode}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(AttackMode from) { + super(from); + } + + /** + * The active field. + * + * @param active the value + * @return this builder + */ + public Builder active(boolean active) { + return set("active", Conv.BOOLEAN, active); + } + + /** + * The started_at field. + * + * @param startedAt the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder startedAt(@Nullable OffsetDateTime startedAt) { + return setNullable("started_at", Conv.DATE_TIME, startedAt); + } + + /** + * The expires_at field. + * + * @param expiresAt the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder expiresAt(@Nullable OffsetDateTime expiresAt) { + return setNullable("expires_at", Conv.DATE_TIME, expiresAt); + } + + /** + * Builds the value. + * + * @return a new immutable {@code AttackMode} + * @throws IllegalStateException when a required field is missing + */ + public AttackMode build() { + require("active", false); + return new AttackMode(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } +} diff --git a/src/main/java/me/didit/types/SetupProtectionPolicy.java b/src/main/java/me/didit/types/SetupProtectionPolicy.java new file mode 100644 index 0000000..cde45e1 --- /dev/null +++ b/src/main/java/me/didit/types/SetupProtectionPolicy.java @@ -0,0 +1,413 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; + +/** Protection policy */ +public final class SetupProtectionPolicy extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("key", "mode", "available", "counts", "accounts"); + + private SetupProtectionPolicy(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupProtectionPolicy} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupProtectionPolicy fromJson(JsonNode json) { + return new SetupProtectionPolicy(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The key field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupProtectionPolicy.Key key() { + return Json.required(json, "key", Conv.enumeration(SetupProtectionPolicy.Key::of)); + } + + /** + * The mode field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupProtectionPolicy.Mode mode() { + return Json.required(json, "mode", Conv.enumeration(SetupProtectionPolicy.Mode::of)); + } + + /** + * vpn and travel need the IP lookup; false when it cannot be attempted. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public boolean available() { + return Json.required(json, "available", Conv.BOOLEAN); + } + + /** + * The counts field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupProtectionPolicy.Counts counts() { + return Json.required(json, "counts", Conv.model(SetupProtectionPolicy.Counts::fromJson)); + } + + /** + * How many people the policy matched in the last 14 days. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public long accounts() { + return Json.required(json, "accounts", Conv.LONG); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupProtectionPolicy}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupProtectionPolicy from) { + super(from); + } + + /** + * The key field. + * + * @param key the value + * @return this builder + */ + public Builder key(SetupProtectionPolicy.Key key) { + return set("key", Conv.enumeration(SetupProtectionPolicy.Key::of), key); + } + + /** + * The mode field. + * + * @param mode the value + * @return this builder + */ + public Builder mode(SetupProtectionPolicy.Mode mode) { + return set("mode", Conv.enumeration(SetupProtectionPolicy.Mode::of), mode); + } + + /** + * vpn and travel need the IP lookup; false when it cannot be attempted. + * + * @param available the value + * @return this builder + */ + public Builder available(boolean available) { + return set("available", Conv.BOOLEAN, available); + } + + /** + * The counts field. + * + * @param counts the value + * @return this builder + */ + public Builder counts(SetupProtectionPolicy.Counts counts) { + return set("counts", Conv.model(SetupProtectionPolicy.Counts::fromJson), counts); + } + + /** + * How many people the policy matched in the last 14 days. + * + * @param accounts the value + * @return this builder + */ + public Builder accounts(long accounts) { + return set("accounts", Conv.LONG, accounts); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupProtectionPolicy} + * @throws IllegalStateException when a required field is missing + */ + public SetupProtectionPolicy build() { + require("key", false); + require("mode", false); + require("available", false); + require("counts", false); + require("accounts", false); + return new SetupProtectionPolicy(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Key extends StringEnum { + /** The value {@code "bots"}. */ + public static final Key BOTS = new Key("bots"); + + /** The value {@code "stuffing"}. */ + public static final Key STUFFING = new Key("stuffing"); + + /** The value {@code "brute"}. */ + public static final Key BRUTE = new Key("brute"); + + /** The value {@code "disposable"}. */ + public static final Key DISPOSABLE = new Key("disposable"); + + /** The value {@code "vpn"}. */ + public static final Key VPN = new Key("vpn"); + + /** The value {@code "travel"}. */ + public static final Key TRAVEL = new Key("travel"); + + private static final List KNOWN_VALUES = List.of(BOTS, STUFFING, BRUTE, DISPOSABLE, VPN, TRAVEL); + + private Key(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static Key of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Key::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Mode extends StringEnum { + /** The value {@code "off"}. */ + public static final Mode OFF = new Mode("off"); + + /** The value {@code "log"}. */ + public static final Mode LOG = new Mode("log"); + + /** The value {@code "challenge"}. */ + public static final Mode CHALLENGE = new Mode("challenge"); + + /** The value {@code "block"}. */ + public static final Mode BLOCK = new Mode("block"); + + private static final List KNOWN_VALUES = List.of(OFF, LOG, CHALLENGE, BLOCK); + + private Mode(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static Mode of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Mode::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + public static final class Counts extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("log", "challenge", "block"); + + private Counts(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Counts} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Counts fromJson(JsonNode json) { + return new Counts(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The log field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional log() { + return Json.optional(json, "log", Conv.LONG); + } + + /** + * The challenge field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional challenge() { + return Json.optional(json, "challenge", Conv.LONG); + } + + /** + * The block field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional block() { + return Json.optional(json, "block", Conv.LONG); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Counts}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Counts from) { + super(from); + } + + /** + * The log field. + * + * @param log the value + * @return this builder + */ + public Builder log(long log) { + return set("log", Conv.LONG, log); + } + + /** + * The challenge field. + * + * @param challenge the value + * @return this builder + */ + public Builder challenge(long challenge) { + return set("challenge", Conv.LONG, challenge); + } + + /** + * The block field. + * + * @param block the value + * @return this builder + */ + public Builder block(long block) { + return set("block", Conv.LONG, block); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Counts} + */ + public Counts build() { + return new Counts(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } +} diff --git a/src/main/java/me/didit/types/SetupProtectionUpdate.java b/src/main/java/me/didit/types/SetupProtectionUpdate.java new file mode 100644 index 0000000..5e9d300 --- /dev/null +++ b/src/main/java/me/didit/types/SetupProtectionUpdate.java @@ -0,0 +1,190 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; + +/** + * Every field is optional. The policies you send are merged into the stored ones; an unknown policy answers unknown_protection. + */ +public final class SetupProtectionUpdate extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("enabled", "breached_password_check", "policies"); + + private SetupProtectionUpdate(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupProtectionUpdate} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupProtectionUpdate fromJson(JsonNode json) { + return new SetupProtectionUpdate(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The enabled field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional enabled() { + return Json.optional(json, "enabled", Conv.BOOLEAN); + } + + /** + * The breached_password_check field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional breachedPasswordCheck() { + return Json.optional(json, "breached_password_check", Conv.BOOLEAN); + } + + /** + * A mode per policy: bots, stuffing, brute, disposable, vpn and travel. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional> policies() { + return Json.optional(json, "policies", Conv.map(Conv.enumeration(SetupProtectionUpdate.PoliciesValue::of))); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupProtectionUpdate}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupProtectionUpdate from) { + super(from); + } + + /** + * The enabled field. + * + * @param enabled the value + * @return this builder + */ + public Builder enabled(boolean enabled) { + return set("enabled", Conv.BOOLEAN, enabled); + } + + /** + * The breached_password_check field. + * + * @param breachedPasswordCheck the value + * @return this builder + */ + public Builder breachedPasswordCheck(boolean breachedPasswordCheck) { + return set("breached_password_check", Conv.BOOLEAN, breachedPasswordCheck); + } + + /** + * A mode per policy: bots, stuffing, brute, disposable, vpn and travel. + * + * @param policies the value + * @return this builder + */ + public Builder policies(Map policies) { + return set("policies", Conv.map(Conv.enumeration(SetupProtectionUpdate.PoliciesValue::of)), policies); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupProtectionUpdate} + */ + public SetupProtectionUpdate build() { + return new SetupProtectionUpdate(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class PoliciesValue extends StringEnum { + /** The value {@code "off"}. */ + public static final PoliciesValue OFF = new PoliciesValue("off"); + + /** The value {@code "log"}. */ + public static final PoliciesValue LOG = new PoliciesValue("log"); + + /** The value {@code "challenge"}. */ + public static final PoliciesValue CHALLENGE = new PoliciesValue("challenge"); + + /** The value {@code "block"}. */ + public static final PoliciesValue BLOCK = new PoliciesValue("block"); + + private static final List KNOWN_VALUES = List.of(OFF, LOG, CHALLENGE, BLOCK); + + private PoliciesValue(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static PoliciesValue of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, PoliciesValue::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } +} diff --git a/src/main/java/me/didit/types/SetupProviderCredentials.java b/src/main/java/me/didit/types/SetupProviderCredentials.java new file mode 100644 index 0000000..e0ed03a --- /dev/null +++ b/src/main/java/me/didit/types/SetupProviderCredentials.java @@ -0,0 +1,121 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; + +/** Your own OAuth app's credentials. The secret is write-only: no response returns it. */ +public final class SetupProviderCredentials extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("client_id", "client_secret"); + + private SetupProviderCredentials(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupProviderCredentials} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupProviderCredentials fromJson(JsonNode json) { + return new SetupProviderCredentials(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The client_id field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String clientId() { + return Json.required(json, "client_id", Conv.STRING); + } + + /** + * The client_secret field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String clientSecret() { + return Json.required(json, "client_secret", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupProviderCredentials}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupProviderCredentials from) { + super(from); + } + + /** + * The client_id field. + * + * @param clientId the value + * @return this builder + */ + public Builder clientId(String clientId) { + return set("client_id", Conv.STRING, clientId); + } + + /** + * The client_secret field. + * + * @param clientSecret the value + * @return this builder + */ + public Builder clientSecret(String clientSecret) { + return set("client_secret", Conv.STRING, clientSecret); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupProviderCredentials} + * @throws IllegalStateException when a required field is missing + */ + public SetupProviderCredentials build() { + require("client_id", false); + require("client_secret", false); + return new SetupProviderCredentials(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/SetupSettings.java b/src/main/java/me/didit/types/SetupSettings.java new file mode 100644 index 0000000..fae5fc0 --- /dev/null +++ b/src/main/java/me/didit/types/SetupSettings.java @@ -0,0 +1,576 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; + +/** Application settings */ +public final class SetupSettings extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("sign_in_ui", "agent_humans_only", "agents_enabled", "agent_scopes", "agent_lifetime", "agent_idle_timeout", "agent_approval", "organizations_enabled", "mfa_policy", "default_member_role", "webhook_events_disabled"); + + private SetupSettings(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupSettings} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupSettings fromJson(JsonNode json) { + return new SetupSettings(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The sign_in_ui field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional signInUi() { + return Json.optional(json, "sign_in_ui", Conv.enumeration(SetupSettings.SignInUi::of)); + } + + /** + * The agent_humans_only field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional agentHumansOnly() { + return Json.optional(json, "agent_humans_only", Conv.BOOLEAN); + } + + /** + * The agents_enabled field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional agentsEnabled() { + return Json.optional(json, "agents_enabled", Conv.BOOLEAN); + } + + /** + * The agent_scopes field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional> agentScopes() { + return Json.optional(json, "agent_scopes", Conv.list(Conv.enumeration(SetupSettings.AgentScopes::of))); + } + + /** + * The agent_lifetime field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional agentLifetime() { + return Json.optional(json, "agent_lifetime", Conv.LONG); + } + + /** + * The agent_idle_timeout field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional agentIdleTimeout() { + return Json.optional(json, "agent_idle_timeout", Conv.LONG); + } + + /** + * The agent_approval field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional agentApproval() { + return Json.optional(json, "agent_approval", Conv.enumeration(SetupSettings.AgentApproval::of)); + } + + /** + * The organizations_enabled field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional organizationsEnabled() { + return Json.optional(json, "organizations_enabled", Conv.BOOLEAN); + } + + /** + * The mfa_policy field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional mfaPolicy() { + return Json.optional(json, "mfa_policy", Conv.enumeration(SetupSettings.MfaPolicy::of)); + } + + /** + * The default_member_role field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional defaultMemberRole() { + return Json.optional(json, "default_member_role", Conv.enumeration(SetupSettings.DefaultMemberRole::of)); + } + + /** + * The webhook_events_disabled field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional> webhookEventsDisabled() { + return Json.optional(json, "webhook_events_disabled", Conv.list(Conv.enumeration(SetupSettings.WebhookEventsDisabled::of))); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupSettings}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupSettings from) { + super(from); + } + + /** + * The sign_in_ui field. + * + * @param signInUi the value + * @return this builder + */ + public Builder signInUi(SetupSettings.SignInUi signInUi) { + return set("sign_in_ui", Conv.enumeration(SetupSettings.SignInUi::of), signInUi); + } + + /** + * The agent_humans_only field. + * + * @param agentHumansOnly the value + * @return this builder + */ + public Builder agentHumansOnly(boolean agentHumansOnly) { + return set("agent_humans_only", Conv.BOOLEAN, agentHumansOnly); + } + + /** + * The agents_enabled field. + * + * @param agentsEnabled the value + * @return this builder + */ + public Builder agentsEnabled(boolean agentsEnabled) { + return set("agents_enabled", Conv.BOOLEAN, agentsEnabled); + } + + /** + * The agent_scopes field. + * + * @param agentScopes the value + * @return this builder + */ + public Builder agentScopes(List agentScopes) { + return set("agent_scopes", Conv.list(Conv.enumeration(SetupSettings.AgentScopes::of)), agentScopes); + } + + /** + * The agent_lifetime field. + * + * @param agentLifetime the value + * @return this builder + */ + public Builder agentLifetime(long agentLifetime) { + return set("agent_lifetime", Conv.LONG, agentLifetime); + } + + /** + * The agent_idle_timeout field. + * + * @param agentIdleTimeout the value + * @return this builder + */ + public Builder agentIdleTimeout(long agentIdleTimeout) { + return set("agent_idle_timeout", Conv.LONG, agentIdleTimeout); + } + + /** + * The agent_approval field. + * + * @param agentApproval the value + * @return this builder + */ + public Builder agentApproval(SetupSettings.AgentApproval agentApproval) { + return set("agent_approval", Conv.enumeration(SetupSettings.AgentApproval::of), agentApproval); + } + + /** + * The organizations_enabled field. + * + * @param organizationsEnabled the value + * @return this builder + */ + public Builder organizationsEnabled(boolean organizationsEnabled) { + return set("organizations_enabled", Conv.BOOLEAN, organizationsEnabled); + } + + /** + * The mfa_policy field. + * + * @param mfaPolicy the value + * @return this builder + */ + public Builder mfaPolicy(SetupSettings.MfaPolicy mfaPolicy) { + return set("mfa_policy", Conv.enumeration(SetupSettings.MfaPolicy::of), mfaPolicy); + } + + /** + * The default_member_role field. + * + * @param defaultMemberRole the value + * @return this builder + */ + public Builder defaultMemberRole(SetupSettings.DefaultMemberRole defaultMemberRole) { + return set("default_member_role", Conv.enumeration(SetupSettings.DefaultMemberRole::of), defaultMemberRole); + } + + /** + * The webhook_events_disabled field. + * + * @param webhookEventsDisabled the value + * @return this builder + */ + public Builder webhookEventsDisabled(List webhookEventsDisabled) { + return set("webhook_events_disabled", Conv.list(Conv.enumeration(SetupSettings.WebhookEventsDisabled::of)), webhookEventsDisabled); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupSettings} + */ + public SetupSettings build() { + return new SetupSettings(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class SignInUi extends StringEnum { + /** The value {@code "hosted"}. */ + public static final SignInUi HOSTED = new SignInUi("hosted"); + + /** The value {@code "own"}. */ + public static final SignInUi OWN = new SignInUi("own"); + + private static final List KNOWN_VALUES = List.of(HOSTED, OWN); + + private SignInUi(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static SignInUi of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, SignInUi::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class AgentScopes extends StringEnum { + /** The value {@code "read"}. */ + public static final AgentScopes READ = new AgentScopes("read"); + + /** The value {@code "act"}. */ + public static final AgentScopes ACT = new AgentScopes("act"); + + private static final List KNOWN_VALUES = List.of(READ, ACT); + + private AgentScopes(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static AgentScopes of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, AgentScopes::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class AgentApproval extends StringEnum { + /** The value {@code "passkey"}. */ + public static final AgentApproval PASSKEY = new AgentApproval("passkey"); + + /** The value {@code "sign_in"}. */ + public static final AgentApproval SIGN_IN = new AgentApproval("sign_in"); + + private static final List KNOWN_VALUES = List.of(PASSKEY, SIGN_IN); + + private AgentApproval(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static AgentApproval of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, AgentApproval::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class MfaPolicy extends StringEnum { + /** The value {@code "optional"}. */ + public static final MfaPolicy OPTIONAL = new MfaPolicy("optional"); + + /** The value {@code "everyone"}. */ + public static final MfaPolicy EVERYONE = new MfaPolicy("everyone"); + + /** The value {@code "organization_admins"}. */ + public static final MfaPolicy ORGANIZATION_ADMINS = new MfaPolicy("organization_admins"); + + private static final List KNOWN_VALUES = List.of(OPTIONAL, EVERYONE, ORGANIZATION_ADMINS); + + private MfaPolicy(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static MfaPolicy of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, MfaPolicy::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class DefaultMemberRole extends StringEnum { + /** The value {@code "admin"}. */ + public static final DefaultMemberRole ADMIN = new DefaultMemberRole("admin"); + + /** The value {@code "member"}. */ + public static final DefaultMemberRole MEMBER = new DefaultMemberRole("member"); + + /** The value {@code "billing"}. */ + public static final DefaultMemberRole BILLING = new DefaultMemberRole("billing"); + + private static final List KNOWN_VALUES = List.of(ADMIN, MEMBER, BILLING); + + private DefaultMemberRole(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static DefaultMemberRole of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, DefaultMemberRole::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class WebhookEventsDisabled extends StringEnum { + /** The value {@code "auth.sign_in"}. */ + public static final WebhookEventsDisabled AUTH_SIGN_IN = new WebhookEventsDisabled("auth.sign_in"); + + /** The value {@code "auth.sign_in_failed"}. */ + public static final WebhookEventsDisabled AUTH_SIGN_IN_FAILED = new WebhookEventsDisabled("auth.sign_in_failed"); + + /** The value {@code "auth.new_device"}. */ + public static final WebhookEventsDisabled AUTH_NEW_DEVICE = new WebhookEventsDisabled("auth.new_device"); + + /** The value {@code "auth.account_locked"}. */ + public static final WebhookEventsDisabled AUTH_ACCOUNT_LOCKED = new WebhookEventsDisabled("auth.account_locked"); + + /** The value {@code "auth.two_factor_changed"}. */ + public static final WebhookEventsDisabled AUTH_TWO_FACTOR_CHANGED = new WebhookEventsDisabled("auth.two_factor_changed"); + + /** The value {@code "auth.session_revoked"}. */ + public static final WebhookEventsDisabled AUTH_SESSION_REVOKED = new WebhookEventsDisabled("auth.session_revoked"); + + /** The value {@code "auth.agent_access_approved"}. */ + public static final WebhookEventsDisabled AUTH_AGENT_ACCESS_APPROVED = new WebhookEventsDisabled("auth.agent_access_approved"); + + /** The value {@code "auth.agent_access_revoked"}. */ + public static final WebhookEventsDisabled AUTH_AGENT_ACCESS_REVOKED = new WebhookEventsDisabled("auth.agent_access_revoked"); + + private static final List KNOWN_VALUES = List.of(AUTH_SIGN_IN, AUTH_SIGN_IN_FAILED, AUTH_NEW_DEVICE, AUTH_ACCOUNT_LOCKED, AUTH_TWO_FACTOR_CHANGED, AUTH_SESSION_REVOKED, AUTH_AGENT_ACCESS_APPROVED, AUTH_AGENT_ACCESS_REVOKED); + + private WebhookEventsDisabled(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static WebhookEventsDisabled of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, WebhookEventsDisabled::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } +} diff --git a/src/main/java/me/didit/types/SetupSettingsUpdate.java b/src/main/java/me/didit/types/SetupSettingsUpdate.java new file mode 100644 index 0000000..33ffbef --- /dev/null +++ b/src/main/java/me/didit/types/SetupSettingsUpdate.java @@ -0,0 +1,518 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; + +/** + * Every field is optional. Changing the application’s agent_humans_only setting requires an owner or admin. Enabling it also requires an enrolled passkey. A named key receives 403 owner_or_admin_required. + */ +public final class SetupSettingsUpdate extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("sign_in_ui", "agent_humans_only", "agents_enabled", "agent_scopes", "agent_lifetime", "agent_idle_timeout", "agent_approval", "organizations_enabled", "mfa_policy", "default_member_role", "webhook_events_disabled"); + + private SetupSettingsUpdate(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupSettingsUpdate} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupSettingsUpdate fromJson(JsonNode json) { + return new SetupSettingsUpdate(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The sign_in_ui field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional signInUi() { + return Json.optional(json, "sign_in_ui", Conv.enumeration(SetupSettingsUpdate.SignInUi::of)); + } + + /** + * The agent_humans_only field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional agentHumansOnly() { + return Json.optional(json, "agent_humans_only", Conv.BOOLEAN); + } + + /** + * The agents_enabled field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional agentsEnabled() { + return Json.optional(json, "agents_enabled", Conv.BOOLEAN); + } + + /** + * The agent_scopes field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional> agentScopes() { + return Json.optional(json, "agent_scopes", Conv.list(Conv.enumeration(SetupSettingsUpdate.AgentScopes::of))); + } + + /** + * The agent_lifetime field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional agentLifetime() { + return Json.optional(json, "agent_lifetime", Conv.LONG); + } + + /** + * The agent_idle_timeout field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional agentIdleTimeout() { + return Json.optional(json, "agent_idle_timeout", Conv.LONG); + } + + /** + * The agent_approval field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional agentApproval() { + return Json.optional(json, "agent_approval", Conv.enumeration(SetupSettingsUpdate.AgentApproval::of)); + } + + /** + * The organizations_enabled field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional organizationsEnabled() { + return Json.optional(json, "organizations_enabled", Conv.BOOLEAN); + } + + /** + * The mfa_policy field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional mfaPolicy() { + return Json.optional(json, "mfa_policy", Conv.enumeration(SetupSettingsUpdate.MfaPolicy::of)); + } + + /** + * The default_member_role field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional defaultMemberRole() { + return Json.optional(json, "default_member_role", Conv.enumeration(SetupSettingsUpdate.DefaultMemberRole::of)); + } + + /** + * The webhook_events_disabled field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional> webhookEventsDisabled() { + return Json.optional(json, "webhook_events_disabled", Conv.list(Conv.STRING)); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupSettingsUpdate}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupSettingsUpdate from) { + super(from); + } + + /** + * The sign_in_ui field. + * + * @param signInUi the value + * @return this builder + */ + public Builder signInUi(SetupSettingsUpdate.SignInUi signInUi) { + return set("sign_in_ui", Conv.enumeration(SetupSettingsUpdate.SignInUi::of), signInUi); + } + + /** + * The agent_humans_only field. + * + * @param agentHumansOnly the value + * @return this builder + */ + public Builder agentHumansOnly(boolean agentHumansOnly) { + return set("agent_humans_only", Conv.BOOLEAN, agentHumansOnly); + } + + /** + * The agents_enabled field. + * + * @param agentsEnabled the value + * @return this builder + */ + public Builder agentsEnabled(boolean agentsEnabled) { + return set("agents_enabled", Conv.BOOLEAN, agentsEnabled); + } + + /** + * The agent_scopes field. + * + * @param agentScopes the value + * @return this builder + */ + public Builder agentScopes(List agentScopes) { + return set("agent_scopes", Conv.list(Conv.enumeration(SetupSettingsUpdate.AgentScopes::of)), agentScopes); + } + + /** + * The agent_lifetime field. + * + * @param agentLifetime the value + * @return this builder + */ + public Builder agentLifetime(long agentLifetime) { + return set("agent_lifetime", Conv.LONG, agentLifetime); + } + + /** + * The agent_idle_timeout field. + * + * @param agentIdleTimeout the value + * @return this builder + */ + public Builder agentIdleTimeout(long agentIdleTimeout) { + return set("agent_idle_timeout", Conv.LONG, agentIdleTimeout); + } + + /** + * The agent_approval field. + * + * @param agentApproval the value + * @return this builder + */ + public Builder agentApproval(SetupSettingsUpdate.AgentApproval agentApproval) { + return set("agent_approval", Conv.enumeration(SetupSettingsUpdate.AgentApproval::of), agentApproval); + } + + /** + * The organizations_enabled field. + * + * @param organizationsEnabled the value + * @return this builder + */ + public Builder organizationsEnabled(boolean organizationsEnabled) { + return set("organizations_enabled", Conv.BOOLEAN, organizationsEnabled); + } + + /** + * The mfa_policy field. + * + * @param mfaPolicy the value + * @return this builder + */ + public Builder mfaPolicy(SetupSettingsUpdate.MfaPolicy mfaPolicy) { + return set("mfa_policy", Conv.enumeration(SetupSettingsUpdate.MfaPolicy::of), mfaPolicy); + } + + /** + * The default_member_role field. + * + * @param defaultMemberRole the value + * @return this builder + */ + public Builder defaultMemberRole(SetupSettingsUpdate.DefaultMemberRole defaultMemberRole) { + return set("default_member_role", Conv.enumeration(SetupSettingsUpdate.DefaultMemberRole::of), defaultMemberRole); + } + + /** + * The webhook_events_disabled field. + * + * @param webhookEventsDisabled the value + * @return this builder + */ + public Builder webhookEventsDisabled(List webhookEventsDisabled) { + return set("webhook_events_disabled", Conv.list(Conv.STRING), webhookEventsDisabled); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupSettingsUpdate} + */ + public SetupSettingsUpdate build() { + return new SetupSettingsUpdate(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class SignInUi extends StringEnum { + /** The value {@code "hosted"}. */ + public static final SignInUi HOSTED = new SignInUi("hosted"); + + /** The value {@code "own"}. */ + public static final SignInUi OWN = new SignInUi("own"); + + private static final List KNOWN_VALUES = List.of(HOSTED, OWN); + + private SignInUi(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static SignInUi of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, SignInUi::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class AgentScopes extends StringEnum { + /** The value {@code "read"}. */ + public static final AgentScopes READ = new AgentScopes("read"); + + /** The value {@code "act"}. */ + public static final AgentScopes ACT = new AgentScopes("act"); + + private static final List KNOWN_VALUES = List.of(READ, ACT); + + private AgentScopes(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static AgentScopes of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, AgentScopes::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class AgentApproval extends StringEnum { + /** The value {@code "passkey"}. */ + public static final AgentApproval PASSKEY = new AgentApproval("passkey"); + + /** The value {@code "sign_in"}. */ + public static final AgentApproval SIGN_IN = new AgentApproval("sign_in"); + + private static final List KNOWN_VALUES = List.of(PASSKEY, SIGN_IN); + + private AgentApproval(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static AgentApproval of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, AgentApproval::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class MfaPolicy extends StringEnum { + /** The value {@code "optional"}. */ + public static final MfaPolicy OPTIONAL = new MfaPolicy("optional"); + + /** The value {@code "everyone"}. */ + public static final MfaPolicy EVERYONE = new MfaPolicy("everyone"); + + /** The value {@code "organization_admins"}. */ + public static final MfaPolicy ORGANIZATION_ADMINS = new MfaPolicy("organization_admins"); + + private static final List KNOWN_VALUES = List.of(OPTIONAL, EVERYONE, ORGANIZATION_ADMINS); + + private MfaPolicy(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static MfaPolicy of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, MfaPolicy::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class DefaultMemberRole extends StringEnum { + /** The value {@code "admin"}. */ + public static final DefaultMemberRole ADMIN = new DefaultMemberRole("admin"); + + /** The value {@code "member"}. */ + public static final DefaultMemberRole MEMBER = new DefaultMemberRole("member"); + + /** The value {@code "billing"}. */ + public static final DefaultMemberRole BILLING = new DefaultMemberRole("billing"); + + private static final List KNOWN_VALUES = List.of(ADMIN, MEMBER, BILLING); + + private DefaultMemberRole(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static DefaultMemberRole of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, DefaultMemberRole::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } +} diff --git a/src/main/java/me/didit/types/SetupVerified.java b/src/main/java/me/didit/types/SetupVerified.java new file mode 100644 index 0000000..5ded6e8 --- /dev/null +++ b/src/main/java/me/didit/types/SetupVerified.java @@ -0,0 +1,734 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; +import org.jspecify.annotations.Nullable; + +/** Verified sign-in */ +public final class SetupVerified extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("signup_level", "signup", "rules", "claims", "available_claims", "workflows", "wallet", "since"); + + private SetupVerified(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupVerified} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupVerified fromJson(JsonNode json) { + return new SetupVerified(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The signup_level field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupVerified.SignupLevel signupLevel() { + return Json.required(json, "signup_level", Conv.enumeration(SetupVerified.SignupLevel::of)); + } + + /** + * The signup field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional signup() { + return Json.optional(json, "signup", Conv.model(SetupVerified.Signup::fromJson)); + } + + /** + * The rules field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public List rules() { + return Json.required(json, "rules", Conv.list(Conv.model(SetupVerifiedRule::fromJson))); + } + + /** + * The claims your tokens carry once the person is verified. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public List claims() { + return Json.required(json, "claims", Conv.list(Conv.enumeration(SetupVerified.Claims::of))); + } + + /** + * The available_claims field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public List availableClaims() { + return Json.required(json, "available_claims", Conv.list(Conv.STRING)); + } + + /** + * The verification workflow behind each method; null until one is created. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupVerified.Workflows workflows() { + return Json.required(json, "workflows", Conv.model(SetupVerified.Workflows::fromJson)); + } + + /** + * The wallet field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupVerified.Wallet wallet() { + return Json.required(json, "wallet", Conv.model(SetupVerified.Wallet::fromJson)); + } + + /** + * The since field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public OffsetDateTime since() { + return Json.required(json, "since", Conv.DATE_TIME); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupVerified}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupVerified from) { + super(from); + } + + /** + * The signup_level field. + * + * @param signupLevel the value + * @return this builder + */ + public Builder signupLevel(SetupVerified.SignupLevel signupLevel) { + return set("signup_level", Conv.enumeration(SetupVerified.SignupLevel::of), signupLevel); + } + + /** + * The signup field. + * + * @param signup the value + * @return this builder + */ + public Builder signup(SetupVerified.Signup signup) { + return set("signup", Conv.model(SetupVerified.Signup::fromJson), signup); + } + + /** + * The rules field. + * + * @param rules the value + * @return this builder + */ + public Builder rules(List rules) { + return set("rules", Conv.list(Conv.model(SetupVerifiedRule::fromJson)), rules); + } + + /** + * The claims your tokens carry once the person is verified. + * + * @param claims the value + * @return this builder + */ + public Builder claims(List claims) { + return set("claims", Conv.list(Conv.enumeration(SetupVerified.Claims::of)), claims); + } + + /** + * The available_claims field. + * + * @param availableClaims the value + * @return this builder + */ + public Builder availableClaims(List availableClaims) { + return set("available_claims", Conv.list(Conv.STRING), availableClaims); + } + + /** + * The verification workflow behind each method; null until one is created. + * + * @param workflows the value + * @return this builder + */ + public Builder workflows(SetupVerified.Workflows workflows) { + return set("workflows", Conv.model(SetupVerified.Workflows::fromJson), workflows); + } + + /** + * The wallet field. + * + * @param wallet the value + * @return this builder + */ + public Builder wallet(SetupVerified.Wallet wallet) { + return set("wallet", Conv.model(SetupVerified.Wallet::fromJson), wallet); + } + + /** + * The since field. + * + * @param since the value + * @return this builder + */ + public Builder since(OffsetDateTime since) { + return set("since", Conv.DATE_TIME, since); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupVerified} + * @throws IllegalStateException when a required field is missing + */ + public SetupVerified build() { + require("signup_level", false); + require("rules", false); + require("claims", false); + require("available_claims", false); + require("workflows", false); + require("wallet", false); + require("since", false); + return new SetupVerified(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class SignupLevel extends StringEnum { + /** The value {@code "none"}. */ + public static final SignupLevel NONE = new SignupLevel("none"); + + /** The value {@code "liveness"}. */ + public static final SignupLevel LIVENESS = new SignupLevel("liveness"); + + /** The value {@code "full_id"}. */ + public static final SignupLevel FULL_ID = new SignupLevel("full_id"); + + private static final List KNOWN_VALUES = List.of(NONE, LIVENESS, FULL_ID); + + private SignupLevel(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static SignupLevel of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, SignupLevel::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + public static final class Signup extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("checks", "passed", "failed"); + + private Signup(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Signup} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Signup fromJson(JsonNode json) { + return new Signup(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The checks field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional checks() { + return Json.optional(json, "checks", Conv.LONG); + } + + /** + * The passed field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional passed() { + return Json.optional(json, "passed", Conv.LONG); + } + + /** + * The failed field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional failed() { + return Json.optional(json, "failed", Conv.LONG); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Signup}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Signup from) { + super(from); + } + + /** + * The checks field. + * + * @param checks the value + * @return this builder + */ + public Builder checks(long checks) { + return set("checks", Conv.LONG, checks); + } + + /** + * The passed field. + * + * @param passed the value + * @return this builder + */ + public Builder passed(long passed) { + return set("passed", Conv.LONG, passed); + } + + /** + * The failed field. + * + * @param failed the value + * @return this builder + */ + public Builder failed(long failed) { + return set("failed", Conv.LONG, failed); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Signup} + */ + public Signup build() { + return new Signup(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Claims extends StringEnum { + /** The value {@code "over_18"}. */ + public static final Claims OVER_18 = new Claims("over_18"); + + /** The value {@code "over_21"}. */ + public static final Claims OVER_21 = new Claims("over_21"); + + /** The value {@code "given_name"}. */ + public static final Claims GIVEN_NAME = new Claims("given_name"); + + /** The value {@code "family_name"}. */ + public static final Claims FAMILY_NAME = new Claims("family_name"); + + /** The value {@code "birthdate"}. */ + public static final Claims BIRTHDATE = new Claims("birthdate"); + + /** The value {@code "nationality"}. */ + public static final Claims NATIONALITY = new Claims("nationality"); + + /** The value {@code "country"}. */ + public static final Claims COUNTRY = new Claims("country"); + + /** The value {@code "document_verified"}. */ + public static final Claims DOCUMENT_VERIFIED = new Claims("document_verified"); + + /** The value {@code "liveness"}. */ + public static final Claims LIVENESS = new Claims("liveness"); + + private static final List KNOWN_VALUES = List.of(OVER_18, OVER_21, GIVEN_NAME, FAMILY_NAME, BIRTHDATE, NATIONALITY, COUNTRY, DOCUMENT_VERIFIED, LIVENESS); + + private Claims(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static Claims of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Claims::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + /** The verification workflow behind each method; null until one is created. */ + public static final class Workflows extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("liveness", "selfie", "full_id"); + + private Workflows(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Workflows} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Workflows fromJson(JsonNode json) { + return new Workflows(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The liveness field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional liveness() { + return Json.optional(json, "liveness", Conv.STRING); + } + + /** + * The selfie field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional selfie() { + return Json.optional(json, "selfie", Conv.STRING); + } + + /** + * The full_id field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional fullId() { + return Json.optional(json, "full_id", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Workflows}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Workflows from) { + super(from); + } + + /** + * The liveness field. + * + * @param liveness the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder liveness(@Nullable String liveness) { + return setNullable("liveness", Conv.STRING, liveness); + } + + /** + * The selfie field. + * + * @param selfie the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder selfie(@Nullable String selfie) { + return setNullable("selfie", Conv.STRING, selfie); + } + + /** + * The full_id field. + * + * @param fullId the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder fullId(@Nullable String fullId) { + return setNullable("full_id", Conv.STRING, fullId); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Workflows} + */ + public Workflows build() { + return new Workflows(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } + + public static final class Wallet extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("enabled", "sign_ins", "people"); + + private Wallet(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Wallet} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Wallet fromJson(JsonNode json) { + return new Wallet(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The enabled field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional enabled() { + return Json.optional(json, "enabled", Conv.BOOLEAN); + } + + /** + * The sign_ins field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional signIns() { + return Json.optional(json, "sign_ins", Conv.LONG); + } + + /** + * The people field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional people() { + return Json.optional(json, "people", Conv.LONG); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Wallet}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Wallet from) { + super(from); + } + + /** + * The enabled field. + * + * @param enabled the value + * @return this builder + */ + public Builder enabled(boolean enabled) { + return set("enabled", Conv.BOOLEAN, enabled); + } + + /** + * The sign_ins field. + * + * @param signIns the value + * @return this builder + */ + public Builder signIns(long signIns) { + return set("sign_ins", Conv.LONG, signIns); + } + + /** + * The people field. + * + * @param people the value + * @return this builder + */ + public Builder people(long people) { + return set("people", Conv.LONG, people); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Wallet} + */ + public Wallet build() { + return new Wallet(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } +} diff --git a/src/main/java/me/didit/types/SetupVerifiedRule.java b/src/main/java/me/didit/types/SetupVerifiedRule.java new file mode 100644 index 0000000..f013690 --- /dev/null +++ b/src/main/java/me/didit/types/SetupVerifiedRule.java @@ -0,0 +1,338 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; + +/** Step-up rule */ +public final class SetupVerifiedRule extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("rule", "enabled", "method", "threshold", "currency", "checks", "passed", "failed"); + + private SetupVerifiedRule(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupVerifiedRule} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupVerifiedRule fromJson(JsonNode json) { + return new SetupVerifiedRule(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The rule field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupVerifiedRule.Rule rule() { + return Json.required(json, "rule", Conv.enumeration(SetupVerifiedRule.Rule::of)); + } + + /** + * The enabled field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional enabled() { + return Json.optional(json, "enabled", Conv.BOOLEAN); + } + + /** + * The method field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional method() { + return Json.optional(json, "method", Conv.enumeration(SetupVerifiedRule.Method::of)); + } + + /** + * payout only: the amount above which the rule applies, as a decimal string. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional threshold() { + return Json.optional(json, "threshold", Conv.STRING); + } + + /** + * payout only: the ISO 4217 currency of threshold. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional currency() { + return Json.optional(json, "currency", Conv.STRING); + } + + /** + * Checks this month. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional checks() { + return Json.optional(json, "checks", Conv.LONG); + } + + /** + * The passed field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional passed() { + return Json.optional(json, "passed", Conv.LONG); + } + + /** + * The failed field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional failed() { + return Json.optional(json, "failed", Conv.LONG); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupVerifiedRule}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupVerifiedRule from) { + super(from); + } + + /** + * The rule field. + * + * @param rule the value + * @return this builder + */ + public Builder rule(SetupVerifiedRule.Rule rule) { + return set("rule", Conv.enumeration(SetupVerifiedRule.Rule::of), rule); + } + + /** + * The enabled field. + * + * @param enabled the value + * @return this builder + */ + public Builder enabled(boolean enabled) { + return set("enabled", Conv.BOOLEAN, enabled); + } + + /** + * The method field. + * + * @param method the value + * @return this builder + */ + public Builder method(SetupVerifiedRule.Method method) { + return set("method", Conv.enumeration(SetupVerifiedRule.Method::of), method); + } + + /** + * payout only: the amount above which the rule applies, as a decimal string. + * + * @param threshold the value + * @return this builder + */ + public Builder threshold(String threshold) { + return set("threshold", Conv.STRING, threshold); + } + + /** + * payout only: the ISO 4217 currency of threshold. + * + * @param currency the value + * @return this builder + */ + public Builder currency(String currency) { + return set("currency", Conv.STRING, currency); + } + + /** + * Checks this month. + * + * @param checks the value + * @return this builder + */ + public Builder checks(long checks) { + return set("checks", Conv.LONG, checks); + } + + /** + * The passed field. + * + * @param passed the value + * @return this builder + */ + public Builder passed(long passed) { + return set("passed", Conv.LONG, passed); + } + + /** + * The failed field. + * + * @param failed the value + * @return this builder + */ + public Builder failed(long failed) { + return set("failed", Conv.LONG, failed); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupVerifiedRule} + * @throws IllegalStateException when a required field is missing + */ + public SetupVerifiedRule build() { + require("rule", false); + return new SetupVerifiedRule(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Rule extends StringEnum { + /** The value {@code "payout"}. */ + public static final Rule PAYOUT = new Rule("payout"); + + /** The value {@code "bank"}. */ + public static final Rule BANK = new Rule("bank"); + + /** The value {@code "contact"}. */ + public static final Rule CONTACT = new Rule("contact"); + + /** The value {@code "device"}. */ + public static final Rule DEVICE = new Rule("device"); + + /** The value {@code "sign_in"}. */ + public static final Rule SIGN_IN = new Rule("sign_in"); + + private static final List KNOWN_VALUES = List.of(PAYOUT, BANK, CONTACT, DEVICE, SIGN_IN); + + private Rule(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static Rule of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Rule::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Method extends StringEnum { + /** The value {@code "liveness"}. */ + public static final Method LIVENESS = new Method("liveness"); + + /** The value {@code "selfie"}. */ + public static final Method SELFIE = new Method("selfie"); + + /** The value {@code "full_id"}. */ + public static final Method FULL_ID = new Method("full_id"); + + private static final List KNOWN_VALUES = List.of(LIVENESS, SELFIE, FULL_ID); + + private Method(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static Method of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Method::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } +} diff --git a/src/main/java/me/didit/types/SetupVerifiedUpdate.java b/src/main/java/me/didit/types/SetupVerifiedUpdate.java new file mode 100644 index 0000000..531b9c5 --- /dev/null +++ b/src/main/java/me/didit/types/SetupVerifiedUpdate.java @@ -0,0 +1,597 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.types; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import me.didit.core.Conv; +import me.didit.core.FileUpload; +import me.didit.core.Json; +import me.didit.core.JsonModel; +import me.didit.core.StringEnum; +import org.jspecify.annotations.Nullable; + +/** + * Every field is optional. Each supplied rule updates only the fields you send for its kind. Omitted rules keep their settings. Two rules of the same kind answer duplicate_rule, and threshold or currency on a rule other than payout answer not_supported. + */ +public final class SetupVerifiedUpdate extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("signup_level", "rules", "claims", "workflows"); + + private SetupVerifiedUpdate(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SetupVerifiedUpdate} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SetupVerifiedUpdate fromJson(JsonNode json) { + return new SetupVerifiedUpdate(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The signup_level field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional signupLevel() { + return Json.optional(json, "signup_level", Conv.enumeration(SetupVerifiedUpdate.SignupLevel::of)); + } + + /** + * The rules field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional> rules() { + return Json.optional(json, "rules", Conv.list(Conv.model(SetupVerifiedUpdate.Rules::fromJson))); + } + + /** + * The claims field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional> claims() { + return Json.optional(json, "claims", Conv.list(Conv.STRING)); + } + + /** + * The workflows field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional workflows() { + return Json.optional(json, "workflows", Conv.model(SetupVerifiedUpdate.Workflows::fromJson)); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SetupVerifiedUpdate}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SetupVerifiedUpdate from) { + super(from); + } + + /** + * The signup_level field. + * + * @param signupLevel the value + * @return this builder + */ + public Builder signupLevel(SetupVerifiedUpdate.SignupLevel signupLevel) { + return set("signup_level", Conv.enumeration(SetupVerifiedUpdate.SignupLevel::of), signupLevel); + } + + /** + * The rules field. + * + * @param rules the value + * @return this builder + */ + public Builder rules(List rules) { + return set("rules", Conv.list(Conv.model(SetupVerifiedUpdate.Rules::fromJson)), rules); + } + + /** + * The claims field. + * + * @param claims the value + * @return this builder + */ + public Builder claims(List claims) { + return set("claims", Conv.list(Conv.STRING), claims); + } + + /** + * The workflows field. + * + * @param workflows the value + * @return this builder + */ + public Builder workflows(SetupVerifiedUpdate.Workflows workflows) { + return set("workflows", Conv.model(SetupVerifiedUpdate.Workflows::fromJson), workflows); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SetupVerifiedUpdate} + */ + public SetupVerifiedUpdate build() { + return new SetupVerifiedUpdate(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class SignupLevel extends StringEnum { + /** The value {@code "none"}. */ + public static final SignupLevel NONE = new SignupLevel("none"); + + /** The value {@code "liveness"}. */ + public static final SignupLevel LIVENESS = new SignupLevel("liveness"); + + /** The value {@code "full_id"}. */ + public static final SignupLevel FULL_ID = new SignupLevel("full_id"); + + private static final List KNOWN_VALUES = List.of(NONE, LIVENESS, FULL_ID); + + private SignupLevel(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static SignupLevel of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, SignupLevel::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + /** Step-up rule update */ + public static final class Rules extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("rule", "enabled", "method", "threshold", "currency"); + + private Rules(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Rules} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Rules fromJson(JsonNode json) { + return new Rules(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The rule field. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SetupVerifiedUpdate.Rules.Rule rule() { + return Json.required(json, "rule", Conv.enumeration(SetupVerifiedUpdate.Rules.Rule::of)); + } + + /** + * The enabled field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional enabled() { + return Json.optional(json, "enabled", Conv.BOOLEAN); + } + + /** + * The method field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional method() { + return Json.optional(json, "method", Conv.enumeration(SetupVerifiedUpdate.Rules.Method::of)); + } + + /** + * The threshold field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional threshold() { + return Json.optional(json, "threshold", Conv.STRING); + } + + /** + * The currency field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional currency() { + return Json.optional(json, "currency", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Rules}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Rules from) { + super(from); + } + + /** + * The rule field. + * + * @param rule the value + * @return this builder + */ + public Builder rule(SetupVerifiedUpdate.Rules.Rule rule) { + return set("rule", Conv.enumeration(SetupVerifiedUpdate.Rules.Rule::of), rule); + } + + /** + * The enabled field. + * + * @param enabled the value + * @return this builder + */ + public Builder enabled(boolean enabled) { + return set("enabled", Conv.BOOLEAN, enabled); + } + + /** + * The method field. + * + * @param method the value + * @return this builder + */ + public Builder method(SetupVerifiedUpdate.Rules.Method method) { + return set("method", Conv.enumeration(SetupVerifiedUpdate.Rules.Method::of), method); + } + + /** + * The threshold field. + * + * @param threshold the value + * @return this builder + */ + public Builder threshold(String threshold) { + return set("threshold", Conv.STRING, threshold); + } + + /** + * The currency field. + * + * @param currency the value + * @return this builder + */ + public Builder currency(String currency) { + return set("currency", Conv.STRING, currency); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Rules} + * @throws IllegalStateException when a required field is missing + */ + public Rules build() { + require("rule", false); + return new Rules(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Rule extends StringEnum { + /** The value {@code "payout"}. */ + public static final Rule PAYOUT = new Rule("payout"); + + /** The value {@code "bank"}. */ + public static final Rule BANK = new Rule("bank"); + + /** The value {@code "contact"}. */ + public static final Rule CONTACT = new Rule("contact"); + + /** The value {@code "device"}. */ + public static final Rule DEVICE = new Rule("device"); + + /** The value {@code "sign_in"}. */ + public static final Rule SIGN_IN = new Rule("sign_in"); + + private static final List KNOWN_VALUES = List.of(PAYOUT, BANK, CONTACT, DEVICE, SIGN_IN); + + private Rule(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static Rule of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Rule::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + + /** + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Method extends StringEnum { + /** The value {@code "liveness"}. */ + public static final Method LIVENESS = new Method("liveness"); + + /** The value {@code "selfie"}. */ + public static final Method SELFIE = new Method("selfie"); + + /** The value {@code "full_id"}. */ + public static final Method FULL_ID = new Method("full_id"); + + private static final List KNOWN_VALUES = List.of(LIVENESS, SELFIE, FULL_ID); + + private Method(String value) { + super(value); + } + + /** + * Returns the constant for a known value, or a new instance for any other value. + * + * @param value the string value + * @return the enum value + */ + public static Method of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Method::new); + } + + /** + * Returns the values known to this SDK version. + * + * @return the known values + */ + public static List knownValues() { + return KNOWN_VALUES; + } + + @Override + public boolean isKnown() { + return KNOWN_VALUES.contains(this); + } + } + } + + public static final class Workflows extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("liveness", "selfie", "full_id"); + + private Workflows(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Workflows} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Workflows fromJson(JsonNode json) { + return new Workflows(Json.copyObject(json), Map.of()); + } + + /** + * Returns an empty builder. + * + * @return a new builder + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Returns a builder holding a copy of every field of this value. + * + * @return a new builder + */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * The liveness field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional liveness() { + return Json.optional(json, "liveness", Conv.STRING); + } + + /** + * The selfie field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional selfie() { + return Json.optional(json, "selfie", Conv.STRING); + } + + /** + * The full_id field. + * + * @return the value, or empty when the field is absent or null + * @throws me.didit.errors.UnexpectedResponseException when the field has another type + */ + public Optional fullId() { + return Json.optional(json, "full_id", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Workflows}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Workflows from) { + super(from); + } + + /** + * The liveness field. + * + * @param liveness the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder liveness(@Nullable String liveness) { + return setNullable("liveness", Conv.STRING, liveness); + } + + /** + * The selfie field. + * + * @param selfie the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder selfie(@Nullable String selfie) { + return setNullable("selfie", Conv.STRING, selfie); + } + + /** + * The full_id field. + * + * @param fullId the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder fullId(@Nullable String fullId) { + return setNullable("full_id", Conv.STRING, fullId); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Workflows} + */ + public Workflows build() { + return new Workflows(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } +} diff --git a/src/test/java/me/didit/resources/AuthenticationSetupResourceTest.java b/src/test/java/me/didit/resources/AuthenticationSetupResourceTest.java new file mode 100644 index 0000000..d1e6c81 --- /dev/null +++ b/src/test/java/me/didit/resources/AuthenticationSetupResourceTest.java @@ -0,0 +1,399 @@ +// Code generated by codegen from openapi/*.json. DO NOT EDIT. +package me.didit.resources; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.fasterxml.jackson.databind.JsonNode; +import java.util.List; +import java.util.Map; +import me.didit.Didit; +import me.didit.core.Json; +import me.didit.testing.MockTransport; +import me.didit.testing.RecordedRequest; +import me.didit.testing.SpecExamples; +import me.didit.testing.TestJson; +import me.didit.testing.TestModels; +import me.didit.types.AuthenticationSetupGetBrandingParams; +import me.didit.types.AuthenticationSetupGetEmailsParams; +import me.didit.types.SetupAndroidApp; +import me.didit.types.SetupBrandingTexts; +import me.didit.types.SetupBrandingUpdate; +import me.didit.types.SetupConfigurationUpdate; +import me.didit.types.SetupDomainRequest; +import me.didit.types.SetupMethodUpdate; +import me.didit.types.SetupNativeAppsUpdate; +import me.didit.types.SetupOnboardingUpdate; +import me.didit.types.SetupProtectionUpdate; +import me.didit.types.SetupProviderCredentials; +import me.didit.types.SetupSettingsUpdate; +import me.didit.types.SetupVerifiedUpdate; +import org.junit.jupiter.api.Test; + +/** One test per operation of {@code authentication_setup}, against a stubbed HTTP layer. */ +@SuppressWarnings({"deprecation", "unused"}) +final class AuthenticationSetupResourceTest { + private final MockTransport transport = new MockTransport(); + private final Didit client = transport.client(); + + @Test + void getConfiguration() { + JsonNode example = SpecExamples.response("account.json", "GET", "/organizations/{organization_id}/applications/{application_id}/authentication/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().getConfiguration("00000000-0000-4000-8000-00000002518a", "00000000-0000-4000-8000-0000000237bf"); + RecordedRequest request = transport.only(); + assertEquals("GET", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-00000002518a/applications/00000000-0000-4000-8000-0000000237bf/authentication/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + assertEquals(0, request.body().length); + TestJson.assertJsonEquals(example, Json.toNode(result)); + } + + @Test + void updateConfiguration() { + SetupConfigurationUpdate params = SetupConfigurationUpdate.builder().redirectUris(List.of("value-redirect-uris")).allowedOrigins(List.of("value-allowed-origins")).postLogoutRedirectUri("value-post-logout-redirect-uri").sessionLifetime(1L).idleTimeout(1L).multipleSessions(true).passwordMinLength(1L).revokeOnPasswordChange(true).allowSubaddresses(true).signupPolicy(SetupConfigurationUpdate.SignupPolicy.ANYONE).allowedEmailDomains(List.of("value-allowed-email-domains")).build(); + JsonNode example = SpecExamples.response("account.json", "PATCH", "/organizations/{organization_id}/applications/{application_id}/authentication/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().updateConfiguration("00000000-0000-4000-8000-00000002966b", "00000000-0000-4000-8000-000000027b1d", params); + RecordedRequest request = transport.only(); + assertEquals("PATCH", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-00000002966b/applications/00000000-0000-4000-8000-000000027b1d/authentication/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + TestJson.assertJsonEquals("{\"redirect_uris\":[\"value-redirect-uris\"],\"allowed_origins\":[\"value-allowed-origins\"],\"post_logout_redirect_uri\":\"value-post-logout-redirect-uri\",\"session_lifetime\":1,\"idle_timeout\":1,\"multiple_sessions\":true,\"password_min_length\":1,\"revoke_on_password_change\":true,\"allow_subaddresses\":true,\"signup_policy\":\"anyone\",\"allowed_email_domains\":[\"value-allowed-email-domains\"]}", request.body()); + TestJson.assertJsonEquals(example, Json.toNode(result)); + } + + @Test + void setMethod() { + SetupMethodUpdate params = SetupMethodUpdate.builder().enabled(true).credentials(SetupProviderCredentials.builder().clientId("value-client-id").clientSecret("value-client-secret").build()).credentialSource(SetupMethodUpdate.CredentialSource.OWN).workflowId("00000000-0000-4000-8000-000000001b5b").build(); + JsonNode example = SpecExamples.response("account.json", "PUT", "/organizations/{organization_id}/applications/{application_id}/authentication/methods/{name}/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().setMethod("00000000-0000-4000-8000-00000001bec7", "00000000-0000-4000-8000-00000001a883", "00000000-0000-4000-8000-0000000101e4", params); + RecordedRequest request = transport.only(); + assertEquals("PUT", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-00000001bec7/applications/00000000-0000-4000-8000-00000001a883/authentication/methods/00000000-0000-4000-8000-0000000101e4/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + TestJson.assertJsonEquals("{\"enabled\":true,\"credentials\":{\"client_id\":\"value-client-id\",\"client_secret\":\"value-client-secret\"},\"credential_source\":\"own\",\"workflow_id\":\"00000000-0000-4000-8000-000000001b5b\"}", request.body()); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void getOnboarding() { + JsonNode example = SpecExamples.response("account.json", "GET", "/organizations/{organization_id}/applications/{application_id}/authentication/onboarding/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().getOnboarding("00000000-0000-4000-8000-000000020d85", "00000000-0000-4000-8000-00000001f53d"); + RecordedRequest request = transport.only(); + assertEquals("GET", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-000000020d85/applications/00000000-0000-4000-8000-00000001f53d/authentication/onboarding/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + assertEquals(0, request.body().length); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void updateOnboarding() { + SetupOnboardingUpdate params = SetupOnboardingUpdate.builder().testSkipped(true).importSkipped(true).signInUi(SetupOnboardingUpdate.SignInUi.HOSTED).build(); + JsonNode example = SpecExamples.response("account.json", "PATCH", "/organizations/{organization_id}/applications/{application_id}/authentication/onboarding/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().updateOnboarding("00000000-0000-4000-8000-000000024e67", "00000000-0000-4000-8000-00000002349c", params); + RecordedRequest request = transport.only(); + assertEquals("PATCH", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-000000024e67/applications/00000000-0000-4000-8000-00000002349c/authentication/onboarding/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + TestJson.assertJsonEquals("{\"test_skipped\":true,\"import_skipped\":true,\"sign_in_ui\":\"hosted\"}", request.body()); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void getSettings() { + JsonNode example = SpecExamples.response("account.json", "GET", "/organizations/{organization_id}/applications/{application_id}/authentication/settings/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().getSettings("00000000-0000-4000-8000-00000001e86e", "00000000-0000-4000-8000-00000001d128"); + RecordedRequest request = transport.only(); + assertEquals("GET", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-00000001e86e/applications/00000000-0000-4000-8000-00000001d128/authentication/settings/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + assertEquals(0, request.body().length); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void updateSettings() { + SetupSettingsUpdate params = SetupSettingsUpdate.builder().signInUi(SetupSettingsUpdate.SignInUi.HOSTED).agentHumansOnly(true).agentsEnabled(true).agentScopes(List.of(SetupSettingsUpdate.AgentScopes.READ)).agentLifetime(1L).agentIdleTimeout(1L).agentApproval(SetupSettingsUpdate.AgentApproval.PASSKEY).organizationsEnabled(true).mfaPolicy(SetupSettingsUpdate.MfaPolicy.OPTIONAL).defaultMemberRole(SetupSettingsUpdate.DefaultMemberRole.ADMIN).webhookEventsDisabled(List.of("value-webhook-events-disabled")).build(); + JsonNode example = SpecExamples.response("account.json", "PATCH", "/organizations/{organization_id}/applications/{application_id}/authentication/settings/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().updateSettings("00000000-0000-4000-8000-00000002273a", "00000000-0000-4000-8000-000000020e71", params); + RecordedRequest request = transport.only(); + assertEquals("PATCH", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-00000002273a/applications/00000000-0000-4000-8000-000000020e71/authentication/settings/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + TestJson.assertJsonEquals("{\"sign_in_ui\":\"hosted\",\"agent_humans_only\":true,\"agents_enabled\":true,\"agent_scopes\":[\"read\"],\"agent_lifetime\":1,\"agent_idle_timeout\":1,\"agent_approval\":\"passkey\",\"organizations_enabled\":true,\"mfa_policy\":\"optional\",\"default_member_role\":\"admin\",\"webhook_events_disabled\":[\"value-webhook-events-disabled\"]}", request.body()); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void getBranding() { + AuthenticationSetupGetBrandingParams params = AuthenticationSetupGetBrandingParams.builder().language("value-language").build(); + JsonNode example = SpecExamples.response("account.json", "GET", "/organizations/{organization_id}/applications/{application_id}/authentication/branding/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().getBranding("00000000-0000-4000-8000-00000001e374", "00000000-0000-4000-8000-00000001cc2e", params); + RecordedRequest request = transport.only(); + assertEquals("GET", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-00000001e374/applications/00000000-0000-4000-8000-00000001cc2e/authentication/branding/", request.path()); + assertEquals(Map.ofEntries(Map.entry("language", List.of("value-language"))), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + assertEquals(0, request.body().length); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void updateBranding() { + SetupBrandingUpdate params = SetupBrandingUpdate.builder().texts(Map.of("key", SetupBrandingTexts.builder().signInTitle("value-sign-in-title").subtitle("value-subtitle").build())).termsUrl("value-terms-url").privacyUrl("value-privacy-url").build(); + JsonNode example = SpecExamples.response("account.json", "PATCH", "/organizations/{organization_id}/applications/{application_id}/authentication/branding/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().updateBranding("00000000-0000-4000-8000-0000000221bc", "00000000-0000-4000-8000-0000000208f3", params); + RecordedRequest request = transport.only(); + assertEquals("PATCH", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-0000000221bc/applications/00000000-0000-4000-8000-0000000208f3/authentication/branding/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + TestJson.assertJsonEquals("{\"texts\":{\"key\":{\"sign_in_title\":\"value-sign-in-title\",\"subtitle\":\"value-subtitle\"}},\"terms_url\":\"value-terms-url\",\"privacy_url\":\"value-privacy-url\"}", request.body()); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void getEmails() { + AuthenticationSetupGetEmailsParams params = AuthenticationSetupGetEmailsParams.builder().language("value-language").build(); + JsonNode example = SpecExamples.response("account.json", "GET", "/organizations/{organization_id}/applications/{application_id}/authentication/emails/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().getEmails("00000000-0000-4000-8000-00000001bd47", "00000000-0000-4000-8000-00000001a703", params); + RecordedRequest request = transport.only(); + assertEquals("GET", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-00000001bd47/applications/00000000-0000-4000-8000-00000001a703/authentication/emails/", request.path()); + assertEquals(Map.ofEntries(Map.entry("language", List.of("value-language"))), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + assertEquals(0, request.body().length); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void getEmail() { + JsonNode example = SpecExamples.response("account.json", "GET", "/organizations/{organization_id}/applications/{application_id}/authentication/emails/{key}/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().getEmail("00000000-0000-4000-8000-00000001a919", "00000000-0000-4000-8000-000000019356", "00000000-0000-4000-8000-00000000e51b"); + RecordedRequest request = transport.only(); + assertEquals("GET", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-00000001a919/applications/00000000-0000-4000-8000-000000019356/authentication/emails/00000000-0000-4000-8000-00000000e51b/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + assertEquals(0, request.body().length); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void getProtection() { + JsonNode example = SpecExamples.response("account.json", "GET", "/organizations/{organization_id}/applications/{application_id}/authentication/protection/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().getProtection("00000000-0000-4000-8000-0000000211c6", "00000000-0000-4000-8000-00000001f97e"); + RecordedRequest request = transport.only(); + assertEquals("GET", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-0000000211c6/applications/00000000-0000-4000-8000-00000001f97e/authentication/protection/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + assertEquals(0, request.body().length); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void updateProtection() { + SetupProtectionUpdate params = SetupProtectionUpdate.builder().enabled(true).breachedPasswordCheck(true).policies(Map.of("key", SetupProtectionUpdate.PoliciesValue.OFF)).build(); + JsonNode example = SpecExamples.response("account.json", "PATCH", "/organizations/{organization_id}/applications/{application_id}/authentication/protection/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().updateProtection("00000000-0000-4000-8000-000000025314", "00000000-0000-4000-8000-000000023949", params); + RecordedRequest request = transport.only(); + assertEquals("PATCH", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-000000025314/applications/00000000-0000-4000-8000-000000023949/authentication/protection/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + TestJson.assertJsonEquals("{\"enabled\":true,\"breached_password_check\":true,\"policies\":{\"key\":\"off\"}}", request.body()); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void getVerified() { + JsonNode example = SpecExamples.response("account.json", "GET", "/organizations/{organization_id}/applications/{application_id}/authentication/verified/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().getVerified("00000000-0000-4000-8000-00000001e421", "00000000-0000-4000-8000-00000001ccdb"); + RecordedRequest request = transport.only(); + assertEquals("GET", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-00000001e421/applications/00000000-0000-4000-8000-00000001ccdb/authentication/verified/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + assertEquals(0, request.body().length); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void updateVerified() { + SetupVerifiedUpdate params = SetupVerifiedUpdate.builder().signupLevel(SetupVerifiedUpdate.SignupLevel.NONE).rules(List.of(SetupVerifiedUpdate.Rules.builder().rule(SetupVerifiedUpdate.Rules.Rule.PAYOUT).enabled(true).method(SetupVerifiedUpdate.Rules.Method.LIVENESS).build())).claims(List.of("value-claims")).workflows(SetupVerifiedUpdate.Workflows.builder().liveness("00000000-0000-4000-8000-000000000f75").selfie("00000000-0000-4000-8000-000000000884").build()).build(); + JsonNode example = SpecExamples.response("account.json", "PATCH", "/organizations/{organization_id}/applications/{application_id}/authentication/verified/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().updateVerified("00000000-0000-4000-8000-000000022284", "00000000-0000-4000-8000-0000000209bb", params); + RecordedRequest request = transport.only(); + assertEquals("PATCH", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-000000022284/applications/00000000-0000-4000-8000-0000000209bb/authentication/verified/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + TestJson.assertJsonEquals("{\"signup_level\":\"none\",\"rules\":[{\"rule\":\"payout\",\"enabled\":true,\"method\":\"liveness\"}],\"claims\":[\"value-claims\"],\"workflows\":{\"liveness\":\"00000000-0000-4000-8000-000000000f75\",\"selfie\":\"00000000-0000-4000-8000-000000000884\"}}", request.body()); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void getDomain() { + JsonNode example = SpecExamples.response("account.json", "GET", "/organizations/{organization_id}/applications/{application_id}/authentication/domain/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().getDomain("00000000-0000-4000-8000-00000001bcd6", "00000000-0000-4000-8000-00000001a692"); + RecordedRequest request = transport.only(); + assertEquals("GET", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-00000001bcd6/applications/00000000-0000-4000-8000-00000001a692/authentication/domain/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + assertEquals(0, request.body().length); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void setDomain() { + SetupDomainRequest params = SetupDomainRequest.builder().domain("value-domain").build(); + JsonNode example = SpecExamples.response("account.json", "PUT", "/organizations/{organization_id}/applications/{application_id}/authentication/domain/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().setDomain("00000000-0000-4000-8000-00000001bdde", "00000000-0000-4000-8000-00000001a79a", params); + RecordedRequest request = transport.only(); + assertEquals("PUT", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-00000001bdde/applications/00000000-0000-4000-8000-00000001a79a/authentication/domain/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + TestJson.assertJsonEquals("{\"domain\":\"value-domain\"}", request.body()); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void removeDomain() { + JsonNode example = SpecExamples.response("account.json", "DELETE", "/organizations/{organization_id}/applications/{application_id}/authentication/domain/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().removeDomain("00000000-0000-4000-8000-00000001f9e2", "00000000-0000-4000-8000-00000001e21b"); + RecordedRequest request = transport.only(); + assertEquals("DELETE", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-00000001f9e2/applications/00000000-0000-4000-8000-00000001e21b/authentication/domain/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + assertEquals(0, request.body().length); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void verifyDomain() { + JsonNode example = SpecExamples.response("account.json", "POST", "/organizations/{organization_id}/applications/{application_id}/authentication/domain/verify/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().verifyDomain("00000000-0000-4000-8000-00000001fa98", "00000000-0000-4000-8000-00000001e2d1"); + RecordedRequest request = transport.only(); + assertEquals("POST", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-00000001fa98/applications/00000000-0000-4000-8000-00000001e2d1/authentication/domain/verify/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + assertEquals(0, request.body().length); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void activateDomain() { + JsonNode example = SpecExamples.response("account.json", "POST", "/organizations/{organization_id}/applications/{application_id}/authentication/domain/activate/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().activateDomain("00000000-0000-4000-8000-000000022235", "00000000-0000-4000-8000-00000002096c"); + RecordedRequest request = transport.only(); + assertEquals("POST", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-000000022235/applications/00000000-0000-4000-8000-00000002096c/authentication/domain/activate/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + assertEquals(0, request.body().length); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void getNativeApps() { + JsonNode example = SpecExamples.response("account.json", "GET", "/organizations/{organization_id}/applications/{application_id}/authentication/native-apps/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().getNativeApps("00000000-0000-4000-8000-00000002247d", "00000000-0000-4000-8000-000000020bb4"); + RecordedRequest request = transport.only(); + assertEquals("GET", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-00000002247d/applications/00000000-0000-4000-8000-000000020bb4/authentication/native-apps/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + assertEquals(0, request.body().length); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void updateNativeApps() { + SetupNativeAppsUpdate params = SetupNativeAppsUpdate.builder().iosAppIds(List.of("value-ios-app-ids")).androidApps(List.of(SetupAndroidApp.builder().packageName("value-package-name").sha256CertFingerprints(List.of("value-sha256-cert-fingerprints")).build())).build(); + JsonNode example = SpecExamples.response("account.json", "PUT", "/organizations/{organization_id}/applications/{application_id}/authentication/native-apps/", "200"); + transport.respondJson(200, example); + var result = client.authenticationSetup().updateNativeApps("00000000-0000-4000-8000-0000000266c4", "00000000-0000-4000-8000-000000024c78", params); + RecordedRequest request = transport.only(); + assertEquals("PUT", request.method()); + assertEquals("/organizations/00000000-0000-4000-8000-0000000266c4/applications/00000000-0000-4000-8000-000000024c78/authentication/native-apps/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://apx.didit.me", request.origin()); + TestJson.assertJsonEquals("{\"ios_app_ids\":[\"value-ios-app-ids\"],\"android_apps\":[{\"package_name\":\"value-package-name\",\"sha256_cert_fingerprints\":[\"value-sha256-cert-fingerprints\"]}]}", request.body()); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } +} diff --git a/src/test/java/me/didit/resources/InvestigatorResourceTest.java b/src/test/java/me/didit/resources/InvestigatorResourceTest.java index f44be0e..e8b0a88 100644 --- a/src/test/java/me/didit/resources/InvestigatorResourceTest.java +++ b/src/test/java/me/didit/resources/InvestigatorResourceTest.java @@ -276,4 +276,20 @@ void updateSettings() { TestJson.assertJsonEquals(example, Json.toNode(result)); TestModels.readAll(result); } + + @Test + void retrieveOffer() { + JsonNode example = TestJson.parse("{}"); + transport.respondJson(200, example); + var result = client.investigator().retrieveOffer(); + RecordedRequest request = transport.only(); + assertEquals("GET", request.method()); + assertEquals("/v3/investigator/offer/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://verification.didit.me", request.origin()); + assertEquals(0, request.body().length); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } }