diff --git a/openapi/SOURCE.json b/openapi/SOURCE.json index f67b1ab..5561124 100644 --- a/openapi/SOURCE.json +++ b/openapi/SOURCE.json @@ -1,8 +1,8 @@ { "verification.json": { "url": "https://docs.didit.me/openapi-25.json", - "sha256": "6157d174fff4e0093ca7ac8e0f064ffc777d1cfa4a7eeb2b0e88fbf86f4a060b", - "fetched_at": "2026-10-26T07:02:08Z" + "sha256": "b2658eb22e23f868d2df5fe513c8dcdadce3abf2e35d1bbebce0382c911038db", + "fetched_at": "2026-10-27T06:50:05Z" }, "account.json": { "url": "https://docs.didit.me/openapi-auth.json", diff --git a/openapi/verification.json b/openapi/verification.json index 0236ac8..1125811 100644 --- a/openapi/verification.json +++ b/openapi/verification.json @@ -1509,7 +1509,7 @@ "/v3/session/imports/": { "post": { "summary": "Create a verification import job", - "description": "Create an asynchronous import job for historical User Verification sessions, Business Verification sessions, transaction monitoring records, or workflow custom status rules. Use this to migrate from providers such as Sumsub, MetaMap, Veriff, Onfido, Persona, Trulioo, Jumio, Incode, iDenfy, or any other provider after transforming the export into Didit's canonical CSV/NDJSON format. Imports are disabled by default and must be enabled per organization by Didit.", + "description": "Create an asynchronous import job for historical User Verification sessions, Business Verification sessions, transaction monitoring records, or workflow custom status rules. Set `source=provider` to migrate from another provider: Didit reads Sumsub, Onfido, Persona and ComplyCube with your read-only key, reads Veriff, iDenfy and MetaMap records by the IDs you upload in `file`, and imports an export file in Didit's format for the other providers. Record IDs are namespaced by provider (`sumsub:`) so a re-run skips everything already in Didit. Imports are disabled by default and must be enabled per organization by Didit.", "operationId": "post_v3_session_imports_create", "x-didit-sdk": { "resource": "sessions.imports", @@ -1560,6 +1560,81 @@ "type": "string", "format": "uri", "description": "Alternative to file upload. Must be an HTTPS URL resolving to a public address (private/loopback networks are rejected). Mutually exclusive with `file`." + }, + "source": { + "type": "string", + "enum": [ + "file", + "provider" + ], + "description": "`provider` makes this a migration from another identity verification provider. Omit for a file import." + }, + "provider": { + "type": "string", + "enum": [ + "sumsub", + "jumio", + "veriff", + "onfido", + "persona", + "metamap", + "socure", + "idnow", + "shufti", + "idenfy", + "ondato", + "trulioo", + "au10tix", + "complycube", + "other" + ], + "description": "Migration source, from `GET /v3/session/imports/providers/`. Required when `source` is `provider`." + }, + "credentials": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The provider's read-only key, with the field names `credential_fields` lists. Encrypted at rest, never returned, and erased when the import ends. Send it as a JSON string in multipart." + }, + "options": { + "type": "object", + "properties": { + "region": { + "type": "string", + "description": "The provider region, one of its `regions` (Onfido: `eu`, `us`, `ca`)." + } + } + }, + "status_mapping": { + "type": "object", + "additionalProperties": { + "type": "string", + "enum": [ + "Approved", + "Declined", + "In Review", + "Expired", + "Not Finished", + "Abandoned" + ] + }, + "description": "Edits to the provider's default status mapping: source status to Didit status. `Not Finished` and `Abandoned` are skipped and counted, never imported." + }, + "dry_run": { + "type": "boolean", + "default": false, + "description": "Count what the migration would import (by status, already in Didit, same person, not finished) and write nothing. The job ends `READY`; start it with `POST /v3/session/imports/{importId}/start/`." + }, + "face_templates": { + "type": "boolean", + "default": false, + "description": "Build face templates from the imported selfies and search them against the application's faces and blocklist. Matches are flagged for review only. Requires `lawful_basis_confirmed`." + }, + "lawful_basis_confirmed": { + "type": "boolean", + "default": false, + "description": "Confirms you have a lawful basis to share these selfies with Didit as processor." } } } @@ -1599,6 +1674,81 @@ "type": "string", "format": "uri", "description": "Alternative to file upload. Must be an HTTPS URL resolving to a public address (private/loopback networks are rejected). Mutually exclusive with `file`." + }, + "source": { + "type": "string", + "enum": [ + "file", + "provider" + ], + "description": "`provider` makes this a migration from another identity verification provider. Omit for a file import." + }, + "provider": { + "type": "string", + "enum": [ + "sumsub", + "jumio", + "veriff", + "onfido", + "persona", + "metamap", + "socure", + "idnow", + "shufti", + "idenfy", + "ondato", + "trulioo", + "au10tix", + "complycube", + "other" + ], + "description": "Migration source, from `GET /v3/session/imports/providers/`. Required when `source` is `provider`." + }, + "credentials": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The provider's read-only key, with the field names `credential_fields` lists. Encrypted at rest, never returned, and erased when the import ends. Send it as a JSON string in multipart." + }, + "options": { + "type": "object", + "properties": { + "region": { + "type": "string", + "description": "The provider region, one of its `regions` (Onfido: `eu`, `us`, `ca`)." + } + } + }, + "status_mapping": { + "type": "object", + "additionalProperties": { + "type": "string", + "enum": [ + "Approved", + "Declined", + "In Review", + "Expired", + "Not Finished", + "Abandoned" + ] + }, + "description": "Edits to the provider's default status mapping: source status to Didit status. `Not Finished` and `Abandoned` are skipped and counted, never imported." + }, + "dry_run": { + "type": "boolean", + "default": false, + "description": "Count what the migration would import (by status, already in Didit, same person, not finished) and write nothing. The job ends `READY`; start it with `POST /v3/session/imports/{importId}/start/`." + }, + "face_templates": { + "type": "boolean", + "default": false, + "description": "Build face templates from the imported selfies and search them against the application's faces and blocklist. Matches are flagged for review only. Requires `lawful_basis_confirmed`." + }, + "lawful_basis_confirmed": { + "type": "boolean", + "default": false, + "description": "Confirms you have a lawful basis to share these selfies with Didit as processor." } } }, @@ -1650,7 +1800,7 @@ } }, "400": { - "description": "Invalid workflow, file type, file size, source URL, or selector combination.", + "description": "Invalid workflow, file type, file size, source URL, or selector combination. A migration whose key the provider refuses answers `code` (`invalid_credentials`, `missing_permission`, `wrong_region`, `provider_unavailable`, `rate_limited`, `ids_required`, `record_not_found`), `missing_permissions` and `suggested_region`.", "content": { "application/json": { "examples": { @@ -68276,217 +68426,118 @@ } } }, - "/v3/session/{sessionId}/simulate/": { - "post": { - "summary": "Simulate a sandbox session's status", - "description": "Force a terminal status on a sandbox session after the fact, from your backend, without running the flow. Sandbox applications only: a live session returns `404`. Works for User Verification (KYC) and Business Verification (KYB) sessions.\n\nSet `new_status`, or let `scenario` or `risk` supply it. `risk` (or the first risk the scenario's magic values carry) adds that warning to the session. The change is recorded in the session's activity.\n\n`send_webhooks` (default `true`) sends exactly the webhooks a real status change sends. With `false` the status still changes and the console still updates live, but no webhook is logged or sent, the missed-webhook recovery never re-sends that decision, and the next status change sends webhooks as usual. The response echoes the value applied.\n\nRequires the `write:sessions` privilege; a scoped API key needs write access to sessions. An unknown `session_id` returns `404` and another application's session returns `403`, both before the body is read; a live session returns `404` only after the body is validated. To simulate from the hosted flow with the session's own token, use `POST /v3/session/{sessionId}/sandbox/simulate/`. See [Sandbox & Test Data](/integration/sandbox-testing) for the scenario catalog.", - "operationId": "post_v3_session_simulate", + "/v3/organization/bank-verification-pricing/": { + "get": { + "summary": "Get bank verification prices (public, unauthenticated)", + "description": "Returns the list price of each Bank Verification method in every country: bank sign-in with its balance and transactions add-ons, and the account check. Use it to quote a bank step before you build a workflow, or to show bank prices in your own product.\n\nPublic: send no auth header. The response contains no organization data and is the same for every caller. It is cached publicly for one hour and carries an `ETag`, so send `If-None-Match` to get a `304 Not Modified` when nothing changed.\n\nA method is `available` only where Didit serves it in production today, and its `price_usd` is `null` everywhere else, so the feed never shows a price you cannot buy. `available: false` covers a country with no approved price, a method the country does not support, and a route that is not switched on yet.\n\nThese are list prices before your plan discount. Your plan discount applies to the whole bank price, and a negotiated or contract price replaces the list price for your organization.", + "operationId": "get_v3_bank_verification_pricing", "tags": [ - "Sessions" + "Pricing" ], "security": [ - { - "ApiKeyAuth": [] - } + {} ], - "parameters": [ + "parameters": [], + "x-codeSamples": [ { - "in": "path", - "name": "sessionId", - "required": true, - "description": "UUID of the sandbox verification session. Accepts both user (KYC) and business (KYB) session IDs.", - "schema": { - "type": "string", - "format": "uuid", - "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6" - } + "lang": "curl", + "label": "curl", + "source": "curl -fsS https://verification.didit.me/v3/organization/bank-verification-pricing/" + }, + { + "lang": "python", + "label": "Python", + "source": "import requests\n\nresp = requests.get('https://verification.didit.me/v3/organization/bank-verification-pricing/', timeout=10)\nresp.raise_for_status()\nfeed = resp.json()\nfor iso3, country in feed['countries'].items():\n sign_in = country['methods']['open_banking']\n if sign_in['available']:\n print(iso3, country['name'], sign_in['price_usd'])" + }, + { + "lang": "javascript", + "label": "JavaScript", + "source": "const feed = await fetch('https://verification.didit.me/v3/organization/bank-verification-pricing/').then((r) => r.json());\nconst gbr = feed.countries.GBR.methods;\nconsole.log(gbr.open_banking.available ? gbr.open_banking.price_usd : 'Not available');\nconsole.log(gbr.account_lookup.available ? gbr.account_lookup.price_usd : 'Not available');" } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SandboxSimulateRequest" - }, - "examples": { - "Scenario Without Webhooks": { - "summary": "Decline through a scenario without sending webhooks", - "value": { - "scenario": "decline_aml_hit", - "send_webhooks": false - } - }, - "Status Only": { - "summary": "Approve and send the usual webhooks", - "value": { - "new_status": "Approved" - } - } - } - } - } + "x-didit-sdk": { + "resource": "pricing", + "method": "bank_verification", + "auth": "none", + "server": true }, "responses": { "200": { - "description": "The status changed.", + "description": "Bank Verification list prices by country.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SandboxSimulateResponse" + "$ref": "#/components/schemas/BankVerificationPricing" }, "examples": { - "Simulated": { - "summary": "Declined through a scenario, webhooks not sent", - "value": { - "session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "previous_status": "In Progress", - "status": "Declined", - "scenario": "decline_aml_hit", - "risk": "POSSIBLE_MATCH_FOUND", - "send_webhooks": false - } - } - } - } - } - }, - "400": { - "description": "Validation error: an unknown scenario or risk, no `new_status` when neither `scenario` nor `risk` supplies one, a status this endpoint does not set, or the session already has the requested status (a bare JSON array).", - "content": { - "application/json": { - "examples": { - "Unknown Scenario": { - "summary": "scenario is not in the catalog", - "value": { - "scenario": [ - "Unknown sandbox scenario: 'not-a-scenario'." - ] - } - }, - "Unknown Risk": { - "summary": "risk is not in the catalog", - "value": { - "risk": [ - "Unknown sandbox risk case: 'NOT_A_RISK'." - ] - } - }, - "Missing new_status": { - "summary": "No new_status, scenario or risk", - "value": { - "new_status": [ - "This field is required." - ] - } - }, - "Invalid new_status": { - "summary": "A status the simulation does not set", - "value": { - "new_status": [ - "\"Resubmitted\" is not a valid choice." - ] - } - }, - "Same Status": { - "summary": "The session already has this status", - "value": [ - "The new status is the same as the current status." - ] - } - } - } - } - }, - "401": { - "description": "The scoped API key has expired.", - "content": { - "application/json": { - "examples": { - "Expired API Key": { - "summary": "Scoped API key past its expiry date", + "Two countries": { + "summary": "One country with both methods, one with neither", "value": { - "detail": "This API key has expired." - } - } - } - } - } - }, - "403": { - "description": "Missing or invalid credentials, a caller without the `write:sessions` privilege, a scoped API key without the access this endpoint needs, or a `session_id` that belongs to another application.", - "content": { - "application/json": { - "examples": { - "Invalid Credentials": { - "summary": "Missing or invalid x-api-key", - "value": { - "detail": "Authentication credentials were not provided or are invalid." - } - }, - "Missing Privilege": { - "summary": "Caller lacks write:sessions", - "value": { - "detail": "You do not have permission to perform this action." - } - }, - "Scoped Key Without Access": { - "summary": "Scoped API key without this access", - "value": { - "detail": "This API key has no write access to sessions." - } - } - } - } - } - }, - "404": { - "description": "No session with this `session_id` exists, or it is a live (non-sandbox) session.", - "content": { - "application/json": { - "examples": { - "Not Found": { - "summary": "Unknown or live session", - "value": { - "detail": "Not found." + "currency": "USD", + "statement_upload": { + "price_usd": "0.0000", + "included_after_charged_bank_attempt": true, + "standalone_available": false + }, + "own_provider_fee_usd": "0.0200", + "countries": { + "GBR": { + "name": "United Kingdom", + "methods": { + "open_banking": { + "available": true, + "market": "UK and EEA", + "price_usd": "0.7900", + "add_ons": { + "balance": "0.3500", + "transactions": "1.3000" + } + }, + "account_lookup": { + "available": true, + "price_usd": "0.4000" + } + } + }, + "CAN": { + "name": "Canada", + "methods": { + "open_banking": { + "available": false, + "market": null, + "price_usd": null, + "add_ons": {} + }, + "account_lookup": { + "available": false, + "price_usd": null + } + } + } + } } } } } } - } - }, - "x-codeSamples": [ - { - "lang": "curl", - "label": "curl", - "source": "curl -X POST \\\n https://verification.didit.me/v3/session/3fa85f64-5717-4562-b3fc-2c963f66afa6/simulate/ \\\n -H 'x-api-key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\"scenario\": \"decline_aml_hit\", \"send_webhooks\": false}'" }, - { - "lang": "python", - "label": "Python", - "source": "import requests\n\nresponse = requests.post(\n \"https://verification.didit.me/v3/session/3fa85f64-5717-4562-b3fc-2c963f66afa6/simulate/\",\n headers={\"x-api-key\": \"YOUR_API_KEY\"},\n json={\"scenario\": \"decline_aml_hit\", \"send_webhooks\": False},\n)\nresponse.raise_for_status()\nprint(response.json())" + "304": { + "description": "Not modified: the `ETag` you sent in `If-None-Match` still matches. No body." } - ], - "x-didit-sdk": { - "resource": "sessions", - "method": "simulate", - "auth": "api_key", - "server": true } } }, - "/v3/session/{sessionId}/sandbox/simulate/": { + "/v3/session/{sessionId}/simulate/": { "post": { - "summary": "Simulate a sandbox session's status from the client", - "description": "The same simulation as `POST /v3/session/{sessionId}/simulate/`, authenticated with the session's own `Session-Token` (returned in `session_token` by [Create Session](/sessions-api/create-session)) instead of your API key, so a test harness or the hosted flow can call it from the client. The body, the response and `send_webhooks` behave exactly as on that endpoint.\n\nA `Session-Token` of a live (non-sandbox) application, or one that does not match the `sessionId` in the path, returns `404`. See [Sandbox & Test Data](/integration/sandbox-testing).", - "operationId": "post_v3_session_sandbox_simulate", + "summary": "Simulate a sandbox session's status", + "description": "Force a terminal status on a sandbox session after the fact, from your backend, without running the flow. Sandbox applications only: a live session returns `404`. Works for User Verification (KYC) and Business Verification (KYB) sessions.\n\nSet `new_status`, or let `scenario` or `risk` supply it. `risk` (or the first risk the scenario's magic values carry) adds that warning to the session. The change is recorded in the session's activity.\n\n`send_webhooks` (default `true`) sends exactly the webhooks a real status change sends. With `false` the status still changes and the console still updates live, but no webhook is logged or sent, the missed-webhook recovery never re-sends that decision, and the next status change sends webhooks as usual. The response echoes the value applied.\n\nRequires the `write:sessions` privilege; a scoped API key needs write access to sessions. An unknown `session_id` returns `404` and another application's session returns `403`, both before the body is read; a live session returns `404` only after the body is validated. To simulate from the hosted flow with the session's own token, use `POST /v3/session/{sessionId}/sandbox/simulate/`. See [Sandbox & Test Data](/integration/sandbox-testing) for the scenario catalog.", + "operationId": "post_v3_session_simulate", "tags": [ "Sessions" ], "security": [ { - "SessionTokenAuth": [] + "ApiKeyAuth": [] } ], "parameters": [ @@ -68494,7 +68545,207 @@ "in": "path", "name": "sessionId", "required": true, - "description": "UUID of the sandbox verification session. Must match the session encoded in the Session-Token used to authenticate.", + "description": "UUID of the sandbox verification session. Accepts both user (KYC) and business (KYB) session IDs.", + "schema": { + "type": "string", + "format": "uuid", + "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SandboxSimulateRequest" + }, + "examples": { + "Scenario Without Webhooks": { + "summary": "Decline through a scenario without sending webhooks", + "value": { + "scenario": "decline_aml_hit", + "send_webhooks": false + } + }, + "Status Only": { + "summary": "Approve and send the usual webhooks", + "value": { + "new_status": "Approved" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The status changed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SandboxSimulateResponse" + }, + "examples": { + "Simulated": { + "summary": "Declined through a scenario, webhooks not sent", + "value": { + "session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "previous_status": "In Progress", + "status": "Declined", + "scenario": "decline_aml_hit", + "risk": "POSSIBLE_MATCH_FOUND", + "send_webhooks": false + } + } + } + } + } + }, + "400": { + "description": "Validation error: an unknown scenario or risk, no `new_status` when neither `scenario` nor `risk` supplies one, a status this endpoint does not set, or the session already has the requested status (a bare JSON array).", + "content": { + "application/json": { + "examples": { + "Unknown Scenario": { + "summary": "scenario is not in the catalog", + "value": { + "scenario": [ + "Unknown sandbox scenario: 'not-a-scenario'." + ] + } + }, + "Unknown Risk": { + "summary": "risk is not in the catalog", + "value": { + "risk": [ + "Unknown sandbox risk case: 'NOT_A_RISK'." + ] + } + }, + "Missing new_status": { + "summary": "No new_status, scenario or risk", + "value": { + "new_status": [ + "This field is required." + ] + } + }, + "Invalid new_status": { + "summary": "A status the simulation does not set", + "value": { + "new_status": [ + "\"Resubmitted\" is not a valid choice." + ] + } + }, + "Same Status": { + "summary": "The session already has this status", + "value": [ + "The new status is the same as the current status." + ] + } + } + } + } + }, + "401": { + "description": "The scoped API key has expired.", + "content": { + "application/json": { + "examples": { + "Expired API Key": { + "summary": "Scoped API key past its expiry date", + "value": { + "detail": "This API key has expired." + } + } + } + } + } + }, + "403": { + "description": "Missing or invalid credentials, a caller without the `write:sessions` privilege, a scoped API key without the access this endpoint needs, or a `session_id` that belongs to another application.", + "content": { + "application/json": { + "examples": { + "Invalid Credentials": { + "summary": "Missing or invalid x-api-key", + "value": { + "detail": "Authentication credentials were not provided or are invalid." + } + }, + "Missing Privilege": { + "summary": "Caller lacks write:sessions", + "value": { + "detail": "You do not have permission to perform this action." + } + }, + "Scoped Key Without Access": { + "summary": "Scoped API key without this access", + "value": { + "detail": "This API key has no write access to sessions." + } + } + } + } + } + }, + "404": { + "description": "No session with this `session_id` exists, or it is a live (non-sandbox) session.", + "content": { + "application/json": { + "examples": { + "Not Found": { + "summary": "Unknown or live session", + "value": { + "detail": "Not found." + } + } + } + } + } + } + }, + "x-codeSamples": [ + { + "lang": "curl", + "label": "curl", + "source": "curl -X POST \\\n https://verification.didit.me/v3/session/3fa85f64-5717-4562-b3fc-2c963f66afa6/simulate/ \\\n -H 'x-api-key: YOUR_API_KEY' \\\n -H 'Content-Type: application/json' \\\n -d '{\"scenario\": \"decline_aml_hit\", \"send_webhooks\": false}'" + }, + { + "lang": "python", + "label": "Python", + "source": "import requests\n\nresponse = requests.post(\n \"https://verification.didit.me/v3/session/3fa85f64-5717-4562-b3fc-2c963f66afa6/simulate/\",\n headers={\"x-api-key\": \"YOUR_API_KEY\"},\n json={\"scenario\": \"decline_aml_hit\", \"send_webhooks\": False},\n)\nresponse.raise_for_status()\nprint(response.json())" + } + ], + "x-didit-sdk": { + "resource": "sessions", + "method": "simulate", + "auth": "api_key", + "server": true + } + } + }, + "/v3/session/{sessionId}/sandbox/simulate/": { + "post": { + "summary": "Simulate a sandbox session's status from the client", + "description": "The same simulation as `POST /v3/session/{sessionId}/simulate/`, authenticated with the session's own `Session-Token` (returned in `session_token` by [Create Session](/sessions-api/create-session)) instead of your API key, so a test harness or the hosted flow can call it from the client. The body, the response and `send_webhooks` behave exactly as on that endpoint.\n\nA `Session-Token` of a live (non-sandbox) application, or one that does not match the `sessionId` in the path, returns `404`. See [Sandbox & Test Data](/integration/sandbox-testing).", + "operationId": "post_v3_session_sandbox_simulate", + "tags": [ + "Sessions" + ], + "security": [ + { + "SessionTokenAuth": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "sessionId", + "required": true, + "description": "UUID of the sandbox verification session. Must match the session encoded in the Session-Token used to authenticate.", "schema": { "type": "string", "format": "uuid", @@ -72665,6 +72916,717 @@ } } } + }, + "/v3/session/imports/providers/": { + "get": { + "summary": "List migration providers", + "description": "The 15 providers you can migrate verifications from: what each needs to connect, whether its API can list records, the permissions its key needs and its default status mapping.", + "operationId": "get_v3_session_imports_providers_list", + "x-didit-sdk": { + "resource": "sessions.imports", + "method": "list_providers", + "auth": "api_key", + "server": true + }, + "tags": [ + "Sessions" + ], + "responses": { + "200": { + "description": "Migration providers.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "providers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImportProvider" + } + }, + "mapping_targets": { + "type": "array", + "items": { + "type": "string" + } + }, + "skipped_statuses": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "403": { + "description": "Missing, invalid, or revoked API key, or the caller cannot import verifications for this application.", + "content": { + "application/json": { + "examples": { + "Forbidden": { + "value": { + "detail": "You do not have permission to perform this action." + } + } + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v3/session/imports/providers/check/": { + "post": { + "summary": "Check a provider key", + "description": "Read the provider with your key before creating a migration. Nothing is stored.", + "operationId": "post_v3_session_imports_providers_check", + "x-didit-sdk": { + "resource": "sessions.imports", + "method": "check_provider", + "auth": "api_key", + "server": true + }, + "tags": [ + "Sessions" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "sumsub", + "jumio", + "veriff", + "onfido", + "persona", + "metamap", + "socure", + "idnow", + "shufti", + "idenfy", + "ondato", + "trulioo", + "au10tix", + "complycube", + "other" + ], + "description": "Migration source, from `GET /v3/session/imports/providers/`. Required when `source` is `provider`." + }, + "credentials": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The provider's read-only key, with the field names `credential_fields` lists. Encrypted at rest, never returned, and erased when the import ends. Send it as a JSON string in multipart." + }, + "options": { + "type": "object", + "properties": { + "region": { + "type": "string", + "description": "The provider region, one of its `regions` (Onfido: `eu`, `us`, `ca`)." + } + } + }, + "record_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "For `api_ids` providers: the first record ID of your export." + } + }, + "required": [ + "provider", + "credentials" + ] + } + } + } + }, + "responses": { + "200": { + "description": "The key can read records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ok": { + "type": "boolean" + }, + "provider": { + "type": "string" + }, + "credential_hint": { + "type": "string", + "nullable": true + } + } + } + } + } + }, + "400": { + "description": "The provider refused the key: `code`, `detail`, `missing_permissions`, `suggested_region`." + }, + "403": { + "description": "Missing, invalid, or revoked API key, or the caller cannot import verifications for this application.", + "content": { + "application/json": { + "examples": { + "Forbidden": { + "value": { + "detail": "You do not have permission to perform this action." + } + } + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v3/session/imports/{importId}/start/": { + "post": { + "summary": "Start a dry run", + "description": "Start a migration whose dry run finished (`READY`): the same job imports for real, with the status mapping and face templates choice as sent now.", + "operationId": "post_v3_session_imports_start", + "x-didit-sdk": { + "resource": "sessions.imports", + "method": "start", + "auth": "api_key", + "server": true + }, + "tags": [ + "Sessions" + ], + "parameters": [ + { + "name": "importId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status_mapping": { + "type": "object", + "additionalProperties": { + "type": "string", + "enum": [ + "Approved", + "Declined", + "In Review", + "Expired", + "Not Finished", + "Abandoned" + ] + }, + "description": "Edits to the provider's default status mapping: source status to Didit status. `Not Finished` and `Abandoned` are skipped and counted, never imported." + }, + "face_templates": { + "type": "boolean", + "default": false, + "description": "Build face templates from the imported selfies and search them against the application's faces and blocklist. Matches are flagged for review only. Requires `lawful_basis_confirmed`." + }, + "lawful_basis_confirmed": { + "type": "boolean", + "default": false, + "description": "Confirms you have a lawful basis to share these selfies with Didit as processor." + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The import job.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionImportJob" + } + } + } + }, + "400": { + "description": "The job is not in a state this action applies to." + }, + "403": { + "description": "Missing, invalid, or revoked API key, or the caller cannot import verifications for this application.", + "content": { + "application/json": { + "examples": { + "Forbidden": { + "value": { + "detail": "You do not have permission to perform this action." + } + } + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v3/session/imports/{importId}/pause/": { + "post": { + "summary": "Pause an import job", + "description": "Pause a queued or running import.", + "operationId": "post_v3_session_imports_pause", + "x-didit-sdk": { + "resource": "sessions.imports", + "method": "pause", + "auth": "api_key", + "server": true + }, + "tags": [ + "Sessions" + ], + "parameters": [ + { + "name": "importId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "The import job.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionImportJob" + } + } + } + }, + "400": { + "description": "The job is not in a state this action applies to." + }, + "403": { + "description": "Missing, invalid, or revoked API key, or the caller cannot import verifications for this application.", + "content": { + "application/json": { + "examples": { + "Forbidden": { + "value": { + "detail": "You do not have permission to perform this action." + } + } + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v3/session/imports/{importId}/resume/": { + "post": { + "summary": "Resume an import job", + "description": "Resume an import you paused. A job paused by the provider's rate limit resumes by itself.", + "operationId": "post_v3_session_imports_resume", + "x-didit-sdk": { + "resource": "sessions.imports", + "method": "resume", + "auth": "api_key", + "server": true + }, + "tags": [ + "Sessions" + ], + "parameters": [ + { + "name": "importId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "The import job.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionImportJob" + } + } + } + }, + "400": { + "description": "The job is not in a state this action applies to." + }, + "403": { + "description": "Missing, invalid, or revoked API key, or the caller cannot import verifications for this application.", + "content": { + "application/json": { + "examples": { + "Forbidden": { + "value": { + "detail": "You do not have permission to perform this action." + } + } + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v3/session/imports/{importId}/cancel/": { + "post": { + "summary": "Cancel an import job", + "description": "Cancel an import. What was imported stays; the uploaded file and the key are erased.", + "operationId": "post_v3_session_imports_cancel", + "x-didit-sdk": { + "resource": "sessions.imports", + "method": "cancel", + "auth": "api_key", + "server": true + }, + "tags": [ + "Sessions" + ], + "parameters": [ + { + "name": "importId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "The import job.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionImportJob" + } + } + } + }, + "400": { + "description": "The job is not in a state this action applies to." + }, + "403": { + "description": "Missing, invalid, or revoked API key, or the caller cannot import verifications for this application.", + "content": { + "application/json": { + "examples": { + "Forbidden": { + "value": { + "detail": "You do not have permission to perform this action." + } + } + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v3/session/imports/{importId}/retry/": { + "post": { + "summary": "Retry a migration", + "description": "Run a migration that ended again as a new job, with a new key (the old one was erased). It keeps the provider, workflow, region, status mapping and face templates choice; everything already in Didit is skipped.", + "operationId": "post_v3_session_imports_retry", + "x-didit-sdk": { + "resource": "sessions.imports", + "method": "retry", + "auth": "api_key", + "server": true + }, + "tags": [ + "Sessions" + ], + "parameters": [ + { + "name": "importId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "required": false, + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "credentials": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The provider's read-only key, with the field names `credential_fields` lists. Encrypted at rest, never returned, and erased when the import ends. Send it as a JSON string in multipart." + }, + "file": { + "type": "string", + "format": "binary", + "description": "The record IDs or export file again, for `api_ids` and `export_file` providers." + } + } + } + } + } + }, + "responses": { + "201": { + "description": "The new import job.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SessionImportJob" + } + } + } + }, + "400": { + "description": "Not a migration, not ended, or the provider refused the key." + }, + "403": { + "description": "Missing, invalid, or revoked API key, or the caller cannot import verifications for this application.", + "content": { + "application/json": { + "examples": { + "Forbidden": { + "value": { + "detail": "You do not have permission to perform this action." + } + } + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v3/import-jobs/": { + "get": { + "summary": "List import jobs", + "description": "Every import of the application in one shape: verification imports and migrations, people and businesses.", + "operationId": "get_v3_import_jobs_list", + "x-didit-sdk": { + "resource": "sessions.imports", + "method": "list_jobs", + "auth": "api_key", + "server": true + }, + "tags": [ + "Sessions" + ], + "parameters": [ + { + "name": "scope", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "all", + "sessions", + "users", + "businesses" + ], + "default": "all" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 50 + } + } + ], + "responses": { + "200": { + "description": "Import jobs, newest first.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImportJobSummary" + } + }, + "counts": { + "type": "object", + "properties": { + "all": { + "type": "integer" + }, + "running_and_waiting": { + "type": "integer" + }, + "needs_attention": { + "type": "integer" + }, + "done": { + "type": "integer" + } + } + } + } + } + } + } + }, + "403": { + "description": "Missing, invalid, or revoked API key, or the caller cannot import verifications for this application.", + "content": { + "application/json": { + "examples": { + "Forbidden": { + "value": { + "detail": "You do not have permission to perform this action." + } + } + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } + }, + "/v3/import-jobs/active/": { + "get": { + "summary": "List active import jobs", + "description": "What is running or waiting, plus what just ended, for a progress indicator.", + "operationId": "get_v3_import_jobs_active", + "x-didit-sdk": { + "resource": "sessions.imports", + "method": "list_active_jobs", + "auth": "api_key", + "server": true + }, + "tags": [ + "Sessions" + ], + "responses": { + "200": { + "description": "Active import jobs.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ImportJobSummary" + } + }, + "running": { + "type": "integer" + } + } + } + } + } + }, + "403": { + "description": "Missing, invalid, or revoked API key, or the caller cannot import verifications for this application.", + "content": { + "application/json": { + "examples": { + "Forbidden": { + "value": { + "detail": "You do not have permission to perform this action." + } + } + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ] + } } }, "components": { @@ -72774,7 +73736,8 @@ "COMPLETED", "FAILED", "PAUSED", - "CANCELLED" + "CANCELLED", + "READY" ] }, "import_type": { @@ -72849,6 +73812,99 @@ "type": "string", "format": "date-time", "nullable": true + }, + "state": { + "type": "string", + "enum": [ + "ready", + "queued", + "running", + "paused", + "completed", + "errors", + "failed", + "cancelled" + ], + "description": "The job's state as the console shows it; `errors` is a completed job with rejected rows." + }, + "source": { + "type": "string", + "enum": [ + "file", + "api", + "provider" + ] + }, + "provider": { + "type": "string", + "description": "Migration source; empty for a file or API import." + }, + "provider_options": { + "type": "object" + }, + "credential_hint": { + "type": "string", + "description": "The first characters of the key the migration holds. The key itself is never returned." + }, + "credentials_expires_at": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "resumes_at": { + "type": "string", + "format": "date-time", + "nullable": true, + "description": "When a job paused by the provider's rate limit resumes by itself." + }, + "status_mapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "is_dry_run": { + "type": "boolean" + }, + "dry_run_summary": { + "type": "object", + "description": "What a dry run found: `total`, `by_status`, `already_in_didit`, `same_person`, `not_finished`, `failed`, `unmapped_statuses`." + }, + "face_templates_enabled": { + "type": "boolean" + }, + "lawful_basis_confirmed_at": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "not_finished_count": { + "type": "integer", + "format": "int64" + }, + "same_person_count": { + "type": "integer", + "format": "int64" + }, + "face_templates_count": { + "type": "integer", + "format": "int64" + }, + "face_duplicates_count": { + "type": "integer", + "format": "int64" + }, + "face_blocklist_hits_count": { + "type": "integer", + "format": "int64" + }, + "created_by_name": { + "type": "string", + "nullable": true + }, + "created_by_email": { + "type": "string", + "nullable": true } } }, @@ -92295,7 +93351,7 @@ "bank_verifications": { "type": "array", "nullable": true, - "description": "Bank Verification results, one item per Bank Verification step, for User and Business Verification. `null` until a step produces one. Each item's `method` says how the account was verified: `open_banking` (bank sign-in) or `account_lookup` (account check), or a `microdeposits` or `statement` fallback. See [Bank verification methods](/core-technology/bank-verification/verification-methods).", + "description": "Bank Verification results, one item per Bank Verification step, for User and Business Verification. `null` until a step produces one. Each item's `method` says how the account was verified: `open_banking` (bank sign-in) or `account_lookup` (account check), or a `statement` or `microdeposits` fallback, and `none` when the person continued without a bank before any attempt was evaluated (`continued_without_bank`). See [Bank verification methods](/core-technology/bank-verification/verification-methods).", "items": { "$ref": "#/components/schemas/BankVerificationResult" } @@ -94735,6 +95791,26 @@ "updated_at": { "type": "string", "format": "date-time" + }, + "is_bank_verification_enabled": { + "type": "boolean", + "description": "Whether a simple KYC or KYB workflow runs Bank verification. It runs after the contact steps and before database validation, AML and IP analysis. Set in the console." + }, + "bank_verification_config": { + "type": "object", + "additionalProperties": true, + "description": "Bank verification settings of a simple workflow, with the same keys a `BANK_VERIFICATION` node takes (for example `bank_countries` and `bank_method_order`). Every key is optional and an absent key keeps its default, so `{}` means all defaults. See [Bank verification settings](/management-api/workflows/feature-configs#bank-verification).", + "example": {} + }, + "is_geolocation_enabled": { + "type": "boolean", + "description": "Whether a simple KYC workflow runs Location verification. It runs after the contact steps and before Bank verification. Never on KYB workflows. Set in the console." + }, + "geolocation_config": { + "type": "object", + "additionalProperties": true, + "description": "Location verification settings of a simple workflow, with the same keys a `GEOLOCATION` node takes (for example `is_geolocation_geofencing_enabled` and `geolocation_max_attempts`). Every key is optional and an absent key keeps its default, so `{}` means all defaults.", + "example": {} } }, "additionalProperties": true @@ -104141,7 +105217,7 @@ }, "BankVerificationResult": { "type": "object", - "description": "One Bank Verification step's result, for User and Business Verification. `method` says how the account was verified. See [Bank verification methods](/core-technology/bank-verification/verification-methods).", + "description": "One Bank Verification step's result, for User and Business Verification. `method` says how the account was verified, and `none` that the person continued without a bank before any attempt was evaluated. `continued_without_bank` says the person continued without a bank, also after an evaluated attempt. See [Bank verification methods](/core-technology/bank-verification/verification-methods) and [When the person cannot verify their bank](/core-technology/bank-verification/fallbacks).", "properties": { "schema_version": { "type": "integer", @@ -104179,9 +105255,10 @@ "open_banking", "account_lookup", "microdeposits", - "statement" + "statement", + "none" ], - "description": "How the account was verified: `open_banking` (bank sign-in: the person signed in at their bank), `account_lookup` (account check: the person typed the account details and the bank confirmed the name), `microdeposits` or `statement` (a statement upload). `null` until an account is evaluated. Workflow rules read the same value as `bank.method`." + "description": "How the account was verified: `open_banking` (bank sign-in: the person signed in at their bank), `account_lookup` (account check: the person typed the account details and the bank confirmed the name), `microdeposits` or `statement` (a statement upload). `none` when the person continued without a bank before any attempt was evaluated, so no account was verified. After an evaluated attempt, it stays the method of that attempt. `null` until an account is evaluated, and when the workflow narrows the data it returns. Workflow rules read the same value as `bank.method`." }, "provider": { "type": "string", @@ -104552,7 +105629,7 @@ "usage_type": { "type": "string", "nullable": true, - "description": "The usage line the charge was booked on." + "description": "The usage line the charge was booked on: `bank_verification` for a bank sign-in or an account check, `bank_statement_upload` for a statement upload with no charged bank attempt before it, and `bank_byok_fee` for the marketplace fee on your own provider. `null` when nothing was billed." } } }, @@ -104574,7 +105651,61 @@ "not_covered": { "type": "boolean", "nullable": true, - "description": "Whether the person's bank or country could not be reached on this step." + "description": "Whether the person's bank or country could not be reached on this step. Also `true` when the person continued without a bank because no method could verify their country or bank." + }, + "continued_without_bank": { + "type": "boolean", + "description": "Whether the person left the step with **Continue without your bank**. `continuation` then says why. `method` is `none` when no attempt was evaluated before they continued. After an evaluated attempt, such as a holder that does not match, `method` stays the method of that attempt and its verdict and reason codes stand. Returned even when the workflow narrows the data it returns." + }, + "continuation": { + "type": "object", + "nullable": true, + "description": "How the person continued without a bank. `null` when they did not. When the workflow narrows the data it returns, `reason` is still returned and every other key is `null`.", + "properties": { + "reason": { + "type": "string", + "enum": [ + "no_route", + "institution_unsupported", + "attempts_exhausted", + "person_choice" + ], + "description": "Why, as Didit worked it out when the person continued: `no_route` (no bank sign-in or account check serves their country), `institution_unsupported` (the bank they picked cannot be used on this step), `attempts_exhausted` (every attempt was already spent and none was in progress), or `person_choice` (a way to verify was there and they chose to continue, also when their bank could not be reached right now). `no_route` and `institution_unsupported` follow `bank_unsupported_action`, `attempts_exhausted` follows `bank_attempts_exhausted_action`, and `person_choice` follows `bank_skipped_action`, unless an evaluated attempt already decided the step." + }, + "country": { + "type": "string", + "nullable": true, + "description": "The country the person was verifying in, ISO 3166-1 alpha-3. `null` when they continued before picking one." + }, + "offered": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "statement", + "microdeposits" + ] + }, + "nullable": true, + "description": "The other ways to verify that country offered the person when they continued, in the order it offered them: `statement` (a statement upload), then `microdeposits`. Empty when it offered none." + }, + "institution_id": { + "type": "string", + "nullable": true, + "description": "For `institution_unsupported`, the ID of the bank the person could not use: the bank they picked, or the bank their last attempt ended on. Didit takes it from its own list of banks, never from the person's device, so a bank that list does not have is `null`. `null` for every other reason." + }, + "institution_name": { + "type": "string", + "nullable": true, + "description": "For `institution_unsupported`, the name of that bank, from the same list as `institution_id`. `null` when that list does not have the bank, and for every other reason." + }, + "continued_at": { + "type": "string", + "format": "date-time", + "nullable": true, + "description": "When the person continued." + } + } }, "evidence_purged_at": { "type": "string", @@ -104594,7 +105725,7 @@ "items": { "type": "string" }, - "description": "Why the verdict came out the way it did, for example `OWNER_NAME_PARTIAL`. Several may apply." + "description": "Why the verdict came out the way it did, for example `OWNER_NAME_PARTIAL`. Several may apply. `NOT_COVERED`: the person continued without a bank because no method could verify their country or bank. `SKIPPED`: the person chose to continue without a bank while a way to verify was there. Neither is added when an evaluated attempt already decided the step." }, "created_at": { "type": "string", @@ -104634,6 +105765,416 @@ "description": "The name of the company that should hold the account. Checks a business account." } } + }, + "BankVerificationPricing": { + "type": "object", + "description": "Public Bank Verification list prices: the statement upload, the own provider key fee and each country's methods.", + "required": [ + "currency", + "statement_upload", + "own_provider_fee_usd", + "countries" + ], + "properties": { + "currency": { + "type": "string", + "enum": [ + "USD" + ], + "description": "Currency of every price in the response.", + "example": "USD" + }, + "statement_upload": { + "$ref": "#/components/schemas/BankStatementUploadPricing" + }, + "own_provider_fee_usd": { + "type": "string", + "description": "Fee for each billable ownership check on a route that uses your own provider contract instead of Didit's, charged whatever the result. A cancelled, timed out or abandoned connection is not billed. Decimal string with 4 decimals, in USD.", + "example": "0.0200" + }, + "countries": { + "type": "object", + "description": "Every country, keyed by ISO 3166-1 alpha-3 code.", + "additionalProperties": { + "$ref": "#/components/schemas/BankVerificationPricingCountry" + } + } + } + }, + "BankStatementUploadPricing": { + "type": "object", + "description": "How the bank statement upload is priced.", + "required": [ + "price_usd", + "included_after_charged_bank_attempt", + "standalone_available" + ], + "properties": { + "price_usd": { + "type": "string", + "description": "Price of a statement upload after a charged bank attempt. Decimal string with 4 decimals, in USD.", + "example": "0.0000" + }, + "included_after_charged_bank_attempt": { + "type": "boolean", + "description": "`true` when the upload is included at no extra charge after a charged bank attempt in the same session.", + "example": true + }, + "standalone_available": { + "type": "boolean", + "description": "`true` when a statement upload can run on its own, with no bank attempt first. `false` in production; sandbox sessions can test it without billing.", + "example": false + } + } + }, + "BankVerificationPricingCountry": { + "type": "object", + "description": "One country's Bank Verification methods and their list prices.", + "required": [ + "name", + "methods" + ], + "properties": { + "name": { + "type": "string", + "description": "Country name in English.", + "example": "United Kingdom" + }, + "methods": { + "$ref": "#/components/schemas/BankVerificationPricingMethods" + } + } + }, + "BankVerificationPricingMethods": { + "type": "object", + "description": "The two Bank Verification methods in a country.", + "required": [ + "open_banking", + "account_lookup" + ], + "properties": { + "open_banking": { + "$ref": "#/components/schemas/BankSignInPricing" + }, + "account_lookup": { + "$ref": "#/components/schemas/BankAccountCheckPricing" + } + } + }, + "BankSignInPricing": { + "type": "object", + "description": "Bank sign-in: the person signs in to their bank. Priced by market, the same for every bank in it.", + "required": [ + "available", + "market", + "price_usd", + "add_ons" + ], + "properties": { + "available": { + "type": "boolean", + "description": "`true` only where Didit serves bank sign-in in this country in production.", + "example": true + }, + "market": { + "type": "string", + "nullable": true, + "description": "The market whose price applies. `null` when not available.", + "example": "UK and EEA" + }, + "price_usd": { + "type": "string", + "nullable": true, + "description": "List price of one bank sign-in. `null` when not available. Decimal string with 4 decimals, in USD.", + "example": "0.7900" + }, + "add_ons": { + "type": "object", + "description": "Add-ons priced in this country, each a decimal string with 4 decimals in USD, added to the bank sign-in price. Only the add-ons the country offers are listed; empty when bank sign-in is not available.", + "properties": { + "balance": { + "type": "string", + "description": "Account balance add-on.", + "example": "0.3500" + }, + "transactions": { + "type": "string", + "description": "Transactions add-on.", + "example": "1.3000" + } + } + } + } + }, + "BankAccountCheckPricing": { + "type": "object", + "description": "Account check: the person types their account number and Didit checks it with the bank. Priced per country.", + "required": [ + "available", + "price_usd" + ], + "properties": { + "available": { + "type": "boolean", + "description": "`true` only where Didit serves the account check in this country in production.", + "example": true + }, + "price_usd": { + "type": "string", + "nullable": true, + "description": "List price of one account check the bank answers. `null` when not available. Decimal string with 4 decimals, in USD.", + "example": "0.4000" + } + } + }, + "ImportProvider": { + "type": "object", + "properties": { + "key": { + "type": "string", + "enum": [ + "sumsub", + "jumio", + "veriff", + "onfido", + "persona", + "metamap", + "socure", + "idnow", + "shufti", + "idenfy", + "ondato", + "trulioo", + "au10tix", + "complycube", + "other" + ] + }, + "name": { + "type": "string" + }, + "mode": { + "type": "string", + "enum": [ + "api_list", + "api_ids", + "export_file" + ], + "description": "`api_list`: Didit lists records with the key. `api_ids`: upload the record IDs from an export. `export_file`: upload an export in Didit's format." + }, + "record_noun": { + "type": "string" + }, + "credential_fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "secret": { + "type": "boolean" + } + } + } + }, + "regions": { + "type": "array", + "items": { + "type": "string" + } + }, + "required_permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "docs_url": { + "type": "string", + "nullable": true + }, + "status_mapping": { + "type": "object", + "additionalProperties": { + "type": "string", + "enum": [ + "Approved", + "Declined", + "In Review", + "Expired", + "Not Finished", + "Abandoned" + ] + } + } + } + }, + "ImportJobSummary": { + "type": "object", + "description": "One import job of any kind, in the shape the console's Import jobs drawer reads.", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "kind": { + "type": "string", + "enum": [ + "sessions", + "businesses", + "users", + "status_rules", + "transactions" + ] + }, + "source": { + "type": "string", + "enum": [ + "file", + "api", + "provider" + ] + }, + "provider": { + "type": "string", + "nullable": true + }, + "provider_name": { + "type": "string", + "nullable": true + }, + "filename": { + "type": "string", + "nullable": true + }, + "state": { + "type": "string", + "enum": [ + "ready", + "queued", + "running", + "paused", + "completed", + "errors", + "failed", + "cancelled" + ], + "description": "The job's state as the console shows it; `errors` is a completed job with rejected rows." + }, + "status": { + "type": "string" + }, + "is_dry_run": { + "type": "boolean" + }, + "credential_hint": { + "type": "string", + "nullable": true + }, + "resumes_at": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "last_error": { + "type": "string", + "nullable": true + }, + "started_by": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "email": { + "type": "string", + "nullable": true + } + } + }, + "progress": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "processed": { + "type": "integer", + "format": "int64" + }, + "imported": { + "type": "integer", + "format": "int64" + }, + "updated": { + "type": "integer", + "format": "int64" + }, + "already_in_didit": { + "type": "integer", + "format": "int64" + }, + "failed": { + "type": "integer", + "format": "int64" + }, + "not_finished": { + "type": "integer", + "format": "int64" + }, + "same_person": { + "type": "integer", + "format": "int64" + } + } + }, + "face_templates": { + "type": "object", + "nullable": true, + "properties": { + "enabled": { + "type": "boolean" + }, + "built": { + "type": "integer", + "format": "int64" + }, + "duplicates": { + "type": "integer", + "format": "int64" + }, + "blocklisted": { + "type": "integer", + "format": "int64" + } + } + }, + "eta_seconds": { + "type": "integer", + "nullable": true + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "started_at": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "completed_at": { + "type": "string", + "format": "date-time", + "nullable": true + } + } } }, "securitySchemes": { diff --git a/src/main/java/me/didit/resources/DiditResources.java b/src/main/java/me/didit/resources/DiditResources.java index 39e4607..4353d23 100644 --- a/src/main/java/me/didit/resources/DiditResources.java +++ b/src/main/java/me/didit/resources/DiditResources.java @@ -37,6 +37,7 @@ public abstract class DiditResources { private final NetworksResource networks; private final PassiveLivenessResource passiveLiveness; private final PhoneResource phone; + private final PricingResource pricing; private final ProofOfAddressResource proofOfAddress; private final QuestionnairesResource questionnaires; private final RegulatoryReportsResource regulatoryReports; @@ -84,6 +85,7 @@ protected DiditResources(ApiClient client) { this.networks = new NetworksResource(client); this.passiveLiveness = new PassiveLivenessResource(client); this.phone = new PhoneResource(client); + this.pricing = new PricingResource(client); this.proofOfAddress = new ProofOfAddressResource(client); this.questionnaires = new QuestionnairesResource(client); this.regulatoryReports = new RegulatoryReportsResource(client); @@ -358,6 +360,15 @@ public final PhoneResource phone() { return phone; } + /** + * The {@code pricing} resource. + * + * @return the resource + */ + public final PricingResource pricing() { + return pricing; + } + /** * The {@code proof_of_address} resource. * diff --git a/src/main/java/me/didit/resources/PricingResource.java b/src/main/java/me/didit/resources/PricingResource.java new file mode 100644 index 0000000..ba326f8 --- /dev/null +++ b/src/main/java/me/didit/resources/PricingResource.java @@ -0,0 +1,135 @@ +// 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.BankVerificationPricing; + +/** The {@code pricing} resource: {@code client.pricing()}. */ +public final class PricingResource { + private final ApiClient client; + private final WithRawResponse withRawResponse; + + PricingResource(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 bank verification prices (public, unauthenticated) + * + *

Returns the list price of each Bank Verification method in every country: bank sign-in with its balance and transactions add-ons, and the account check. Use it to quote a bank step before you build a workflow, or to show bank prices in your own product. + * + *

Public: send no auth header. The response contains no organization data and is the same for every caller. It is cached publicly for one hour and carries an ETag, so send If-None-Match to get a 304 Not Modified when nothing changed. + * + *

A method is available only where Didit serves it in production today, and its price_usd is null everywhere else, so the feed never shows a price you cannot buy. available: false covers a country with no approved price, a method the country does not support, and a route that is not switched on yet. + * + *

These are list prices before your plan discount. Your plan discount applies to the whole bank price, and a negotiated or contract price replaces the list price for your organization. + * + *

{@code GET /v3/organization/bank-verification-pricing/} + * + * @param options per-request options that override the client options + * @return the response body + */ + public BankVerificationPricing bankVerification(RequestOptions options) { + return client.execute(bankVerificationRequest(), options, BANK_VERIFICATION_RESPONSE).data(); + } + + /** + * Asynchronous {@link #bankVerification(RequestOptions)}. + * + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture bankVerificationAsync(RequestOptions options) { + return client.executeAsync(bankVerificationRequest(), options, BANK_VERIFICATION_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #bankVerification(RequestOptions)}, with the client's options. + * + * @return the result + */ + public BankVerificationPricing bankVerification() { + return client.execute(bankVerificationRequest(), RequestOptions.none(), BANK_VERIFICATION_RESPONSE).data(); + } + + /** + * Asynchronous {@link #bankVerification(RequestOptions)}, with the client's options. + * + * @return a future completed with the result + */ + public CompletableFuture bankVerificationAsync() { + return client.executeAsync(bankVerificationRequest(), RequestOptions.none(), BANK_VERIFICATION_RESPONSE).thenApply(RawResponse::data); + } + + private static final ResponseHandler BANK_VERIFICATION_RESPONSE = Responses.json(Conv.model(BankVerificationPricing::fromJson)); + + private static ApiRequest bankVerificationRequest() { + return ApiRequest.builder("GET", "/v3/organization/bank-verification-pricing/") + .auth(ApiRequest.Auth.NONE) + .build(); + } + + /** The {@code pricing} operations returning {@link RawResponse}. */ + public static final class WithRawResponse { + private final ApiClient client; + + WithRawResponse(ApiClient client) { + this.client = client; + } + + /** + * {@link #bankVerification(RequestOptions)} with the raw response. + * + * @param options per-request options + * @return the result + */ + public RawResponse bankVerification(RequestOptions options) { + return client.execute(bankVerificationRequest(), options, BANK_VERIFICATION_RESPONSE); + } + + /** + * Asynchronous {@link #bankVerification(RequestOptions)} with the raw response. + * + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> bankVerificationAsync(RequestOptions options) { + return client.executeAsync(bankVerificationRequest(), options, BANK_VERIFICATION_RESPONSE); + } + + /** + * {@link #bankVerification(RequestOptions)} with the raw response, with the client's options. + * + * @return the result + */ + public RawResponse bankVerification() { + return client.execute(bankVerificationRequest(), RequestOptions.none(), BANK_VERIFICATION_RESPONSE); + } + + /** + * Asynchronous {@link #bankVerification(RequestOptions)} with the raw response, with the client's options. + * + * @return a future completed with the result + */ + public CompletableFuture> bankVerificationAsync() { + return client.executeAsync(bankVerificationRequest(), RequestOptions.none(), BANK_VERIFICATION_RESPONSE); + } + } +} diff --git a/src/main/java/me/didit/resources/SessionsImportsResource.java b/src/main/java/me/didit/resources/SessionsImportsResource.java index b48f946..40d94c7 100644 --- a/src/main/java/me/didit/resources/SessionsImportsResource.java +++ b/src/main/java/me/didit/resources/SessionsImportsResource.java @@ -13,9 +13,17 @@ import me.didit.core.Responses; import me.didit.types.SessionImportError; import me.didit.types.SessionImportJob; +import me.didit.types.SessionsImportsCheckProviderParams; +import me.didit.types.SessionsImportsCheckProviderResponse; import me.didit.types.SessionsImportsCreateParams; +import me.didit.types.SessionsImportsListActiveJobsResponse; import me.didit.types.SessionsImportsListErrorsParams; +import me.didit.types.SessionsImportsListJobsParams; +import me.didit.types.SessionsImportsListJobsResponse; +import me.didit.types.SessionsImportsListProvidersResponse; import me.didit.types.SessionsImportsRetrieveTemplateParams; +import me.didit.types.SessionsImportsRetryParams; +import me.didit.types.SessionsImportsStartParams; /** The {@code sessions.imports} resource: {@code client.sessions().imports()}. */ public final class SessionsImportsResource { @@ -39,7 +47,7 @@ public WithRawResponse withRawResponse() { /** * Create a verification import job * - *

Create an asynchronous import job for historical User Verification sessions, Business Verification sessions, transaction monitoring records, or workflow custom status rules. Use this to migrate from providers such as Sumsub, MetaMap, Veriff, Onfido, Persona, Trulioo, Jumio, Incode, iDenfy, or any other provider after transforming the export into Didit's canonical CSV/NDJSON format. Imports are disabled by default and must be enabled per organization by Didit. + *

Create an asynchronous import job for historical User Verification sessions, Business Verification sessions, transaction monitoring records, or workflow custom status rules. Set source=provider to migrate from another provider: Didit reads Sumsub, Onfido, Persona and ComplyCube with your read-only key, reads Veriff, iDenfy and MetaMap records by the IDs you upload in file, and imports an export file in Didit's format for the other providers. Record IDs are namespaced by provider (sumsub:<id>) so a re-run skips everything already in Didit. Imports are disabled by default and must be enabled per organization by Didit. * *

{@code POST /v3/session/imports/} * @@ -344,339 +352,1451 @@ public CompletableFuture> listErrorsAsync(String import return client.executeAsync(listErrorsRequest(importId, SessionsImportsListErrorsParams.builder().build()), RequestOptions.none(), LIST_ERRORS_RESPONSE).thenApply(RawResponse::data); } - private static final ResponseHandler CREATE_RESPONSE = Responses.json(Conv.model(SessionImportJob::fromJson)); + /** + * List migration providers + * + *

The 15 providers you can migrate verifications from: what each needs to connect, whether its API can list records, the permissions its key needs and its default status mapping. + * + *

{@code GET /v3/session/imports/providers/} + * + * @param options per-request options that override the client options + * @return the response body + */ + public SessionsImportsListProvidersResponse listProviders(RequestOptions options) { + return client.execute(listProvidersRequest(), options, LIST_PROVIDERS_RESPONSE).data(); + } - private static ApiRequest createRequest(SessionsImportsCreateParams params) { - return ApiRequest.builder("POST", "/v3/session/imports/") - .params(params) - .body(ApiRequest.BodyEncoding.JSON_OR_MULTIPART) - .build(); + /** + * Asynchronous {@link #listProviders(RequestOptions)}. + * + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture listProvidersAsync(RequestOptions options) { + return client.executeAsync(listProvidersRequest(), options, LIST_PROVIDERS_RESPONSE).thenApply(RawResponse::data); } - private static final ResponseHandler RETRIEVE_TEMPLATE_RESPONSE = Responses.binary(); + /** + * Same as {@link #listProviders(RequestOptions)}, with the client's options. + * + * @return the result + */ + public SessionsImportsListProvidersResponse listProviders() { + return client.execute(listProvidersRequest(), RequestOptions.none(), LIST_PROVIDERS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #listProviders(RequestOptions)}, with the client's options. + * + * @return a future completed with the result + */ + public CompletableFuture listProvidersAsync() { + return client.executeAsync(listProvidersRequest(), RequestOptions.none(), LIST_PROVIDERS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Check a provider key + * + *

Read the provider with your key before creating a migration. Nothing is stored. + * + *

{@code POST /v3/session/imports/providers/check/} + * + * @param params the request parameters + * @param options per-request options that override the client options + * @return the response body + */ + public SessionsImportsCheckProviderResponse checkProvider(SessionsImportsCheckProviderParams params, RequestOptions options) { + return client.execute(checkProviderRequest(params), options, CHECK_PROVIDER_RESPONSE).data(); + } + + /** + * Asynchronous {@link #checkProvider(SessionsImportsCheckProviderParams, RequestOptions)}. + * + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture checkProviderAsync(SessionsImportsCheckProviderParams params, RequestOptions options) { + return client.executeAsync(checkProviderRequest(params), options, CHECK_PROVIDER_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #checkProvider(SessionsImportsCheckProviderParams, RequestOptions)}, with the client's options. + * + * @param params the request parameters + * @return the result + */ + public SessionsImportsCheckProviderResponse checkProvider(SessionsImportsCheckProviderParams params) { + return client.execute(checkProviderRequest(params), RequestOptions.none(), CHECK_PROVIDER_RESPONSE).data(); + } + + /** + * Asynchronous {@link #checkProvider(SessionsImportsCheckProviderParams, RequestOptions)}, with the client's options. + * + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture checkProviderAsync(SessionsImportsCheckProviderParams params) { + return client.executeAsync(checkProviderRequest(params), RequestOptions.none(), CHECK_PROVIDER_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Start a dry run + * + *

Start a migration whose dry run finished (READY): the same job imports for real, with the status mapping and face templates choice as sent now. + * + *

{@code POST /v3/session/imports/{importId}/start/} + * + * @param importId the {@code importId} + * @param params the request parameters + * @param options per-request options that override the client options + * @return the response body + */ + public SessionImportJob start(String importId, SessionsImportsStartParams params, RequestOptions options) { + return client.execute(startRequest(importId, params), options, START_RESPONSE).data(); + } + + /** + * Asynchronous {@link #start(String, SessionsImportsStartParams, RequestOptions)}. + * + * @param importId the {@code importId} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture startAsync(String importId, SessionsImportsStartParams params, RequestOptions options) { + return client.executeAsync(startRequest(importId, params), options, START_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #start(String, SessionsImportsStartParams, RequestOptions)}, with the client's options. + * + * @param importId the {@code importId} + * @param params the request parameters + * @return the result + */ + public SessionImportJob start(String importId, SessionsImportsStartParams params) { + return client.execute(startRequest(importId, params), RequestOptions.none(), START_RESPONSE).data(); + } + + /** + * Asynchronous {@link #start(String, SessionsImportsStartParams, RequestOptions)}, with the client's options. + * + * @param importId the {@code importId} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture startAsync(String importId, SessionsImportsStartParams params) { + return client.executeAsync(startRequest(importId, params), RequestOptions.none(), START_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #start(String, SessionsImportsStartParams, RequestOptions)}, without parameters. + * + * @param importId the {@code importId} + * @param options per-request options + * @return the result + */ + public SessionImportJob start(String importId, RequestOptions options) { + return client.execute(startRequest(importId, SessionsImportsStartParams.builder().build()), options, START_RESPONSE).data(); + } + + /** + * Asynchronous {@link #start(String, SessionsImportsStartParams, RequestOptions)}, without parameters. + * + * @param importId the {@code importId} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture startAsync(String importId, RequestOptions options) { + return client.executeAsync(startRequest(importId, SessionsImportsStartParams.builder().build()), options, START_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #start(String, SessionsImportsStartParams, RequestOptions)}, without parameters, with the client's options. + * + * @param importId the {@code importId} + * @return the result + */ + public SessionImportJob start(String importId) { + return client.execute(startRequest(importId, SessionsImportsStartParams.builder().build()), RequestOptions.none(), START_RESPONSE).data(); + } + + /** + * Asynchronous {@link #start(String, SessionsImportsStartParams, RequestOptions)}, without parameters, with the client's options. + * + * @param importId the {@code importId} + * @return a future completed with the result + */ + public CompletableFuture startAsync(String importId) { + return client.executeAsync(startRequest(importId, SessionsImportsStartParams.builder().build()), RequestOptions.none(), START_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Pause an import job + * + *

Pause a queued or running import. + * + *

{@code POST /v3/session/imports/{importId}/pause/} + * + * @param importId the {@code importId} + * @param options per-request options that override the client options + * @return the response body + */ + public SessionImportJob pause(String importId, RequestOptions options) { + return client.execute(pauseRequest(importId), options, PAUSE_RESPONSE).data(); + } + + /** + * Asynchronous {@link #pause(String, RequestOptions)}. + * + * @param importId the {@code importId} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture pauseAsync(String importId, RequestOptions options) { + return client.executeAsync(pauseRequest(importId), options, PAUSE_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #pause(String, RequestOptions)}, with the client's options. + * + * @param importId the {@code importId} + * @return the result + */ + public SessionImportJob pause(String importId) { + return client.execute(pauseRequest(importId), RequestOptions.none(), PAUSE_RESPONSE).data(); + } + + /** + * Asynchronous {@link #pause(String, RequestOptions)}, with the client's options. + * + * @param importId the {@code importId} + * @return a future completed with the result + */ + public CompletableFuture pauseAsync(String importId) { + return client.executeAsync(pauseRequest(importId), RequestOptions.none(), PAUSE_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Resume an import job + * + *

Resume an import you paused. A job paused by the provider's rate limit resumes by itself. + * + *

{@code POST /v3/session/imports/{importId}/resume/} + * + * @param importId the {@code importId} + * @param options per-request options that override the client options + * @return the response body + */ + public SessionImportJob resume(String importId, RequestOptions options) { + return client.execute(resumeRequest(importId), options, RESUME_RESPONSE).data(); + } + + /** + * Asynchronous {@link #resume(String, RequestOptions)}. + * + * @param importId the {@code importId} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture resumeAsync(String importId, RequestOptions options) { + return client.executeAsync(resumeRequest(importId), options, RESUME_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #resume(String, RequestOptions)}, with the client's options. + * + * @param importId the {@code importId} + * @return the result + */ + public SessionImportJob resume(String importId) { + return client.execute(resumeRequest(importId), RequestOptions.none(), RESUME_RESPONSE).data(); + } + + /** + * Asynchronous {@link #resume(String, RequestOptions)}, with the client's options. + * + * @param importId the {@code importId} + * @return a future completed with the result + */ + public CompletableFuture resumeAsync(String importId) { + return client.executeAsync(resumeRequest(importId), RequestOptions.none(), RESUME_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Cancel an import job + * + *

Cancel an import. What was imported stays; the uploaded file and the key are erased. + * + *

{@code POST /v3/session/imports/{importId}/cancel/} + * + * @param importId the {@code importId} + * @param options per-request options that override the client options + * @return the response body + */ + public SessionImportJob cancel(String importId, RequestOptions options) { + return client.execute(cancelRequest(importId), options, CANCEL_RESPONSE).data(); + } + + /** + * Asynchronous {@link #cancel(String, RequestOptions)}. + * + * @param importId the {@code importId} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture cancelAsync(String importId, RequestOptions options) { + return client.executeAsync(cancelRequest(importId), options, CANCEL_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #cancel(String, RequestOptions)}, with the client's options. + * + * @param importId the {@code importId} + * @return the result + */ + public SessionImportJob cancel(String importId) { + return client.execute(cancelRequest(importId), RequestOptions.none(), CANCEL_RESPONSE).data(); + } + + /** + * Asynchronous {@link #cancel(String, RequestOptions)}, with the client's options. + * + * @param importId the {@code importId} + * @return a future completed with the result + */ + public CompletableFuture cancelAsync(String importId) { + return client.executeAsync(cancelRequest(importId), RequestOptions.none(), CANCEL_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Retry a migration + * + *

Run a migration that ended again as a new job, with a new key (the old one was erased). It keeps the provider, workflow, region, status mapping and face templates choice; everything already in Didit is skipped. + * + *

{@code POST /v3/session/imports/{importId}/retry/} + * + * @param importId the {@code importId} + * @param params the request parameters + * @param options per-request options that override the client options + * @return the response body + */ + public SessionImportJob retry(String importId, SessionsImportsRetryParams params, RequestOptions options) { + return client.execute(retryRequest(importId, params), options, RETRY_RESPONSE).data(); + } + + /** + * Asynchronous {@link #retry(String, SessionsImportsRetryParams, RequestOptions)}. + * + * @param importId the {@code importId} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture retryAsync(String importId, SessionsImportsRetryParams params, RequestOptions options) { + return client.executeAsync(retryRequest(importId, params), options, RETRY_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #retry(String, SessionsImportsRetryParams, RequestOptions)}, with the client's options. + * + * @param importId the {@code importId} + * @param params the request parameters + * @return the result + */ + public SessionImportJob retry(String importId, SessionsImportsRetryParams params) { + return client.execute(retryRequest(importId, params), RequestOptions.none(), RETRY_RESPONSE).data(); + } + + /** + * Asynchronous {@link #retry(String, SessionsImportsRetryParams, RequestOptions)}, with the client's options. + * + * @param importId the {@code importId} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture retryAsync(String importId, SessionsImportsRetryParams params) { + return client.executeAsync(retryRequest(importId, params), RequestOptions.none(), RETRY_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #retry(String, SessionsImportsRetryParams, RequestOptions)}, without parameters. + * + * @param importId the {@code importId} + * @param options per-request options + * @return the result + */ + public SessionImportJob retry(String importId, RequestOptions options) { + return client.execute(retryRequest(importId, SessionsImportsRetryParams.builder().build()), options, RETRY_RESPONSE).data(); + } + + /** + * Asynchronous {@link #retry(String, SessionsImportsRetryParams, RequestOptions)}, without parameters. + * + * @param importId the {@code importId} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture retryAsync(String importId, RequestOptions options) { + return client.executeAsync(retryRequest(importId, SessionsImportsRetryParams.builder().build()), options, RETRY_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #retry(String, SessionsImportsRetryParams, RequestOptions)}, without parameters, with the client's options. + * + * @param importId the {@code importId} + * @return the result + */ + public SessionImportJob retry(String importId) { + return client.execute(retryRequest(importId, SessionsImportsRetryParams.builder().build()), RequestOptions.none(), RETRY_RESPONSE).data(); + } + + /** + * Asynchronous {@link #retry(String, SessionsImportsRetryParams, RequestOptions)}, without parameters, with the client's options. + * + * @param importId the {@code importId} + * @return a future completed with the result + */ + public CompletableFuture retryAsync(String importId) { + return client.executeAsync(retryRequest(importId, SessionsImportsRetryParams.builder().build()), RequestOptions.none(), RETRY_RESPONSE).thenApply(RawResponse::data); + } + + /** + * List import jobs + * + *

Every import of the application in one shape: verification imports and migrations, people and businesses. + * + *

{@code GET /v3/import-jobs/} + * + * @param params the request parameters + * @param options per-request options that override the client options + * @return the response body + */ + public SessionsImportsListJobsResponse listJobs(SessionsImportsListJobsParams params, RequestOptions options) { + return client.execute(listJobsRequest(params), options, LIST_JOBS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #listJobs(SessionsImportsListJobsParams, RequestOptions)}. + * + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture listJobsAsync(SessionsImportsListJobsParams params, RequestOptions options) { + return client.executeAsync(listJobsRequest(params), options, LIST_JOBS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #listJobs(SessionsImportsListJobsParams, RequestOptions)}, with the client's options. + * + * @param params the request parameters + * @return the result + */ + public SessionsImportsListJobsResponse listJobs(SessionsImportsListJobsParams params) { + return client.execute(listJobsRequest(params), RequestOptions.none(), LIST_JOBS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #listJobs(SessionsImportsListJobsParams, RequestOptions)}, with the client's options. + * + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture listJobsAsync(SessionsImportsListJobsParams params) { + return client.executeAsync(listJobsRequest(params), RequestOptions.none(), LIST_JOBS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #listJobs(SessionsImportsListJobsParams, RequestOptions)}, without parameters. + * + * @param options per-request options + * @return the result + */ + public SessionsImportsListJobsResponse listJobs(RequestOptions options) { + return client.execute(listJobsRequest(SessionsImportsListJobsParams.builder().build()), options, LIST_JOBS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #listJobs(SessionsImportsListJobsParams, RequestOptions)}, without parameters. + * + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture listJobsAsync(RequestOptions options) { + return client.executeAsync(listJobsRequest(SessionsImportsListJobsParams.builder().build()), options, LIST_JOBS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #listJobs(SessionsImportsListJobsParams, RequestOptions)}, without parameters, with the client's options. + * + * @return the result + */ + public SessionsImportsListJobsResponse listJobs() { + return client.execute(listJobsRequest(SessionsImportsListJobsParams.builder().build()), RequestOptions.none(), LIST_JOBS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #listJobs(SessionsImportsListJobsParams, RequestOptions)}, without parameters, with the client's options. + * + * @return a future completed with the result + */ + public CompletableFuture listJobsAsync() { + return client.executeAsync(listJobsRequest(SessionsImportsListJobsParams.builder().build()), RequestOptions.none(), LIST_JOBS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * List active import jobs + * + *

What is running or waiting, plus what just ended, for a progress indicator. + * + *

{@code GET /v3/import-jobs/active/} + * + * @param options per-request options that override the client options + * @return the response body + */ + public SessionsImportsListActiveJobsResponse listActiveJobs(RequestOptions options) { + return client.execute(listActiveJobsRequest(), options, LIST_ACTIVE_JOBS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #listActiveJobs(RequestOptions)}. + * + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture listActiveJobsAsync(RequestOptions options) { + return client.executeAsync(listActiveJobsRequest(), options, LIST_ACTIVE_JOBS_RESPONSE).thenApply(RawResponse::data); + } + + /** + * Same as {@link #listActiveJobs(RequestOptions)}, with the client's options. + * + * @return the result + */ + public SessionsImportsListActiveJobsResponse listActiveJobs() { + return client.execute(listActiveJobsRequest(), RequestOptions.none(), LIST_ACTIVE_JOBS_RESPONSE).data(); + } + + /** + * Asynchronous {@link #listActiveJobs(RequestOptions)}, with the client's options. + * + * @return a future completed with the result + */ + public CompletableFuture listActiveJobsAsync() { + return client.executeAsync(listActiveJobsRequest(), RequestOptions.none(), LIST_ACTIVE_JOBS_RESPONSE).thenApply(RawResponse::data); + } + + private static final ResponseHandler CREATE_RESPONSE = Responses.json(Conv.model(SessionImportJob::fromJson)); + + private static ApiRequest createRequest(SessionsImportsCreateParams params) { + return ApiRequest.builder("POST", "/v3/session/imports/") + .params(params) + .body(ApiRequest.BodyEncoding.JSON_OR_MULTIPART) + .build(); + } + + private static final ResponseHandler RETRIEVE_TEMPLATE_RESPONSE = Responses.binary(); + + private static ApiRequest retrieveTemplateRequest(SessionsImportsRetrieveTemplateParams params) { + return ApiRequest.builder("GET", "/v3/session/imports/template/") + .params(params) + .queryFields("import_type") + .accept("text/csv") + .build(); + } + + private static final ResponseHandler RETRIEVE_RESPONSE = Responses.json(Conv.model(SessionImportJob::fromJson)); + + private static ApiRequest retrieveRequest(String importId) { + return ApiRequest.builder("GET", "/v3/session/imports/{importId}/") + .pathParam("importId", importId) + .build(); + } + + private static final ResponseHandler> LIST_ERRORS_RESPONSE = Responses.page(Conv.model(SessionImportError::fromJson)); + + private static ApiRequest listErrorsRequest(String importId, SessionsImportsListErrorsParams params) { + return ApiRequest.builder("GET", "/v3/session/imports/{importId}/errors/") + .pathParam("importId", importId) + .params(params) + .queryFields("limit", "offset") + .build(); + } + + private static final ResponseHandler LIST_PROVIDERS_RESPONSE = Responses.json(Conv.model(SessionsImportsListProvidersResponse::fromJson)); + + private static ApiRequest listProvidersRequest() { + return ApiRequest.builder("GET", "/v3/session/imports/providers/") + .build(); + } + + private static final ResponseHandler CHECK_PROVIDER_RESPONSE = Responses.json(Conv.model(SessionsImportsCheckProviderResponse::fromJson)); + + private static ApiRequest checkProviderRequest(SessionsImportsCheckProviderParams params) { + return ApiRequest.builder("POST", "/v3/session/imports/providers/check/") + .params(params) + .body(ApiRequest.BodyEncoding.JSON) + .build(); + } + + private static final ResponseHandler START_RESPONSE = Responses.json(Conv.model(SessionImportJob::fromJson)); + + private static ApiRequest startRequest(String importId, SessionsImportsStartParams params) { + return ApiRequest.builder("POST", "/v3/session/imports/{importId}/start/") + .pathParam("importId", importId) + .params(params) + .body(ApiRequest.BodyEncoding.JSON) + .build(); + } + + private static final ResponseHandler PAUSE_RESPONSE = Responses.json(Conv.model(SessionImportJob::fromJson)); + + private static ApiRequest pauseRequest(String importId) { + return ApiRequest.builder("POST", "/v3/session/imports/{importId}/pause/") + .pathParam("importId", importId) + .build(); + } + + private static final ResponseHandler RESUME_RESPONSE = Responses.json(Conv.model(SessionImportJob::fromJson)); + + private static ApiRequest resumeRequest(String importId) { + return ApiRequest.builder("POST", "/v3/session/imports/{importId}/resume/") + .pathParam("importId", importId) + .build(); + } + + private static final ResponseHandler CANCEL_RESPONSE = Responses.json(Conv.model(SessionImportJob::fromJson)); + + private static ApiRequest cancelRequest(String importId) { + return ApiRequest.builder("POST", "/v3/session/imports/{importId}/cancel/") + .pathParam("importId", importId) + .build(); + } + + private static final ResponseHandler RETRY_RESPONSE = Responses.json(Conv.model(SessionImportJob::fromJson)); + + private static ApiRequest retryRequest(String importId, SessionsImportsRetryParams params) { + return ApiRequest.builder("POST", "/v3/session/imports/{importId}/retry/") + .pathParam("importId", importId) + .params(params) + .body(ApiRequest.BodyEncoding.MULTIPART) + .build(); + } + + private static final ResponseHandler LIST_JOBS_RESPONSE = Responses.json(Conv.model(SessionsImportsListJobsResponse::fromJson)); + + private static ApiRequest listJobsRequest(SessionsImportsListJobsParams params) { + return ApiRequest.builder("GET", "/v3/import-jobs/") + .params(params) + .queryFields("scope", "limit") + .build(); + } + + private static final ResponseHandler LIST_ACTIVE_JOBS_RESPONSE = Responses.json(Conv.model(SessionsImportsListActiveJobsResponse::fromJson)); + + private static ApiRequest listActiveJobsRequest() { + return ApiRequest.builder("GET", "/v3/import-jobs/active/") + .build(); + } + + /** The {@code sessions.imports} operations returning {@link RawResponse}. */ + public static final class WithRawResponse { + private final ApiClient client; + + WithRawResponse(ApiClient client) { + this.client = client; + } + + /** + * {@link #create(SessionsImportsCreateParams, RequestOptions)} with the raw response. + * + * @param params the request parameters + * @param options per-request options + * @return the result + */ + public RawResponse create(SessionsImportsCreateParams params, RequestOptions options) { + return client.execute(createRequest(params), options, CREATE_RESPONSE); + } + + /** + * Asynchronous {@link #create(SessionsImportsCreateParams, RequestOptions)} with the raw response. + * + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> createAsync(SessionsImportsCreateParams params, RequestOptions options) { + return client.executeAsync(createRequest(params), options, CREATE_RESPONSE); + } + + /** + * {@link #create(SessionsImportsCreateParams, RequestOptions)} with the raw response, with the client's options. + * + * @param params the request parameters + * @return the result + */ + public RawResponse create(SessionsImportsCreateParams params) { + return client.execute(createRequest(params), RequestOptions.none(), CREATE_RESPONSE); + } + + /** + * Asynchronous {@link #create(SessionsImportsCreateParams, RequestOptions)} with the raw response, with the client's options. + * + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture> createAsync(SessionsImportsCreateParams params) { + return client.executeAsync(createRequest(params), RequestOptions.none(), CREATE_RESPONSE); + } + + /** + * {@link #create(SessionsImportsCreateParams, RequestOptions)} with the raw response, without parameters. + * + * @param options per-request options + * @return the result + */ + public RawResponse create(RequestOptions options) { + return client.execute(createRequest(SessionsImportsCreateParams.builder().build()), options, CREATE_RESPONSE); + } + + /** + * Asynchronous {@link #create(SessionsImportsCreateParams, RequestOptions)} with the raw response, without parameters. + * + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> createAsync(RequestOptions options) { + return client.executeAsync(createRequest(SessionsImportsCreateParams.builder().build()), options, CREATE_RESPONSE); + } + + /** + * {@link #create(SessionsImportsCreateParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @return the result + */ + public RawResponse create() { + return client.execute(createRequest(SessionsImportsCreateParams.builder().build()), RequestOptions.none(), CREATE_RESPONSE); + } + + /** + * Asynchronous {@link #create(SessionsImportsCreateParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @return a future completed with the result + */ + public CompletableFuture> createAsync() { + return client.executeAsync(createRequest(SessionsImportsCreateParams.builder().build()), RequestOptions.none(), CREATE_RESPONSE); + } + + /** + * {@link #retrieveTemplate(SessionsImportsRetrieveTemplateParams, RequestOptions)} with the raw response. + * + * @param params the request parameters + * @param options per-request options + * @return the result + */ + public RawResponse retrieveTemplate(SessionsImportsRetrieveTemplateParams params, RequestOptions options) { + return client.execute(retrieveTemplateRequest(params), options, RETRIEVE_TEMPLATE_RESPONSE); + } + + /** + * Asynchronous {@link #retrieveTemplate(SessionsImportsRetrieveTemplateParams, RequestOptions)} with the raw response. + * + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> retrieveTemplateAsync(SessionsImportsRetrieveTemplateParams params, RequestOptions options) { + return client.executeAsync(retrieveTemplateRequest(params), options, RETRIEVE_TEMPLATE_RESPONSE); + } + + /** + * {@link #retrieveTemplate(SessionsImportsRetrieveTemplateParams, RequestOptions)} with the raw response, with the client's options. + * + * @param params the request parameters + * @return the result + */ + public RawResponse retrieveTemplate(SessionsImportsRetrieveTemplateParams params) { + return client.execute(retrieveTemplateRequest(params), RequestOptions.none(), RETRIEVE_TEMPLATE_RESPONSE); + } + + /** + * Asynchronous {@link #retrieveTemplate(SessionsImportsRetrieveTemplateParams, RequestOptions)} with the raw response, with the client's options. + * + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture> retrieveTemplateAsync(SessionsImportsRetrieveTemplateParams params) { + return client.executeAsync(retrieveTemplateRequest(params), RequestOptions.none(), RETRIEVE_TEMPLATE_RESPONSE); + } + + /** + * {@link #retrieveTemplate(SessionsImportsRetrieveTemplateParams, RequestOptions)} with the raw response, without parameters. + * + * @param options per-request options + * @return the result + */ + public RawResponse retrieveTemplate(RequestOptions options) { + return client.execute(retrieveTemplateRequest(SessionsImportsRetrieveTemplateParams.builder().build()), options, RETRIEVE_TEMPLATE_RESPONSE); + } + + /** + * Asynchronous {@link #retrieveTemplate(SessionsImportsRetrieveTemplateParams, RequestOptions)} with the raw response, without parameters. + * + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> retrieveTemplateAsync(RequestOptions options) { + return client.executeAsync(retrieveTemplateRequest(SessionsImportsRetrieveTemplateParams.builder().build()), options, RETRIEVE_TEMPLATE_RESPONSE); + } + + /** + * {@link #retrieveTemplate(SessionsImportsRetrieveTemplateParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @return the result + */ + public RawResponse retrieveTemplate() { + return client.execute(retrieveTemplateRequest(SessionsImportsRetrieveTemplateParams.builder().build()), RequestOptions.none(), RETRIEVE_TEMPLATE_RESPONSE); + } + + /** + * Asynchronous {@link #retrieveTemplate(SessionsImportsRetrieveTemplateParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @return a future completed with the result + */ + public CompletableFuture> retrieveTemplateAsync() { + return client.executeAsync(retrieveTemplateRequest(SessionsImportsRetrieveTemplateParams.builder().build()), RequestOptions.none(), RETRIEVE_TEMPLATE_RESPONSE); + } + + /** + * {@link #retrieve(String, RequestOptions)} with the raw response. + * + * @param importId the {@code importId} + * @param options per-request options + * @return the result + */ + public RawResponse retrieve(String importId, RequestOptions options) { + return client.execute(retrieveRequest(importId), options, RETRIEVE_RESPONSE); + } + + /** + * Asynchronous {@link #retrieve(String, RequestOptions)} with the raw response. + * + * @param importId the {@code importId} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> retrieveAsync(String importId, RequestOptions options) { + return client.executeAsync(retrieveRequest(importId), options, RETRIEVE_RESPONSE); + } + + /** + * {@link #retrieve(String, RequestOptions)} with the raw response, with the client's options. + * + * @param importId the {@code importId} + * @return the result + */ + public RawResponse retrieve(String importId) { + return client.execute(retrieveRequest(importId), RequestOptions.none(), RETRIEVE_RESPONSE); + } + + /** + * Asynchronous {@link #retrieve(String, RequestOptions)} with the raw response, with the client's options. + * + * @param importId the {@code importId} + * @return a future completed with the result + */ + public CompletableFuture> retrieveAsync(String importId) { + return client.executeAsync(retrieveRequest(importId), RequestOptions.none(), RETRIEVE_RESPONSE); + } + + /** + * {@link #listErrors(String, SessionsImportsListErrorsParams, RequestOptions)} with the raw response. + * + * @param importId the {@code importId} + * @param params the request parameters + * @param options per-request options + * @return the result + */ + public RawResponse> listErrors(String importId, SessionsImportsListErrorsParams params, RequestOptions options) { + return client.execute(listErrorsRequest(importId, params), options, LIST_ERRORS_RESPONSE); + } + + /** + * Asynchronous {@link #listErrors(String, SessionsImportsListErrorsParams, RequestOptions)} with the raw response. + * + * @param importId the {@code importId} + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture>> listErrorsAsync(String importId, SessionsImportsListErrorsParams params, RequestOptions options) { + return client.executeAsync(listErrorsRequest(importId, params), options, LIST_ERRORS_RESPONSE); + } + + /** + * {@link #listErrors(String, SessionsImportsListErrorsParams, RequestOptions)} with the raw response, with the client's options. + * + * @param importId the {@code importId} + * @param params the request parameters + * @return the result + */ + public RawResponse> listErrors(String importId, SessionsImportsListErrorsParams params) { + return client.execute(listErrorsRequest(importId, params), RequestOptions.none(), LIST_ERRORS_RESPONSE); + } + + /** + * Asynchronous {@link #listErrors(String, SessionsImportsListErrorsParams, RequestOptions)} with the raw response, with the client's options. + * + * @param importId the {@code importId} + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture>> listErrorsAsync(String importId, SessionsImportsListErrorsParams params) { + return client.executeAsync(listErrorsRequest(importId, params), RequestOptions.none(), LIST_ERRORS_RESPONSE); + } + + /** + * {@link #listErrors(String, SessionsImportsListErrorsParams, RequestOptions)} with the raw response, without parameters. + * + * @param importId the {@code importId} + * @param options per-request options + * @return the result + */ + public RawResponse> listErrors(String importId, RequestOptions options) { + return client.execute(listErrorsRequest(importId, SessionsImportsListErrorsParams.builder().build()), options, LIST_ERRORS_RESPONSE); + } + + /** + * Asynchronous {@link #listErrors(String, SessionsImportsListErrorsParams, RequestOptions)} with the raw response, without parameters. + * + * @param importId the {@code importId} + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture>> listErrorsAsync(String importId, RequestOptions options) { + return client.executeAsync(listErrorsRequest(importId, SessionsImportsListErrorsParams.builder().build()), options, LIST_ERRORS_RESPONSE); + } + + /** + * {@link #listErrors(String, SessionsImportsListErrorsParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param importId the {@code importId} + * @return the result + */ + public RawResponse> listErrors(String importId) { + return client.execute(listErrorsRequest(importId, SessionsImportsListErrorsParams.builder().build()), RequestOptions.none(), LIST_ERRORS_RESPONSE); + } + + /** + * Asynchronous {@link #listErrors(String, SessionsImportsListErrorsParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @param importId the {@code importId} + * @return a future completed with the result + */ + public CompletableFuture>> listErrorsAsync(String importId) { + return client.executeAsync(listErrorsRequest(importId, SessionsImportsListErrorsParams.builder().build()), RequestOptions.none(), LIST_ERRORS_RESPONSE); + } + + /** + * {@link #listProviders(RequestOptions)} with the raw response. + * + * @param options per-request options + * @return the result + */ + public RawResponse listProviders(RequestOptions options) { + return client.execute(listProvidersRequest(), options, LIST_PROVIDERS_RESPONSE); + } - private static ApiRequest retrieveTemplateRequest(SessionsImportsRetrieveTemplateParams params) { - return ApiRequest.builder("GET", "/v3/session/imports/template/") - .params(params) - .queryFields("import_type") - .accept("text/csv") - .build(); - } + /** + * Asynchronous {@link #listProviders(RequestOptions)} with the raw response. + * + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> listProvidersAsync(RequestOptions options) { + return client.executeAsync(listProvidersRequest(), options, LIST_PROVIDERS_RESPONSE); + } - private static final ResponseHandler RETRIEVE_RESPONSE = Responses.json(Conv.model(SessionImportJob::fromJson)); + /** + * {@link #listProviders(RequestOptions)} with the raw response, with the client's options. + * + * @return the result + */ + public RawResponse listProviders() { + return client.execute(listProvidersRequest(), RequestOptions.none(), LIST_PROVIDERS_RESPONSE); + } - private static ApiRequest retrieveRequest(String importId) { - return ApiRequest.builder("GET", "/v3/session/imports/{importId}/") - .pathParam("importId", importId) - .build(); - } + /** + * Asynchronous {@link #listProviders(RequestOptions)} with the raw response, with the client's options. + * + * @return a future completed with the result + */ + public CompletableFuture> listProvidersAsync() { + return client.executeAsync(listProvidersRequest(), RequestOptions.none(), LIST_PROVIDERS_RESPONSE); + } - private static final ResponseHandler> LIST_ERRORS_RESPONSE = Responses.page(Conv.model(SessionImportError::fromJson)); + /** + * {@link #checkProvider(SessionsImportsCheckProviderParams, RequestOptions)} with the raw response. + * + * @param params the request parameters + * @param options per-request options + * @return the result + */ + public RawResponse checkProvider(SessionsImportsCheckProviderParams params, RequestOptions options) { + return client.execute(checkProviderRequest(params), options, CHECK_PROVIDER_RESPONSE); + } - private static ApiRequest listErrorsRequest(String importId, SessionsImportsListErrorsParams params) { - return ApiRequest.builder("GET", "/v3/session/imports/{importId}/errors/") - .pathParam("importId", importId) - .params(params) - .queryFields("limit", "offset") - .build(); - } + /** + * Asynchronous {@link #checkProvider(SessionsImportsCheckProviderParams, RequestOptions)} with the raw response. + * + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> checkProviderAsync(SessionsImportsCheckProviderParams params, RequestOptions options) { + return client.executeAsync(checkProviderRequest(params), options, CHECK_PROVIDER_RESPONSE); + } - /** The {@code sessions.imports} operations returning {@link RawResponse}. */ - public static final class WithRawResponse { - private final ApiClient client; + /** + * {@link #checkProvider(SessionsImportsCheckProviderParams, RequestOptions)} with the raw response, with the client's options. + * + * @param params the request parameters + * @return the result + */ + public RawResponse checkProvider(SessionsImportsCheckProviderParams params) { + return client.execute(checkProviderRequest(params), RequestOptions.none(), CHECK_PROVIDER_RESPONSE); + } - WithRawResponse(ApiClient client) { - this.client = client; + /** + * Asynchronous {@link #checkProvider(SessionsImportsCheckProviderParams, RequestOptions)} with the raw response, with the client's options. + * + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture> checkProviderAsync(SessionsImportsCheckProviderParams params) { + return client.executeAsync(checkProviderRequest(params), RequestOptions.none(), CHECK_PROVIDER_RESPONSE); } /** - * {@link #create(SessionsImportsCreateParams, RequestOptions)} with the raw response. + * {@link #start(String, SessionsImportsStartParams, RequestOptions)} with the raw response. * + * @param importId the {@code importId} * @param params the request parameters * @param options per-request options * @return the result */ - public RawResponse create(SessionsImportsCreateParams params, RequestOptions options) { - return client.execute(createRequest(params), options, CREATE_RESPONSE); + public RawResponse start(String importId, SessionsImportsStartParams params, RequestOptions options) { + return client.execute(startRequest(importId, params), options, START_RESPONSE); } /** - * Asynchronous {@link #create(SessionsImportsCreateParams, RequestOptions)} with the raw response. + * Asynchronous {@link #start(String, SessionsImportsStartParams, RequestOptions)} with the raw response. * + * @param importId the {@code importId} * @param params the request parameters * @param options per-request options * @return a future completed with the result */ - public CompletableFuture> createAsync(SessionsImportsCreateParams params, RequestOptions options) { - return client.executeAsync(createRequest(params), options, CREATE_RESPONSE); + public CompletableFuture> startAsync(String importId, SessionsImportsStartParams params, RequestOptions options) { + return client.executeAsync(startRequest(importId, params), options, START_RESPONSE); } /** - * {@link #create(SessionsImportsCreateParams, RequestOptions)} with the raw response, with the client's options. + * {@link #start(String, SessionsImportsStartParams, RequestOptions)} with the raw response, with the client's options. * + * @param importId the {@code importId} * @param params the request parameters * @return the result */ - public RawResponse create(SessionsImportsCreateParams params) { - return client.execute(createRequest(params), RequestOptions.none(), CREATE_RESPONSE); + public RawResponse start(String importId, SessionsImportsStartParams params) { + return client.execute(startRequest(importId, params), RequestOptions.none(), START_RESPONSE); } /** - * Asynchronous {@link #create(SessionsImportsCreateParams, RequestOptions)} with the raw response, with the client's options. + * Asynchronous {@link #start(String, SessionsImportsStartParams, RequestOptions)} with the raw response, with the client's options. * + * @param importId the {@code importId} * @param params the request parameters * @return a future completed with the result */ - public CompletableFuture> createAsync(SessionsImportsCreateParams params) { - return client.executeAsync(createRequest(params), RequestOptions.none(), CREATE_RESPONSE); + public CompletableFuture> startAsync(String importId, SessionsImportsStartParams params) { + return client.executeAsync(startRequest(importId, params), RequestOptions.none(), START_RESPONSE); } /** - * {@link #create(SessionsImportsCreateParams, RequestOptions)} with the raw response, without parameters. + * {@link #start(String, SessionsImportsStartParams, RequestOptions)} with the raw response, without parameters. * + * @param importId the {@code importId} * @param options per-request options * @return the result */ - public RawResponse create(RequestOptions options) { - return client.execute(createRequest(SessionsImportsCreateParams.builder().build()), options, CREATE_RESPONSE); + public RawResponse start(String importId, RequestOptions options) { + return client.execute(startRequest(importId, SessionsImportsStartParams.builder().build()), options, START_RESPONSE); } /** - * Asynchronous {@link #create(SessionsImportsCreateParams, RequestOptions)} with the raw response, without parameters. + * Asynchronous {@link #start(String, SessionsImportsStartParams, RequestOptions)} with the raw response, without parameters. * + * @param importId the {@code importId} * @param options per-request options * @return a future completed with the result */ - public CompletableFuture> createAsync(RequestOptions options) { - return client.executeAsync(createRequest(SessionsImportsCreateParams.builder().build()), options, CREATE_RESPONSE); + public CompletableFuture> startAsync(String importId, RequestOptions options) { + return client.executeAsync(startRequest(importId, SessionsImportsStartParams.builder().build()), options, START_RESPONSE); } /** - * {@link #create(SessionsImportsCreateParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * {@link #start(String, SessionsImportsStartParams, RequestOptions)} with the raw response, without parameters, with the client's options. * + * @param importId the {@code importId} * @return the result */ - public RawResponse create() { - return client.execute(createRequest(SessionsImportsCreateParams.builder().build()), RequestOptions.none(), CREATE_RESPONSE); + public RawResponse start(String importId) { + return client.execute(startRequest(importId, SessionsImportsStartParams.builder().build()), RequestOptions.none(), START_RESPONSE); } /** - * Asynchronous {@link #create(SessionsImportsCreateParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * Asynchronous {@link #start(String, SessionsImportsStartParams, RequestOptions)} with the raw response, without parameters, with the client's options. * + * @param importId the {@code importId} * @return a future completed with the result */ - public CompletableFuture> createAsync() { - return client.executeAsync(createRequest(SessionsImportsCreateParams.builder().build()), RequestOptions.none(), CREATE_RESPONSE); + public CompletableFuture> startAsync(String importId) { + return client.executeAsync(startRequest(importId, SessionsImportsStartParams.builder().build()), RequestOptions.none(), START_RESPONSE); } /** - * {@link #retrieveTemplate(SessionsImportsRetrieveTemplateParams, RequestOptions)} with the raw response. + * {@link #pause(String, RequestOptions)} with the raw response. * - * @param params the request parameters + * @param importId the {@code importId} * @param options per-request options * @return the result */ - public RawResponse retrieveTemplate(SessionsImportsRetrieveTemplateParams params, RequestOptions options) { - return client.execute(retrieveTemplateRequest(params), options, RETRIEVE_TEMPLATE_RESPONSE); + public RawResponse pause(String importId, RequestOptions options) { + return client.execute(pauseRequest(importId), options, PAUSE_RESPONSE); } /** - * Asynchronous {@link #retrieveTemplate(SessionsImportsRetrieveTemplateParams, RequestOptions)} with the raw response. + * Asynchronous {@link #pause(String, RequestOptions)} with the raw response. * - * @param params the request parameters + * @param importId the {@code importId} * @param options per-request options * @return a future completed with the result */ - public CompletableFuture> retrieveTemplateAsync(SessionsImportsRetrieveTemplateParams params, RequestOptions options) { - return client.executeAsync(retrieveTemplateRequest(params), options, RETRIEVE_TEMPLATE_RESPONSE); + public CompletableFuture> pauseAsync(String importId, RequestOptions options) { + return client.executeAsync(pauseRequest(importId), options, PAUSE_RESPONSE); } /** - * {@link #retrieveTemplate(SessionsImportsRetrieveTemplateParams, RequestOptions)} with the raw response, with the client's options. + * {@link #pause(String, RequestOptions)} with the raw response, with the client's options. * - * @param params the request parameters + * @param importId the {@code importId} * @return the result */ - public RawResponse retrieveTemplate(SessionsImportsRetrieveTemplateParams params) { - return client.execute(retrieveTemplateRequest(params), RequestOptions.none(), RETRIEVE_TEMPLATE_RESPONSE); + public RawResponse pause(String importId) { + return client.execute(pauseRequest(importId), RequestOptions.none(), PAUSE_RESPONSE); } /** - * Asynchronous {@link #retrieveTemplate(SessionsImportsRetrieveTemplateParams, RequestOptions)} with the raw response, with the client's options. + * Asynchronous {@link #pause(String, RequestOptions)} with the raw response, with the client's options. * - * @param params the request parameters + * @param importId the {@code importId} * @return a future completed with the result */ - public CompletableFuture> retrieveTemplateAsync(SessionsImportsRetrieveTemplateParams params) { - return client.executeAsync(retrieveTemplateRequest(params), RequestOptions.none(), RETRIEVE_TEMPLATE_RESPONSE); + public CompletableFuture> pauseAsync(String importId) { + return client.executeAsync(pauseRequest(importId), RequestOptions.none(), PAUSE_RESPONSE); } /** - * {@link #retrieveTemplate(SessionsImportsRetrieveTemplateParams, RequestOptions)} with the raw response, without parameters. + * {@link #resume(String, RequestOptions)} with the raw response. * + * @param importId the {@code importId} * @param options per-request options * @return the result */ - public RawResponse retrieveTemplate(RequestOptions options) { - return client.execute(retrieveTemplateRequest(SessionsImportsRetrieveTemplateParams.builder().build()), options, RETRIEVE_TEMPLATE_RESPONSE); + public RawResponse resume(String importId, RequestOptions options) { + return client.execute(resumeRequest(importId), options, RESUME_RESPONSE); } /** - * Asynchronous {@link #retrieveTemplate(SessionsImportsRetrieveTemplateParams, RequestOptions)} with the raw response, without parameters. + * Asynchronous {@link #resume(String, RequestOptions)} with the raw response. * + * @param importId the {@code importId} * @param options per-request options * @return a future completed with the result */ - public CompletableFuture> retrieveTemplateAsync(RequestOptions options) { - return client.executeAsync(retrieveTemplateRequest(SessionsImportsRetrieveTemplateParams.builder().build()), options, RETRIEVE_TEMPLATE_RESPONSE); + public CompletableFuture> resumeAsync(String importId, RequestOptions options) { + return client.executeAsync(resumeRequest(importId), options, RESUME_RESPONSE); } /** - * {@link #retrieveTemplate(SessionsImportsRetrieveTemplateParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * {@link #resume(String, RequestOptions)} with the raw response, with the client's options. * + * @param importId the {@code importId} * @return the result */ - public RawResponse retrieveTemplate() { - return client.execute(retrieveTemplateRequest(SessionsImportsRetrieveTemplateParams.builder().build()), RequestOptions.none(), RETRIEVE_TEMPLATE_RESPONSE); + public RawResponse resume(String importId) { + return client.execute(resumeRequest(importId), RequestOptions.none(), RESUME_RESPONSE); } /** - * Asynchronous {@link #retrieveTemplate(SessionsImportsRetrieveTemplateParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * Asynchronous {@link #resume(String, RequestOptions)} with the raw response, with the client's options. * + * @param importId the {@code importId} * @return a future completed with the result */ - public CompletableFuture> retrieveTemplateAsync() { - return client.executeAsync(retrieveTemplateRequest(SessionsImportsRetrieveTemplateParams.builder().build()), RequestOptions.none(), RETRIEVE_TEMPLATE_RESPONSE); + public CompletableFuture> resumeAsync(String importId) { + return client.executeAsync(resumeRequest(importId), RequestOptions.none(), RESUME_RESPONSE); } /** - * {@link #retrieve(String, RequestOptions)} with the raw response. + * {@link #cancel(String, RequestOptions)} with the raw response. * * @param importId the {@code importId} * @param options per-request options * @return the result */ - public RawResponse retrieve(String importId, RequestOptions options) { - return client.execute(retrieveRequest(importId), options, RETRIEVE_RESPONSE); + public RawResponse cancel(String importId, RequestOptions options) { + return client.execute(cancelRequest(importId), options, CANCEL_RESPONSE); } /** - * Asynchronous {@link #retrieve(String, RequestOptions)} with the raw response. + * Asynchronous {@link #cancel(String, RequestOptions)} with the raw response. * * @param importId the {@code importId} * @param options per-request options * @return a future completed with the result */ - public CompletableFuture> retrieveAsync(String importId, RequestOptions options) { - return client.executeAsync(retrieveRequest(importId), options, RETRIEVE_RESPONSE); + public CompletableFuture> cancelAsync(String importId, RequestOptions options) { + return client.executeAsync(cancelRequest(importId), options, CANCEL_RESPONSE); } /** - * {@link #retrieve(String, RequestOptions)} with the raw response, with the client's options. + * {@link #cancel(String, RequestOptions)} with the raw response, with the client's options. * * @param importId the {@code importId} * @return the result */ - public RawResponse retrieve(String importId) { - return client.execute(retrieveRequest(importId), RequestOptions.none(), RETRIEVE_RESPONSE); + public RawResponse cancel(String importId) { + return client.execute(cancelRequest(importId), RequestOptions.none(), CANCEL_RESPONSE); } /** - * Asynchronous {@link #retrieve(String, RequestOptions)} with the raw response, with the client's options. + * Asynchronous {@link #cancel(String, RequestOptions)} with the raw response, with the client's options. * * @param importId the {@code importId} * @return a future completed with the result */ - public CompletableFuture> retrieveAsync(String importId) { - return client.executeAsync(retrieveRequest(importId), RequestOptions.none(), RETRIEVE_RESPONSE); + public CompletableFuture> cancelAsync(String importId) { + return client.executeAsync(cancelRequest(importId), RequestOptions.none(), CANCEL_RESPONSE); } /** - * {@link #listErrors(String, SessionsImportsListErrorsParams, RequestOptions)} with the raw response. + * {@link #retry(String, SessionsImportsRetryParams, RequestOptions)} with the raw response. * * @param importId the {@code importId} * @param params the request parameters * @param options per-request options * @return the result */ - public RawResponse> listErrors(String importId, SessionsImportsListErrorsParams params, RequestOptions options) { - return client.execute(listErrorsRequest(importId, params), options, LIST_ERRORS_RESPONSE); + public RawResponse retry(String importId, SessionsImportsRetryParams params, RequestOptions options) { + return client.execute(retryRequest(importId, params), options, RETRY_RESPONSE); } /** - * Asynchronous {@link #listErrors(String, SessionsImportsListErrorsParams, RequestOptions)} with the raw response. + * Asynchronous {@link #retry(String, SessionsImportsRetryParams, RequestOptions)} with the raw response. * * @param importId the {@code importId} * @param params the request parameters * @param options per-request options * @return a future completed with the result */ - public CompletableFuture>> listErrorsAsync(String importId, SessionsImportsListErrorsParams params, RequestOptions options) { - return client.executeAsync(listErrorsRequest(importId, params), options, LIST_ERRORS_RESPONSE); + public CompletableFuture> retryAsync(String importId, SessionsImportsRetryParams params, RequestOptions options) { + return client.executeAsync(retryRequest(importId, params), options, RETRY_RESPONSE); } /** - * {@link #listErrors(String, SessionsImportsListErrorsParams, RequestOptions)} with the raw response, with the client's options. + * {@link #retry(String, SessionsImportsRetryParams, RequestOptions)} with the raw response, with the client's options. * * @param importId the {@code importId} * @param params the request parameters * @return the result */ - public RawResponse> listErrors(String importId, SessionsImportsListErrorsParams params) { - return client.execute(listErrorsRequest(importId, params), RequestOptions.none(), LIST_ERRORS_RESPONSE); + public RawResponse retry(String importId, SessionsImportsRetryParams params) { + return client.execute(retryRequest(importId, params), RequestOptions.none(), RETRY_RESPONSE); } /** - * Asynchronous {@link #listErrors(String, SessionsImportsListErrorsParams, RequestOptions)} with the raw response, with the client's options. + * Asynchronous {@link #retry(String, SessionsImportsRetryParams, RequestOptions)} with the raw response, with the client's options. * * @param importId the {@code importId} * @param params the request parameters * @return a future completed with the result */ - public CompletableFuture>> listErrorsAsync(String importId, SessionsImportsListErrorsParams params) { - return client.executeAsync(listErrorsRequest(importId, params), RequestOptions.none(), LIST_ERRORS_RESPONSE); + public CompletableFuture> retryAsync(String importId, SessionsImportsRetryParams params) { + return client.executeAsync(retryRequest(importId, params), RequestOptions.none(), RETRY_RESPONSE); } /** - * {@link #listErrors(String, SessionsImportsListErrorsParams, RequestOptions)} with the raw response, without parameters. + * {@link #retry(String, SessionsImportsRetryParams, RequestOptions)} with the raw response, without parameters. * * @param importId the {@code importId} * @param options per-request options * @return the result */ - public RawResponse> listErrors(String importId, RequestOptions options) { - return client.execute(listErrorsRequest(importId, SessionsImportsListErrorsParams.builder().build()), options, LIST_ERRORS_RESPONSE); + public RawResponse retry(String importId, RequestOptions options) { + return client.execute(retryRequest(importId, SessionsImportsRetryParams.builder().build()), options, RETRY_RESPONSE); } /** - * Asynchronous {@link #listErrors(String, SessionsImportsListErrorsParams, RequestOptions)} with the raw response, without parameters. + * Asynchronous {@link #retry(String, SessionsImportsRetryParams, RequestOptions)} with the raw response, without parameters. * * @param importId the {@code importId} * @param options per-request options * @return a future completed with the result */ - public CompletableFuture>> listErrorsAsync(String importId, RequestOptions options) { - return client.executeAsync(listErrorsRequest(importId, SessionsImportsListErrorsParams.builder().build()), options, LIST_ERRORS_RESPONSE); + public CompletableFuture> retryAsync(String importId, RequestOptions options) { + return client.executeAsync(retryRequest(importId, SessionsImportsRetryParams.builder().build()), options, RETRY_RESPONSE); } /** - * {@link #listErrors(String, SessionsImportsListErrorsParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * {@link #retry(String, SessionsImportsRetryParams, RequestOptions)} with the raw response, without parameters, with the client's options. * * @param importId the {@code importId} * @return the result */ - public RawResponse> listErrors(String importId) { - return client.execute(listErrorsRequest(importId, SessionsImportsListErrorsParams.builder().build()), RequestOptions.none(), LIST_ERRORS_RESPONSE); + public RawResponse retry(String importId) { + return client.execute(retryRequest(importId, SessionsImportsRetryParams.builder().build()), RequestOptions.none(), RETRY_RESPONSE); } /** - * Asynchronous {@link #listErrors(String, SessionsImportsListErrorsParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * Asynchronous {@link #retry(String, SessionsImportsRetryParams, RequestOptions)} with the raw response, without parameters, with the client's options. * * @param importId the {@code importId} * @return a future completed with the result */ - public CompletableFuture>> listErrorsAsync(String importId) { - return client.executeAsync(listErrorsRequest(importId, SessionsImportsListErrorsParams.builder().build()), RequestOptions.none(), LIST_ERRORS_RESPONSE); + public CompletableFuture> retryAsync(String importId) { + return client.executeAsync(retryRequest(importId, SessionsImportsRetryParams.builder().build()), RequestOptions.none(), RETRY_RESPONSE); + } + + /** + * {@link #listJobs(SessionsImportsListJobsParams, RequestOptions)} with the raw response. + * + * @param params the request parameters + * @param options per-request options + * @return the result + */ + public RawResponse listJobs(SessionsImportsListJobsParams params, RequestOptions options) { + return client.execute(listJobsRequest(params), options, LIST_JOBS_RESPONSE); + } + + /** + * Asynchronous {@link #listJobs(SessionsImportsListJobsParams, RequestOptions)} with the raw response. + * + * @param params the request parameters + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> listJobsAsync(SessionsImportsListJobsParams params, RequestOptions options) { + return client.executeAsync(listJobsRequest(params), options, LIST_JOBS_RESPONSE); + } + + /** + * {@link #listJobs(SessionsImportsListJobsParams, RequestOptions)} with the raw response, with the client's options. + * + * @param params the request parameters + * @return the result + */ + public RawResponse listJobs(SessionsImportsListJobsParams params) { + return client.execute(listJobsRequest(params), RequestOptions.none(), LIST_JOBS_RESPONSE); + } + + /** + * Asynchronous {@link #listJobs(SessionsImportsListJobsParams, RequestOptions)} with the raw response, with the client's options. + * + * @param params the request parameters + * @return a future completed with the result + */ + public CompletableFuture> listJobsAsync(SessionsImportsListJobsParams params) { + return client.executeAsync(listJobsRequest(params), RequestOptions.none(), LIST_JOBS_RESPONSE); + } + + /** + * {@link #listJobs(SessionsImportsListJobsParams, RequestOptions)} with the raw response, without parameters. + * + * @param options per-request options + * @return the result + */ + public RawResponse listJobs(RequestOptions options) { + return client.execute(listJobsRequest(SessionsImportsListJobsParams.builder().build()), options, LIST_JOBS_RESPONSE); + } + + /** + * Asynchronous {@link #listJobs(SessionsImportsListJobsParams, RequestOptions)} with the raw response, without parameters. + * + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> listJobsAsync(RequestOptions options) { + return client.executeAsync(listJobsRequest(SessionsImportsListJobsParams.builder().build()), options, LIST_JOBS_RESPONSE); + } + + /** + * {@link #listJobs(SessionsImportsListJobsParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @return the result + */ + public RawResponse listJobs() { + return client.execute(listJobsRequest(SessionsImportsListJobsParams.builder().build()), RequestOptions.none(), LIST_JOBS_RESPONSE); + } + + /** + * Asynchronous {@link #listJobs(SessionsImportsListJobsParams, RequestOptions)} with the raw response, without parameters, with the client's options. + * + * @return a future completed with the result + */ + public CompletableFuture> listJobsAsync() { + return client.executeAsync(listJobsRequest(SessionsImportsListJobsParams.builder().build()), RequestOptions.none(), LIST_JOBS_RESPONSE); + } + + /** + * {@link #listActiveJobs(RequestOptions)} with the raw response. + * + * @param options per-request options + * @return the result + */ + public RawResponse listActiveJobs(RequestOptions options) { + return client.execute(listActiveJobsRequest(), options, LIST_ACTIVE_JOBS_RESPONSE); + } + + /** + * Asynchronous {@link #listActiveJobs(RequestOptions)} with the raw response. + * + * @param options per-request options + * @return a future completed with the result + */ + public CompletableFuture> listActiveJobsAsync(RequestOptions options) { + return client.executeAsync(listActiveJobsRequest(), options, LIST_ACTIVE_JOBS_RESPONSE); + } + + /** + * {@link #listActiveJobs(RequestOptions)} with the raw response, with the client's options. + * + * @return the result + */ + public RawResponse listActiveJobs() { + return client.execute(listActiveJobsRequest(), RequestOptions.none(), LIST_ACTIVE_JOBS_RESPONSE); + } + + /** + * Asynchronous {@link #listActiveJobs(RequestOptions)} with the raw response, with the client's options. + * + * @return a future completed with the result + */ + public CompletableFuture> listActiveJobsAsync() { + return client.executeAsync(listActiveJobsRequest(), RequestOptions.none(), LIST_ACTIVE_JOBS_RESPONSE); } } } diff --git a/src/main/java/me/didit/types/BankAccountCheckPricing.java b/src/main/java/me/didit/types/BankAccountCheckPricing.java new file mode 100644 index 0000000..ac06bd8 --- /dev/null +++ b/src/main/java/me/didit/types/BankAccountCheckPricing.java @@ -0,0 +1,125 @@ +// 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; + +/** + * Account check: the person types their account number and Didit checks it with the bank. Priced per country. + */ +public final class BankAccountCheckPricing extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("available", "price_usd"); + + private BankAccountCheckPricing(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code BankAccountCheckPricing} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static BankAccountCheckPricing fromJson(JsonNode json) { + return new BankAccountCheckPricing(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); + } + + /** + * true only where Didit serves the account check in this country in production. + * + * @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); + } + + /** + * List price of one account check the bank answers. null when not available. Decimal string with 4 decimals, in USD. + * + * @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 priceUsd() { + return Json.optional(json, "price_usd", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link BankAccountCheckPricing}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(BankAccountCheckPricing from) { + super(from); + } + + /** + * true only where Didit serves the account check in this country in production. + * + * @param available the value + * @return this builder + */ + public Builder available(boolean available) { + return set("available", Conv.BOOLEAN, available); + } + + /** + * List price of one account check the bank answers. null when not available. Decimal string with 4 decimals, in USD. + * + * @param priceUsd the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder priceUsd(@Nullable String priceUsd) { + return setNullable("price_usd", Conv.STRING, priceUsd); + } + + /** + * Builds the value. + * + * @return a new immutable {@code BankAccountCheckPricing} + * @throws IllegalStateException when a required field is missing + */ + public BankAccountCheckPricing build() { + require("available", false); + require("price_usd", true); + return new BankAccountCheckPricing(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/BankSignInPricing.java b/src/main/java/me/didit/types/BankSignInPricing.java new file mode 100644 index 0000000..3cc8d8a --- /dev/null +++ b/src/main/java/me/didit/types/BankSignInPricing.java @@ -0,0 +1,275 @@ +// 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; + +/** + * Bank sign-in: the person signs in to their bank. Priced by market, the same for every bank in it. + */ +public final class BankSignInPricing extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("available", "market", "price_usd", "add_ons"); + + private BankSignInPricing(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code BankSignInPricing} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static BankSignInPricing fromJson(JsonNode json) { + return new BankSignInPricing(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); + } + + /** + * true only where Didit serves bank sign-in in this country in production. + * + * @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 market whose price applies. null when not available. + * + * @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 market() { + return Json.optional(json, "market", Conv.STRING); + } + + /** + * List price of one bank sign-in. null when not available. Decimal string with 4 decimals, in USD. + * + * @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 priceUsd() { + return Json.optional(json, "price_usd", Conv.STRING); + } + + /** + * Add-ons priced in this country, each a decimal string with 4 decimals in USD, added to the bank sign-in price. Only the add-ons the country offers are listed; empty when bank sign-in is not available. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public BankSignInPricing.AddOns addOns() { + return Json.required(json, "add_ons", Conv.model(BankSignInPricing.AddOns::fromJson)); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link BankSignInPricing}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(BankSignInPricing from) { + super(from); + } + + /** + * true only where Didit serves bank sign-in in this country in production. + * + * @param available the value + * @return this builder + */ + public Builder available(boolean available) { + return set("available", Conv.BOOLEAN, available); + } + + /** + * The market whose price applies. null when not available. + * + * @param market the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder market(@Nullable String market) { + return setNullable("market", Conv.STRING, market); + } + + /** + * List price of one bank sign-in. null when not available. Decimal string with 4 decimals, in USD. + * + * @param priceUsd the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder priceUsd(@Nullable String priceUsd) { + return setNullable("price_usd", Conv.STRING, priceUsd); + } + + /** + * Add-ons priced in this country, each a decimal string with 4 decimals in USD, added to the bank sign-in price. Only the add-ons the country offers are listed; empty when bank sign-in is not available. + * + * @param addOns the value + * @return this builder + */ + public Builder addOns(BankSignInPricing.AddOns addOns) { + return set("add_ons", Conv.model(BankSignInPricing.AddOns::fromJson), addOns); + } + + /** + * Builds the value. + * + * @return a new immutable {@code BankSignInPricing} + * @throws IllegalStateException when a required field is missing + */ + public BankSignInPricing build() { + require("available", false); + require("market", true); + require("price_usd", true); + require("add_ons", false); + return new BankSignInPricing(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * Add-ons priced in this country, each a decimal string with 4 decimals in USD, added to the bank sign-in price. Only the add-ons the country offers are listed; empty when bank sign-in is not available. + */ + public static final class AddOns extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("balance", "transactions"); + + private AddOns(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code AddOns} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static AddOns fromJson(JsonNode json) { + return new AddOns(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); + } + + /** + * Account balance add-on. + * + * @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 balance() { + return Json.optional(json, "balance", Conv.STRING); + } + + /** + * Transactions add-on. + * + * @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 transactions() { + return Json.optional(json, "transactions", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link AddOns}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(AddOns from) { + super(from); + } + + /** + * Account balance add-on. + * + * @param balance the value + * @return this builder + */ + public Builder balance(String balance) { + return set("balance", Conv.STRING, balance); + } + + /** + * Transactions add-on. + * + * @param transactions the value + * @return this builder + */ + public Builder transactions(String transactions) { + return set("transactions", Conv.STRING, transactions); + } + + /** + * Builds the value. + * + * @return a new immutable {@code AddOns} + */ + public AddOns build() { + return new AddOns(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } +} diff --git a/src/main/java/me/didit/types/BankStatementUploadPricing.java b/src/main/java/me/didit/types/BankStatementUploadPricing.java new file mode 100644 index 0000000..7048eea --- /dev/null +++ b/src/main/java/me/didit/types/BankStatementUploadPricing.java @@ -0,0 +1,142 @@ +// 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; + +/** How the bank statement upload is priced. */ +public final class BankStatementUploadPricing extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("price_usd", "included_after_charged_bank_attempt", "standalone_available"); + + private BankStatementUploadPricing(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code BankStatementUploadPricing} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static BankStatementUploadPricing fromJson(JsonNode json) { + return new BankStatementUploadPricing(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); + } + + /** + * Price of a statement upload after a charged bank attempt. Decimal string with 4 decimals, in USD. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String priceUsd() { + return Json.required(json, "price_usd", Conv.STRING); + } + + /** + * true when the upload is included at no extra charge after a charged bank attempt in the same session. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public boolean includedAfterChargedBankAttempt() { + return Json.required(json, "included_after_charged_bank_attempt", Conv.BOOLEAN); + } + + /** + * true when a statement upload can run on its own, with no bank attempt first. false in production; sandbox sessions can test it without billing. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public boolean standaloneAvailable() { + return Json.required(json, "standalone_available", Conv.BOOLEAN); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link BankStatementUploadPricing}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(BankStatementUploadPricing from) { + super(from); + } + + /** + * Price of a statement upload after a charged bank attempt. Decimal string with 4 decimals, in USD. + * + * @param priceUsd the value + * @return this builder + */ + public Builder priceUsd(String priceUsd) { + return set("price_usd", Conv.STRING, priceUsd); + } + + /** + * true when the upload is included at no extra charge after a charged bank attempt in the same session. + * + * @param includedAfterChargedBankAttempt the value + * @return this builder + */ + public Builder includedAfterChargedBankAttempt(boolean includedAfterChargedBankAttempt) { + return set("included_after_charged_bank_attempt", Conv.BOOLEAN, includedAfterChargedBankAttempt); + } + + /** + * true when a statement upload can run on its own, with no bank attempt first. false in production; sandbox sessions can test it without billing. + * + * @param standaloneAvailable the value + * @return this builder + */ + public Builder standaloneAvailable(boolean standaloneAvailable) { + return set("standalone_available", Conv.BOOLEAN, standaloneAvailable); + } + + /** + * Builds the value. + * + * @return a new immutable {@code BankStatementUploadPricing} + * @throws IllegalStateException when a required field is missing + */ + public BankStatementUploadPricing build() { + require("price_usd", false); + require("included_after_charged_bank_attempt", false); + require("standalone_available", false); + return new BankStatementUploadPricing(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/BankVerificationPricing.java b/src/main/java/me/didit/types/BankVerificationPricing.java new file mode 100644 index 0000000..87f24f3 --- /dev/null +++ b/src/main/java/me/didit/types/BankVerificationPricing.java @@ -0,0 +1,206 @@ +// 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; +import me.didit.core.StringEnum; + +/** + * Public Bank Verification list prices: the statement upload, the own provider key fee and each country's methods. + */ +public final class BankVerificationPricing extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("currency", "statement_upload", "own_provider_fee_usd", "countries"); + + private BankVerificationPricing(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code BankVerificationPricing} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static BankVerificationPricing fromJson(JsonNode json) { + return new BankVerificationPricing(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); + } + + /** + * Currency of every price in the response. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public BankVerificationPricing.Currency currency() { + return Json.required(json, "currency", Conv.enumeration(BankVerificationPricing.Currency::of)); + } + + /** + * How the bank statement upload is priced. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public BankStatementUploadPricing statementUpload() { + return Json.required(json, "statement_upload", Conv.model(BankStatementUploadPricing::fromJson)); + } + + /** + * Fee for each billable ownership check on a route that uses your own provider contract instead of Didit's, charged whatever the result. A cancelled, timed out or abandoned connection is not billed. Decimal string with 4 decimals, in USD. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public String ownProviderFeeUsd() { + return Json.required(json, "own_provider_fee_usd", Conv.STRING); + } + + /** + * Every country, keyed by ISO 3166-1 alpha-3 code. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public Map countries() { + return Json.required(json, "countries", Conv.map(Conv.model(BankVerificationPricingCountry::fromJson))); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link BankVerificationPricing}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(BankVerificationPricing from) { + super(from); + } + + /** + * Currency of every price in the response. + * + * @param currency the value + * @return this builder + */ + public Builder currency(BankVerificationPricing.Currency currency) { + return set("currency", Conv.enumeration(BankVerificationPricing.Currency::of), currency); + } + + /** + * How the bank statement upload is priced. + * + * @param statementUpload the value + * @return this builder + */ + public Builder statementUpload(BankStatementUploadPricing statementUpload) { + return set("statement_upload", Conv.model(BankStatementUploadPricing::fromJson), statementUpload); + } + + /** + * Fee for each billable ownership check on a route that uses your own provider contract instead of Didit's, charged whatever the result. A cancelled, timed out or abandoned connection is not billed. Decimal string with 4 decimals, in USD. + * + * @param ownProviderFeeUsd the value + * @return this builder + */ + public Builder ownProviderFeeUsd(String ownProviderFeeUsd) { + return set("own_provider_fee_usd", Conv.STRING, ownProviderFeeUsd); + } + + /** + * Every country, keyed by ISO 3166-1 alpha-3 code. + * + * @param countries the value + * @return this builder + */ + public Builder countries(Map countries) { + return set("countries", Conv.map(Conv.model(BankVerificationPricingCountry::fromJson)), countries); + } + + /** + * Builds the value. + * + * @return a new immutable {@code BankVerificationPricing} + * @throws IllegalStateException when a required field is missing + */ + public BankVerificationPricing build() { + require("currency", false); + require("statement_upload", false); + require("own_provider_fee_usd", false); + require("countries", false); + return new BankVerificationPricing(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * Currency of every price in the response. + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Currency extends StringEnum { + /** The value {@code "USD"}. */ + public static final Currency USD = new Currency("USD"); + + private static final List KNOWN_VALUES = List.of(USD); + + private Currency(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 Currency of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Currency::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/BankVerificationPricingCountry.java b/src/main/java/me/didit/types/BankVerificationPricingCountry.java new file mode 100644 index 0000000..fe94578 --- /dev/null +++ b/src/main/java/me/didit/types/BankVerificationPricingCountry.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; + +/** One country's Bank Verification methods and their list prices. */ +public final class BankVerificationPricingCountry extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("name", "methods"); + + private BankVerificationPricingCountry(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code BankVerificationPricingCountry} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static BankVerificationPricingCountry fromJson(JsonNode json) { + return new BankVerificationPricingCountry(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); + } + + /** + * Country name in English. + * + * @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 two Bank Verification methods in a country. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public BankVerificationPricingMethods methods() { + return Json.required(json, "methods", Conv.model(BankVerificationPricingMethods::fromJson)); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link BankVerificationPricingCountry}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(BankVerificationPricingCountry from) { + super(from); + } + + /** + * Country name in English. + * + * @param name the value + * @return this builder + */ + public Builder name(String name) { + return set("name", Conv.STRING, name); + } + + /** + * The two Bank Verification methods in a country. + * + * @param methods the value + * @return this builder + */ + public Builder methods(BankVerificationPricingMethods methods) { + return set("methods", Conv.model(BankVerificationPricingMethods::fromJson), methods); + } + + /** + * Builds the value. + * + * @return a new immutable {@code BankVerificationPricingCountry} + * @throws IllegalStateException when a required field is missing + */ + public BankVerificationPricingCountry build() { + require("name", false); + require("methods", false); + return new BankVerificationPricingCountry(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/BankVerificationPricingMethods.java b/src/main/java/me/didit/types/BankVerificationPricingMethods.java new file mode 100644 index 0000000..2633343 --- /dev/null +++ b/src/main/java/me/didit/types/BankVerificationPricingMethods.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; + +/** The two Bank Verification methods in a country. */ +public final class BankVerificationPricingMethods extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("open_banking", "account_lookup"); + + private BankVerificationPricingMethods(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code BankVerificationPricingMethods} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static BankVerificationPricingMethods fromJson(JsonNode json) { + return new BankVerificationPricingMethods(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); + } + + /** + * Bank sign-in: the person signs in to their bank. Priced by market, the same for every bank in it. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public BankSignInPricing openBanking() { + return Json.required(json, "open_banking", Conv.model(BankSignInPricing::fromJson)); + } + + /** + * Account check: the person types their account number and Didit checks it with the bank. Priced per country. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public BankAccountCheckPricing accountLookup() { + return Json.required(json, "account_lookup", Conv.model(BankAccountCheckPricing::fromJson)); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link BankVerificationPricingMethods}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(BankVerificationPricingMethods from) { + super(from); + } + + /** + * Bank sign-in: the person signs in to their bank. Priced by market, the same for every bank in it. + * + * @param openBanking the value + * @return this builder + */ + public Builder openBanking(BankSignInPricing openBanking) { + return set("open_banking", Conv.model(BankSignInPricing::fromJson), openBanking); + } + + /** + * Account check: the person types their account number and Didit checks it with the bank. Priced per country. + * + * @param accountLookup the value + * @return this builder + */ + public Builder accountLookup(BankAccountCheckPricing accountLookup) { + return set("account_lookup", Conv.model(BankAccountCheckPricing::fromJson), accountLookup); + } + + /** + * Builds the value. + * + * @return a new immutable {@code BankVerificationPricingMethods} + * @throws IllegalStateException when a required field is missing + */ + public BankVerificationPricingMethods build() { + require("open_banking", false); + require("account_lookup", false); + return new BankVerificationPricingMethods(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/BankVerificationResult.java b/src/main/java/me/didit/types/BankVerificationResult.java index 5062932..6472d57 100644 --- a/src/main/java/me/didit/types/BankVerificationResult.java +++ b/src/main/java/me/didit/types/BankVerificationResult.java @@ -16,10 +16,10 @@ import org.jspecify.annotations.Nullable; /** - * One Bank Verification step's result, for User and Business Verification. method says how the account was verified. See [Bank verification methods](/core-technology/bank-verification/verification-methods). + * One Bank Verification step's result, for User and Business Verification. method says how the account was verified, and none that the person continued without a bank before any attempt was evaluated. continued_without_bank says the person continued without a bank, also after an evaluated attempt. See [Bank verification methods](/core-technology/bank-verification/verification-methods) and [When the person cannot verify their bank](/core-technology/bank-verification/fallbacks). */ public final class BankVerificationResult extends JsonModel { - private static final Set KNOWN_FIELDS = Set.of("schema_version", "bank_verification_id", "node_id", "status", "original_status", "method", "provider", "credential_source", "route", "connection", "account", "ownership", "financial_data", "billing", "reference_identity", "signals", "connection_abandoned", "not_covered", "evidence_purged_at", "warnings", "reason_codes", "created_at", "updated_at"); + private static final Set KNOWN_FIELDS = Set.of("schema_version", "bank_verification_id", "node_id", "status", "original_status", "method", "provider", "credential_source", "route", "connection", "account", "ownership", "financial_data", "billing", "reference_identity", "signals", "connection_abandoned", "not_covered", "continued_without_bank", "continuation", "evidence_purged_at", "warnings", "reason_codes", "created_at", "updated_at"); private BankVerificationResult(ObjectNode json, Map> files) { super(json, files); @@ -105,7 +105,7 @@ public Optional originalStatus() { } /** - * How the account was verified: open_banking (bank sign-in: the person signed in at their bank), account_lookup (account check: the person typed the account details and the bank confirmed the name), microdeposits or statement (a statement upload). null until an account is evaluated. Workflow rules read the same value as bank.method. + * How the account was verified: open_banking (bank sign-in: the person signed in at their bank), account_lookup (account check: the person typed the account details and the bank confirmed the name), microdeposits or statement (a statement upload). none when the person continued without a bank before any attempt was evaluated, so no account was verified. After an evaluated attempt, it stays the method of that attempt. null until an account is evaluated, and when the workflow narrows the data it returns. Workflow rules read the same value as bank.method. * * @return the value, or empty when the field is absent or null * @throws me.didit.errors.UnexpectedResponseException when the field has another type @@ -225,7 +225,7 @@ public Optional connectionAbandoned() { } /** - * Whether the person's bank or country could not be reached on this step. + * Whether the person's bank or country could not be reached on this step. Also true when the person continued without a bank because no method could verify their country or bank. * * @return the value, or empty when the field is absent or null * @throws me.didit.errors.UnexpectedResponseException when the field has another type @@ -234,6 +234,26 @@ public Optional notCovered() { return Json.optional(json, "not_covered", Conv.BOOLEAN); } + /** + * Whether the person left the step with Continue without your bank. continuation then says why. method is none when no attempt was evaluated before they continued. After an evaluated attempt, such as a holder that does not match, method stays the method of that attempt and its verdict and reason codes stand. Returned even when the workflow narrows the data it returns. + * + * @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 continuedWithoutBank() { + return Json.optional(json, "continued_without_bank", Conv.BOOLEAN); + } + + /** + * How the person continued without a bank. null when they did not. When the workflow narrows the data it returns, reason is still returned and every other key is null. + * + * @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 continuation() { + return Json.optional(json, "continuation", Conv.model(BankVerificationResult.Continuation::fromJson)); + } + /** * When the bank evidence was deleted under bank_evidence_retention_days. null otherwise. * @@ -255,7 +275,7 @@ public Optional> warnings() { } /** - * Why the verdict came out the way it did, for example OWNER_NAME_PARTIAL. Several may apply. + * Why the verdict came out the way it did, for example OWNER_NAME_PARTIAL. Several may apply. NOT_COVERED: the person continued without a bank because no method could verify their country or bank. SKIPPED: the person chose to continue without a bank while a way to verify was there. Neither is added when an evaluated attempt already decided the step. * * @return the value, or empty when the field is absent or null * @throws me.didit.errors.UnexpectedResponseException when the field has another type @@ -348,7 +368,7 @@ public Builder originalStatus(@Nullable String originalStatus) { } /** - * How the account was verified: open_banking (bank sign-in: the person signed in at their bank), account_lookup (account check: the person typed the account details and the bank confirmed the name), microdeposits or statement (a statement upload). null until an account is evaluated. Workflow rules read the same value as bank.method. + * How the account was verified: open_banking (bank sign-in: the person signed in at their bank), account_lookup (account check: the person typed the account details and the bank confirmed the name), microdeposits or statement (a statement upload). none when the person continued without a bank before any attempt was evaluated, so no account was verified. After an evaluated attempt, it stays the method of that attempt. null until an account is evaluated, and when the workflow narrows the data it returns. Workflow rules read the same value as bank.method. * * @param method the value, or {@code null} to send JSON null * @return this builder @@ -468,7 +488,7 @@ public Builder connectionAbandoned(@Nullable Boolean connectionAbandoned) { } /** - * Whether the person's bank or country could not be reached on this step. + * Whether the person's bank or country could not be reached on this step. Also true when the person continued without a bank because no method could verify their country or bank. * * @param notCovered the value, or {@code null} to send JSON null * @return this builder @@ -477,6 +497,26 @@ public Builder notCovered(@Nullable Boolean notCovered) { return setNullable("not_covered", Conv.BOOLEAN, notCovered); } + /** + * Whether the person left the step with Continue without your bank. continuation then says why. method is none when no attempt was evaluated before they continued. After an evaluated attempt, such as a holder that does not match, method stays the method of that attempt and its verdict and reason codes stand. Returned even when the workflow narrows the data it returns. + * + * @param continuedWithoutBank the value + * @return this builder + */ + public Builder continuedWithoutBank(boolean continuedWithoutBank) { + return set("continued_without_bank", Conv.BOOLEAN, continuedWithoutBank); + } + + /** + * How the person continued without a bank. null when they did not. When the workflow narrows the data it returns, reason is still returned and every other key is null. + * + * @param continuation the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder continuation(BankVerificationResult.@Nullable Continuation continuation) { + return setNullable("continuation", Conv.model(BankVerificationResult.Continuation::fromJson), continuation); + } + /** * When the bank evidence was deleted under bank_evidence_retention_days. null otherwise. * @@ -498,7 +538,7 @@ public Builder warnings(List warnings) { } /** - * Why the verdict came out the way it did, for example OWNER_NAME_PARTIAL. Several may apply. + * Why the verdict came out the way it did, for example OWNER_NAME_PARTIAL. Several may apply. NOT_COVERED: the person continued without a bank because no method could verify their country or bank. SKIPPED: the person chose to continue without a bank while a way to verify was there. Neither is added when an evaluated attempt already decided the step. * * @param reasonCodes the value * @return this builder @@ -595,7 +635,7 @@ public boolean isKnown() { } /** - * How the account was verified: open_banking (bank sign-in: the person signed in at their bank), account_lookup (account check: the person typed the account details and the bank confirmed the name), microdeposits or statement (a statement upload). null until an account is evaluated. Workflow rules read the same value as bank.method. + * How the account was verified: open_banking (bank sign-in: the person signed in at their bank), account_lookup (account check: the person typed the account details and the bank confirmed the name), microdeposits or statement (a statement upload). none when the person continued without a bank before any attempt was evaluated, so no account was verified. After an evaluated attempt, it stays the method of that attempt. null until an account is evaluated, and when the workflow narrows the data it returns. Workflow rules read the same value as bank.method. * *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. */ @@ -612,7 +652,10 @@ public static final class Method extends StringEnum { /** The value {@code "statement"}. */ public static final Method STATEMENT = new Method("statement"); - private static final List KNOWN_VALUES = List.of(OPEN_BANKING, ACCOUNT_LOOKUP, MICRODEPOSITS, STATEMENT); + /** The value {@code "none"}. */ + public static final Method NONE = new Method("none"); + + private static final List KNOWN_VALUES = List.of(OPEN_BANKING, ACCOUNT_LOOKUP, MICRODEPOSITS, STATEMENT, NONE); private Method(String value) { super(value); @@ -2469,7 +2512,7 @@ public Optional marketplaceFee() { } /** - * The usage line the charge was booked on. + * The usage line the charge was booked on: bank_verification for a bank sign-in or an account check, bank_statement_upload for a statement upload with no charged bank attempt before it, and bank_byok_fee for the marketplace fee on your own provider. null when nothing was billed. * * @return the value, or empty when the field is absent or null * @throws me.didit.errors.UnexpectedResponseException when the field has another type @@ -2522,7 +2565,7 @@ public Builder marketplaceFee(@Nullable String marketplaceFee) { } /** - * The usage line the charge was booked on. + * The usage line the charge was booked on: bank_verification for a bank sign-in or an account check, bank_statement_upload for a statement upload with no charged bank attempt before it, and bank_byok_fee for the marketplace fee on your own provider. null when nothing was billed. * * @param usageType the value, or {@code null} to send JSON null * @return this builder @@ -2588,4 +2631,283 @@ public boolean isKnown() { } } } + + /** + * How the person continued without a bank. null when they did not. When the workflow narrows the data it returns, reason is still returned and every other key is null. + */ + public static final class Continuation extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("reason", "country", "offered", "institution_id", "institution_name", "continued_at"); + + private Continuation(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Continuation} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Continuation fromJson(JsonNode json) { + return new Continuation(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); + } + + /** + * Why, as Didit worked it out when the person continued: no_route (no bank sign-in or account check serves their country), institution_unsupported (the bank they picked cannot be used on this step), attempts_exhausted (every attempt was already spent and none was in progress), or person_choice (a way to verify was there and they chose to continue, also when their bank could not be reached right now). no_route and institution_unsupported follow bank_unsupported_action, attempts_exhausted follows bank_attempts_exhausted_action, and person_choice follows bank_skipped_action, unless an evaluated attempt already decided the step. + * + * @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 reason() { + return Json.optional(json, "reason", Conv.enumeration(BankVerificationResult.Continuation.Reason::of)); + } + + /** + * The country the person was verifying in, ISO 3166-1 alpha-3. null when they continued before picking 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 country() { + return Json.optional(json, "country", Conv.STRING); + } + + /** + * The other ways to verify that country offered the person when they continued, in the order it offered them: statement (a statement upload), then microdeposits. Empty when it offered 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> offered() { + return Json.optional(json, "offered", Conv.list(Conv.enumeration(BankVerificationResult.Continuation.Offered::of))); + } + + /** + * For institution_unsupported, the ID of the bank the person could not use: the bank they picked, or the bank their last attempt ended on. Didit takes it from its own list of banks, never from the person's device, so a bank that list does not have is null. null for every other reason. + * + * @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 institutionId() { + return Json.optional(json, "institution_id", Conv.STRING); + } + + /** + * For institution_unsupported, the name of that bank, from the same list as institution_id. null when that list does not have the bank, and for every other reason. + * + * @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 institutionName() { + return Json.optional(json, "institution_name", Conv.STRING); + } + + /** + * When the person continued. + * + * @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 continuedAt() { + return Json.optional(json, "continued_at", Conv.DATE_TIME); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Continuation}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Continuation from) { + super(from); + } + + /** + * Why, as Didit worked it out when the person continued: no_route (no bank sign-in or account check serves their country), institution_unsupported (the bank they picked cannot be used on this step), attempts_exhausted (every attempt was already spent and none was in progress), or person_choice (a way to verify was there and they chose to continue, also when their bank could not be reached right now). no_route and institution_unsupported follow bank_unsupported_action, attempts_exhausted follows bank_attempts_exhausted_action, and person_choice follows bank_skipped_action, unless an evaluated attempt already decided the step. + * + * @param reason the value + * @return this builder + */ + public Builder reason(BankVerificationResult.Continuation.Reason reason) { + return set("reason", Conv.enumeration(BankVerificationResult.Continuation.Reason::of), reason); + } + + /** + * The country the person was verifying in, ISO 3166-1 alpha-3. null when they continued before picking one. + * + * @param country the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder country(@Nullable String country) { + return setNullable("country", Conv.STRING, country); + } + + /** + * The other ways to verify that country offered the person when they continued, in the order it offered them: statement (a statement upload), then microdeposits. Empty when it offered none. + * + * @param offered the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder offered(@Nullable List offered) { + return setNullable("offered", Conv.list(Conv.enumeration(BankVerificationResult.Continuation.Offered::of)), offered); + } + + /** + * For institution_unsupported, the ID of the bank the person could not use: the bank they picked, or the bank their last attempt ended on. Didit takes it from its own list of banks, never from the person's device, so a bank that list does not have is null. null for every other reason. + * + * @param institutionId the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder institutionId(@Nullable String institutionId) { + return setNullable("institution_id", Conv.STRING, institutionId); + } + + /** + * For institution_unsupported, the name of that bank, from the same list as institution_id. null when that list does not have the bank, and for every other reason. + * + * @param institutionName the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder institutionName(@Nullable String institutionName) { + return setNullable("institution_name", Conv.STRING, institutionName); + } + + /** + * When the person continued. + * + * @param continuedAt the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder continuedAt(@Nullable OffsetDateTime continuedAt) { + return setNullable("continued_at", Conv.DATE_TIME, continuedAt); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Continuation} + */ + public Continuation build() { + return new Continuation(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * Why, as Didit worked it out when the person continued: no_route (no bank sign-in or account check serves their country), institution_unsupported (the bank they picked cannot be used on this step), attempts_exhausted (every attempt was already spent and none was in progress), or person_choice (a way to verify was there and they chose to continue, also when their bank could not be reached right now). no_route and institution_unsupported follow bank_unsupported_action, attempts_exhausted follows bank_attempts_exhausted_action, and person_choice follows bank_skipped_action, unless an evaluated attempt already decided the step. + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Reason extends StringEnum { + /** The value {@code "no_route"}. */ + public static final Reason NO_ROUTE = new Reason("no_route"); + + /** The value {@code "institution_unsupported"}. */ + public static final Reason INSTITUTION_UNSUPPORTED = new Reason("institution_unsupported"); + + /** The value {@code "attempts_exhausted"}. */ + public static final Reason ATTEMPTS_EXHAUSTED = new Reason("attempts_exhausted"); + + /** The value {@code "person_choice"}. */ + public static final Reason PERSON_CHOICE = new Reason("person_choice"); + + private static final List KNOWN_VALUES = List.of(NO_ROUTE, INSTITUTION_UNSUPPORTED, ATTEMPTS_EXHAUSTED, PERSON_CHOICE); + + private Reason(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 Reason of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Reason::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 Offered extends StringEnum { + /** The value {@code "statement"}. */ + public static final Offered STATEMENT = new Offered("statement"); + + /** The value {@code "microdeposits"}. */ + public static final Offered MICRODEPOSITS = new Offered("microdeposits"); + + private static final List KNOWN_VALUES = List.of(STATEMENT, MICRODEPOSITS); + + private Offered(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 Offered of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Offered::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/ImportJobSummary.java b/src/main/java/me/didit/types/ImportJobSummary.java new file mode 100644 index 0000000..1fdacb0 --- /dev/null +++ b/src/main/java/me/didit/types/ImportJobSummary.java @@ -0,0 +1,1094 @@ +// 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; + +/** One import job of any kind, in the shape the console's Import jobs drawer reads. */ +public final class ImportJobSummary extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("id", "kind", "source", "provider", "provider_name", "filename", "state", "status", "is_dry_run", "credential_hint", "resumes_at", "last_error", "started_by", "progress", "face_templates", "eta_seconds", "created_at", "started_at", "completed_at"); + + private ImportJobSummary(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code ImportJobSummary} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static ImportJobSummary fromJson(JsonNode json) { + return new ImportJobSummary(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 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 id() { + return Json.optional(json, "id", Conv.STRING); + } + + /** + * The kind 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 kind() { + return Json.optional(json, "kind", Conv.enumeration(ImportJobSummary.Kind::of)); + } + + /** + * 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.enumeration(ImportJobSummary.Source::of)); + } + + /** + * The provider 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 provider() { + return Json.optional(json, "provider", Conv.STRING); + } + + /** + * The provider_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 providerName() { + return Json.optional(json, "provider_name", Conv.STRING); + } + + /** + * The filename 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 filename() { + return Json.optional(json, "filename", Conv.STRING); + } + + /** + * The job's state as the console shows it; errors is a completed job with rejected rows. + * + * @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 state() { + return Json.optional(json, "state", Conv.enumeration(ImportJobSummary.State::of)); + } + + /** + * 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 is_dry_run 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 isDryRun() { + return Json.optional(json, "is_dry_run", Conv.BOOLEAN); + } + + /** + * The credential_hint 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 credentialHint() { + return Json.optional(json, "credential_hint", Conv.STRING); + } + + /** + * The resumes_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 resumesAt() { + return Json.optional(json, "resumes_at", Conv.DATE_TIME); + } + + /** + * The last_error 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 lastError() { + return Json.optional(json, "last_error", Conv.STRING); + } + + /** + * The started_by 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 startedBy() { + return Json.optional(json, "started_by", Conv.model(ImportJobSummary.StartedBy::fromJson)); + } + + /** + * The progress 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 progress() { + return Json.optional(json, "progress", Conv.model(ImportJobSummary.Progress::fromJson)); + } + + /** + * The face_templates 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 faceTemplates() { + return Json.optional(json, "face_templates", Conv.model(ImportJobSummary.FaceTemplates::fromJson)); + } + + /** + * The eta_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 etaSeconds() { + return Json.optional(json, "eta_seconds", Conv.LONG); + } + + /** + * The created_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 createdAt() { + return Json.optional(json, "created_at", Conv.DATE_TIME); + } + + /** + * 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 completed_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 completedAt() { + return Json.optional(json, "completed_at", Conv.DATE_TIME); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link ImportJobSummary}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(ImportJobSummary from) { + super(from); + } + + /** + * The id field. + * + * @param id the value + * @return this builder + */ + public Builder id(String id) { + return set("id", Conv.STRING, id); + } + + /** + * The kind field. + * + * @param kind the value + * @return this builder + */ + public Builder kind(ImportJobSummary.Kind kind) { + return set("kind", Conv.enumeration(ImportJobSummary.Kind::of), kind); + } + + /** + * The source field. + * + * @param source the value + * @return this builder + */ + public Builder source(ImportJobSummary.Source source) { + return set("source", Conv.enumeration(ImportJobSummary.Source::of), source); + } + + /** + * The provider field. + * + * @param provider the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder provider(@Nullable String provider) { + return setNullable("provider", Conv.STRING, provider); + } + + /** + * The provider_name field. + * + * @param providerName the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder providerName(@Nullable String providerName) { + return setNullable("provider_name", Conv.STRING, providerName); + } + + /** + * The filename field. + * + * @param filename the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder filename(@Nullable String filename) { + return setNullable("filename", Conv.STRING, filename); + } + + /** + * The job's state as the console shows it; errors is a completed job with rejected rows. + * + * @param state the value + * @return this builder + */ + public Builder state(ImportJobSummary.State state) { + return set("state", Conv.enumeration(ImportJobSummary.State::of), state); + } + + /** + * The status field. + * + * @param status the value + * @return this builder + */ + public Builder status(String status) { + return set("status", Conv.STRING, status); + } + + /** + * The is_dry_run field. + * + * @param isDryRun the value + * @return this builder + */ + public Builder isDryRun(boolean isDryRun) { + return set("is_dry_run", Conv.BOOLEAN, isDryRun); + } + + /** + * The credential_hint field. + * + * @param credentialHint the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder credentialHint(@Nullable String credentialHint) { + return setNullable("credential_hint", Conv.STRING, credentialHint); + } + + /** + * The resumes_at field. + * + * @param resumesAt the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder resumesAt(@Nullable OffsetDateTime resumesAt) { + return setNullable("resumes_at", Conv.DATE_TIME, resumesAt); + } + + /** + * The last_error field. + * + * @param lastError the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder lastError(@Nullable String lastError) { + return setNullable("last_error", Conv.STRING, lastError); + } + + /** + * The started_by field. + * + * @param startedBy the value + * @return this builder + */ + public Builder startedBy(ImportJobSummary.StartedBy startedBy) { + return set("started_by", Conv.model(ImportJobSummary.StartedBy::fromJson), startedBy); + } + + /** + * The progress field. + * + * @param progress the value + * @return this builder + */ + public Builder progress(ImportJobSummary.Progress progress) { + return set("progress", Conv.model(ImportJobSummary.Progress::fromJson), progress); + } + + /** + * The face_templates field. + * + * @param faceTemplates the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder faceTemplates(ImportJobSummary.@Nullable FaceTemplates faceTemplates) { + return setNullable("face_templates", Conv.model(ImportJobSummary.FaceTemplates::fromJson), faceTemplates); + } + + /** + * The eta_seconds field. + * + * @param etaSeconds the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder etaSeconds(@Nullable Long etaSeconds) { + return setNullable("eta_seconds", Conv.LONG, etaSeconds); + } + + /** + * The created_at field. + * + * @param createdAt the value + * @return this builder + */ + public Builder createdAt(OffsetDateTime createdAt) { + return set("created_at", Conv.DATE_TIME, createdAt); + } + + /** + * 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 completed_at field. + * + * @param completedAt the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder completedAt(@Nullable OffsetDateTime completedAt) { + return setNullable("completed_at", Conv.DATE_TIME, completedAt); + } + + /** + * Builds the value. + * + * @return a new immutable {@code ImportJobSummary} + */ + public ImportJobSummary build() { + return new ImportJobSummary(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 Kind extends StringEnum { + /** The value {@code "sessions"}. */ + public static final Kind SESSIONS = new Kind("sessions"); + + /** The value {@code "businesses"}. */ + public static final Kind BUSINESSES = new Kind("businesses"); + + /** The value {@code "users"}. */ + public static final Kind USERS = new Kind("users"); + + /** The value {@code "status_rules"}. */ + public static final Kind STATUS_RULES = new Kind("status_rules"); + + /** The value {@code "transactions"}. */ + public static final Kind TRANSACTIONS = new Kind("transactions"); + + private static final List KNOWN_VALUES = List.of(SESSIONS, BUSINESSES, USERS, STATUS_RULES, TRANSACTIONS); + + private Kind(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 Kind of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Kind::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 Source extends StringEnum { + /** The value {@code "file"}. */ + public static final Source FILE = new Source("file"); + + /** The value {@code "api"}. */ + public static final Source API = new Source("api"); + + /** The value {@code "provider"}. */ + public static final Source PROVIDER = new Source("provider"); + + private static final List KNOWN_VALUES = List.of(FILE, API, PROVIDER); + + private Source(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 Source of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Source::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 job's state as the console shows it; errors is a completed job with rejected rows. + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class State extends StringEnum { + /** The value {@code "ready"}. */ + public static final State READY = new State("ready"); + + /** The value {@code "queued"}. */ + public static final State QUEUED = new State("queued"); + + /** The value {@code "running"}. */ + public static final State RUNNING = new State("running"); + + /** The value {@code "paused"}. */ + public static final State PAUSED = new State("paused"); + + /** The value {@code "completed"}. */ + public static final State COMPLETED = new State("completed"); + + /** The value {@code "errors"}. */ + public static final State ERRORS = new State("errors"); + + /** The value {@code "failed"}. */ + public static final State FAILED = new State("failed"); + + /** The value {@code "cancelled"}. */ + public static final State CANCELLED = new State("cancelled"); + + private static final List KNOWN_VALUES = List.of(READY, QUEUED, RUNNING, PAUSED, COMPLETED, ERRORS, FAILED, CANCELLED); + + private State(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 State of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, State::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 StartedBy extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("name", "email"); + + private StartedBy(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code StartedBy} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static StartedBy fromJson(JsonNode json) { + return new StartedBy(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); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link StartedBy}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(StartedBy 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); + } + + /** + * The email field. + * + * @param email the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder email(@Nullable String email) { + return setNullable("email", Conv.STRING, email); + } + + /** + * Builds the value. + * + * @return a new immutable {@code StartedBy} + */ + public StartedBy build() { + return new StartedBy(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } + + public static final class Progress extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("total", "processed", "imported", "updated", "already_in_didit", "failed", "not_finished", "same_person"); + + private Progress(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Progress} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Progress fromJson(JsonNode json) { + return new Progress(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 total 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 total() { + return Json.optional(json, "total", Conv.LONG); + } + + /** + * The processed 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 processed() { + return Json.optional(json, "processed", Conv.LONG); + } + + /** + * The imported 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 imported() { + return Json.optional(json, "imported", Conv.LONG); + } + + /** + * The updated 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 updated() { + return Json.optional(json, "updated", Conv.LONG); + } + + /** + * The already_in_didit 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 alreadyInDidit() { + return Json.optional(json, "already_in_didit", 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 not_finished 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 notFinished() { + return Json.optional(json, "not_finished", Conv.LONG); + } + + /** + * The same_person 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 samePerson() { + return Json.optional(json, "same_person", Conv.LONG); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Progress}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Progress from) { + super(from); + } + + /** + * The total field. + * + * @param total the value + * @return this builder + */ + public Builder total(long total) { + return set("total", Conv.LONG, total); + } + + /** + * The processed field. + * + * @param processed the value + * @return this builder + */ + public Builder processed(long processed) { + return set("processed", Conv.LONG, processed); + } + + /** + * The imported field. + * + * @param imported the value + * @return this builder + */ + public Builder imported(long imported) { + return set("imported", Conv.LONG, imported); + } + + /** + * The updated field. + * + * @param updated the value + * @return this builder + */ + public Builder updated(long updated) { + return set("updated", Conv.LONG, updated); + } + + /** + * The already_in_didit field. + * + * @param alreadyInDidit the value + * @return this builder + */ + public Builder alreadyInDidit(long alreadyInDidit) { + return set("already_in_didit", Conv.LONG, alreadyInDidit); + } + + /** + * The failed field. + * + * @param failed the value + * @return this builder + */ + public Builder failed(long failed) { + return set("failed", Conv.LONG, failed); + } + + /** + * The not_finished field. + * + * @param notFinished the value + * @return this builder + */ + public Builder notFinished(long notFinished) { + return set("not_finished", Conv.LONG, notFinished); + } + + /** + * The same_person field. + * + * @param samePerson the value + * @return this builder + */ + public Builder samePerson(long samePerson) { + return set("same_person", Conv.LONG, samePerson); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Progress} + */ + public Progress build() { + return new Progress(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } + + public static final class FaceTemplates extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("enabled", "built", "duplicates", "blocklisted"); + + private FaceTemplates(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code FaceTemplates} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static FaceTemplates fromJson(JsonNode json) { + return new FaceTemplates(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 built 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 built() { + return Json.optional(json, "built", Conv.LONG); + } + + /** + * The duplicates 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 duplicates() { + return Json.optional(json, "duplicates", Conv.LONG); + } + + /** + * The blocklisted 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 blocklisted() { + return Json.optional(json, "blocklisted", Conv.LONG); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link FaceTemplates}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(FaceTemplates 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 built field. + * + * @param built the value + * @return this builder + */ + public Builder built(long built) { + return set("built", Conv.LONG, built); + } + + /** + * The duplicates field. + * + * @param duplicates the value + * @return this builder + */ + public Builder duplicates(long duplicates) { + return set("duplicates", Conv.LONG, duplicates); + } + + /** + * The blocklisted field. + * + * @param blocklisted the value + * @return this builder + */ + public Builder blocklisted(long blocklisted) { + return set("blocklisted", Conv.LONG, blocklisted); + } + + /** + * Builds the value. + * + * @return a new immutable {@code FaceTemplates} + */ + public FaceTemplates build() { + return new FaceTemplates(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } +} diff --git a/src/main/java/me/didit/types/ImportProvider.java b/src/main/java/me/didit/types/ImportProvider.java new file mode 100644 index 0000000..506facc --- /dev/null +++ b/src/main/java/me/didit/types/ImportProvider.java @@ -0,0 +1,566 @@ +// 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 ImportProvider extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("key", "name", "mode", "record_noun", "credential_fields", "regions", "required_permissions", "docs_url", "status_mapping"); + + private ImportProvider(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code ImportProvider} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static ImportProvider fromJson(JsonNode json) { + return new ImportProvider(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.enumeration(ImportProvider.Key::of)); + } + + /** + * 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); + } + + /** + * api_list: Didit lists records with the key. api_ids: upload the record IDs from an export. export_file: upload an export in Didit's format. + * + * @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 mode() { + return Json.optional(json, "mode", Conv.enumeration(ImportProvider.Mode::of)); + } + + /** + * The record_noun 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 recordNoun() { + return Json.optional(json, "record_noun", Conv.STRING); + } + + /** + * The credential_fields 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> credentialFields() { + return Json.optional(json, "credential_fields", Conv.list(Conv.model(ImportProvider.CredentialFields::fromJson))); + } + + /** + * The regions 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> regions() { + return Json.optional(json, "regions", Conv.list(Conv.STRING)); + } + + /** + * The required_permissions 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> requiredPermissions() { + return Json.optional(json, "required_permissions", Conv.list(Conv.STRING)); + } + + /** + * The docs_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 docsUrl() { + return Json.optional(json, "docs_url", Conv.STRING); + } + + /** + * The status_mapping 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> statusMapping() { + return Json.optional(json, "status_mapping", Conv.map(Conv.enumeration(ImportProvider.StatusMappingValue::of))); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link ImportProvider}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(ImportProvider from) { + super(from); + } + + /** + * The key field. + * + * @param key the value + * @return this builder + */ + public Builder key(ImportProvider.Key key) { + return set("key", Conv.enumeration(ImportProvider.Key::of), key); + } + + /** + * The name field. + * + * @param name the value + * @return this builder + */ + public Builder name(String name) { + return set("name", Conv.STRING, name); + } + + /** + * api_list: Didit lists records with the key. api_ids: upload the record IDs from an export. export_file: upload an export in Didit's format. + * + * @param mode the value + * @return this builder + */ + public Builder mode(ImportProvider.Mode mode) { + return set("mode", Conv.enumeration(ImportProvider.Mode::of), mode); + } + + /** + * The record_noun field. + * + * @param recordNoun the value + * @return this builder + */ + public Builder recordNoun(String recordNoun) { + return set("record_noun", Conv.STRING, recordNoun); + } + + /** + * The credential_fields field. + * + * @param credentialFields the value + * @return this builder + */ + public Builder credentialFields(List credentialFields) { + return set("credential_fields", Conv.list(Conv.model(ImportProvider.CredentialFields::fromJson)), credentialFields); + } + + /** + * The regions field. + * + * @param regions the value + * @return this builder + */ + public Builder regions(List regions) { + return set("regions", Conv.list(Conv.STRING), regions); + } + + /** + * The required_permissions field. + * + * @param requiredPermissions the value + * @return this builder + */ + public Builder requiredPermissions(List requiredPermissions) { + return set("required_permissions", Conv.list(Conv.STRING), requiredPermissions); + } + + /** + * The docs_url field. + * + * @param docsUrl the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder docsUrl(@Nullable String docsUrl) { + return setNullable("docs_url", Conv.STRING, docsUrl); + } + + /** + * The status_mapping field. + * + * @param statusMapping the value + * @return this builder + */ + public Builder statusMapping(Map statusMapping) { + return set("status_mapping", Conv.map(Conv.enumeration(ImportProvider.StatusMappingValue::of)), statusMapping); + } + + /** + * Builds the value. + * + * @return a new immutable {@code ImportProvider} + */ + public ImportProvider build() { + return new ImportProvider(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 "sumsub"}. */ + public static final Key SUMSUB = new Key("sumsub"); + + /** The value {@code "jumio"}. */ + public static final Key JUMIO = new Key("jumio"); + + /** The value {@code "veriff"}. */ + public static final Key VERIFF = new Key("veriff"); + + /** The value {@code "onfido"}. */ + public static final Key ONFIDO = new Key("onfido"); + + /** The value {@code "persona"}. */ + public static final Key PERSONA = new Key("persona"); + + /** The value {@code "metamap"}. */ + public static final Key METAMAP = new Key("metamap"); + + /** The value {@code "socure"}. */ + public static final Key SOCURE = new Key("socure"); + + /** The value {@code "idnow"}. */ + public static final Key IDNOW = new Key("idnow"); + + /** The value {@code "shufti"}. */ + public static final Key SHUFTI = new Key("shufti"); + + /** The value {@code "idenfy"}. */ + public static final Key IDENFY = new Key("idenfy"); + + /** The value {@code "ondato"}. */ + public static final Key ONDATO = new Key("ondato"); + + /** The value {@code "trulioo"}. */ + public static final Key TRULIOO = new Key("trulioo"); + + /** The value {@code "au10tix"}. */ + public static final Key AU_10_TIX = new Key("au10tix"); + + /** The value {@code "complycube"}. */ + public static final Key COMPLYCUBE = new Key("complycube"); + + /** The value {@code "other"}. */ + public static final Key OTHER = new Key("other"); + + private static final List KNOWN_VALUES = List.of(SUMSUB, JUMIO, VERIFF, ONFIDO, PERSONA, METAMAP, SOCURE, IDNOW, SHUFTI, IDENFY, ONDATO, TRULIOO, AU_10_TIX, COMPLYCUBE, OTHER); + + 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); + } + } + + /** + * api_list: Didit lists records with the key. api_ids: upload the record IDs from an export. export_file: upload an export in Didit's format. + * + *

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 "api_list"}. */ + public static final Mode API_LIST = new Mode("api_list"); + + /** The value {@code "api_ids"}. */ + public static final Mode API_IDS = new Mode("api_ids"); + + /** The value {@code "export_file"}. */ + public static final Mode EXPORT_FILE = new Mode("export_file"); + + private static final List KNOWN_VALUES = List.of(API_LIST, API_IDS, EXPORT_FILE); + + 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 CredentialFields extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("name", "label", "secret"); + + private CredentialFields(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code CredentialFields} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static CredentialFields fromJson(JsonNode json) { + return new CredentialFields(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 label 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 label() { + return Json.optional(json, "label", Conv.STRING); + } + + /** + * The secret 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 secret() { + return Json.optional(json, "secret", Conv.BOOLEAN); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link CredentialFields}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(CredentialFields 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 label field. + * + * @param label the value + * @return this builder + */ + public Builder label(String label) { + return set("label", Conv.STRING, label); + } + + /** + * The secret field. + * + * @param secret the value + * @return this builder + */ + public Builder secret(boolean secret) { + return set("secret", Conv.BOOLEAN, secret); + } + + /** + * Builds the value. + * + * @return a new immutable {@code CredentialFields} + */ + public CredentialFields build() { + return new CredentialFields(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 StatusMappingValue extends StringEnum { + /** The value {@code "Approved"}. */ + public static final StatusMappingValue APPROVED = new StatusMappingValue("Approved"); + + /** The value {@code "Declined"}. */ + public static final StatusMappingValue DECLINED = new StatusMappingValue("Declined"); + + /** The value {@code "In Review"}. */ + public static final StatusMappingValue IN_REVIEW = new StatusMappingValue("In Review"); + + /** The value {@code "Expired"}. */ + public static final StatusMappingValue EXPIRED = new StatusMappingValue("Expired"); + + /** The value {@code "Not Finished"}. */ + public static final StatusMappingValue NOT_FINISHED = new StatusMappingValue("Not Finished"); + + /** The value {@code "Abandoned"}. */ + public static final StatusMappingValue ABANDONED = new StatusMappingValue("Abandoned"); + + private static final List KNOWN_VALUES = List.of(APPROVED, DECLINED, IN_REVIEW, EXPIRED, NOT_FINISHED, ABANDONED); + + private StatusMappingValue(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 StatusMappingValue of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, StatusMappingValue::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/SessionDecision.java b/src/main/java/me/didit/types/SessionDecision.java index 1026d68..583cab4 100644 --- a/src/main/java/me/didit/types/SessionDecision.java +++ b/src/main/java/me/didit/types/SessionDecision.java @@ -283,7 +283,7 @@ public Optional> questionnaireRespo } /** - * Bank Verification results, one item per Bank Verification step, for User and Business Verification. null until a step produces one. Each item's method says how the account was verified: open_banking (bank sign-in) or account_lookup (account check), or a microdeposits or statement fallback. See [Bank verification methods](/core-technology/bank-verification/verification-methods). + * Bank Verification results, one item per Bank Verification step, for User and Business Verification. null until a step produces one. Each item's method says how the account was verified: open_banking (bank sign-in) or account_lookup (account check), or a statement or microdeposits fallback, and none when the person continued without a bank before any attempt was evaluated (continued_without_bank). See [Bank verification methods](/core-technology/bank-verification/verification-methods). * * @return the value, or empty when the field is absent or null * @throws me.didit.errors.UnexpectedResponseException when the field has another type @@ -702,7 +702,7 @@ public Builder questionnaireResponses(@Nullable Listnull until a step produces one. Each item's method says how the account was verified: open_banking (bank sign-in) or account_lookup (account check), or a microdeposits or statement fallback. See [Bank verification methods](/core-technology/bank-verification/verification-methods). + * Bank Verification results, one item per Bank Verification step, for User and Business Verification. null until a step produces one. Each item's method says how the account was verified: open_banking (bank sign-in) or account_lookup (account check), or a statement or microdeposits fallback, and none when the person continued without a bank before any attempt was evaluated (continued_without_bank). See [Bank verification methods](/core-technology/bank-verification/verification-methods). * * @param bankVerifications the value, or {@code null} to send JSON null * @return this builder diff --git a/src/main/java/me/didit/types/SessionImportJob.java b/src/main/java/me/didit/types/SessionImportJob.java index e20a1fa..a6bf8c0 100644 --- a/src/main/java/me/didit/types/SessionImportJob.java +++ b/src/main/java/me/didit/types/SessionImportJob.java @@ -16,7 +16,7 @@ import org.jspecify.annotations.Nullable; public final class SessionImportJob extends JsonModel { - private static final Set KNOWN_FIELDS = Set.of("uuid", "status", "import_type", "source_format", "source_filename", "total_rows", "processed_rows", "checkpoint_row", "created_count", "updated_count", "skipped_count", "failed_count", "total_media_bytes", "last_error", "created_at", "updated_at", "started_at", "completed_at"); + private static final Set KNOWN_FIELDS = Set.of("uuid", "status", "import_type", "source_format", "source_filename", "total_rows", "processed_rows", "checkpoint_row", "created_count", "updated_count", "skipped_count", "failed_count", "total_media_bytes", "last_error", "created_at", "updated_at", "started_at", "completed_at", "state", "source", "provider", "provider_options", "credential_hint", "credentials_expires_at", "resumes_at", "status_mapping", "is_dry_run", "dry_run_summary", "face_templates_enabled", "lawful_basis_confirmed_at", "not_finished_count", "same_person_count", "face_templates_count", "face_duplicates_count", "face_blocklist_hits_count", "created_by_name", "created_by_email"); private SessionImportJob(ObjectNode json, Map> files) { super(json, files); @@ -231,6 +231,196 @@ public Optional completedAt() { return Json.optional(json, "completed_at", Conv.DATE_TIME); } + /** + * The job's state as the console shows it; errors is a completed job with rejected rows. + * + * @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 state() { + return Json.optional(json, "state", Conv.enumeration(SessionImportJob.State::of)); + } + + /** + * 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.enumeration(SessionImportJob.Source::of)); + } + + /** + * Migration source; empty for a file or API import. + * + * @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 provider() { + return Json.optional(json, "provider", Conv.STRING); + } + + /** + * The provider_options 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> providerOptions() { + return Json.optional(json, "provider_options", Conv.OBJECT); + } + + /** + * The first characters of the key the migration holds. The key itself is never returned. + * + * @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 credentialHint() { + return Json.optional(json, "credential_hint", Conv.STRING); + } + + /** + * The credentials_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 credentialsExpiresAt() { + return Json.optional(json, "credentials_expires_at", Conv.DATE_TIME); + } + + /** + * When a job paused by the provider's rate limit resumes by itself. + * + * @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 resumesAt() { + return Json.optional(json, "resumes_at", Conv.DATE_TIME); + } + + /** + * The status_mapping 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> statusMapping() { + return Json.optional(json, "status_mapping", Conv.map(Conv.STRING)); + } + + /** + * The is_dry_run 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 isDryRun() { + return Json.optional(json, "is_dry_run", Conv.BOOLEAN); + } + + /** + * What a dry run found: total, by_status, already_in_didit, same_person, not_finished, failed, unmapped_statuses. + * + * @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> dryRunSummary() { + return Json.optional(json, "dry_run_summary", Conv.OBJECT); + } + + /** + * The face_templates_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 faceTemplatesEnabled() { + return Json.optional(json, "face_templates_enabled", Conv.BOOLEAN); + } + + /** + * The lawful_basis_confirmed_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 lawfulBasisConfirmedAt() { + return Json.optional(json, "lawful_basis_confirmed_at", Conv.DATE_TIME); + } + + /** + * The not_finished_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 notFinishedCount() { + return Json.optional(json, "not_finished_count", Conv.LONG); + } + + /** + * The same_person_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 samePersonCount() { + return Json.optional(json, "same_person_count", Conv.LONG); + } + + /** + * The face_templates_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 faceTemplatesCount() { + return Json.optional(json, "face_templates_count", Conv.LONG); + } + + /** + * The face_duplicates_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 faceDuplicatesCount() { + return Json.optional(json, "face_duplicates_count", Conv.LONG); + } + + /** + * The face_blocklist_hits_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 faceBlocklistHitsCount() { + return Json.optional(json, "face_blocklist_hits_count", Conv.LONG); + } + + /** + * The created_by_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 createdByName() { + return Json.optional(json, "created_by_name", Conv.STRING); + } + + /** + * The created_by_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 createdByEmail() { + return Json.optional(json, "created_by_email", Conv.STRING); + } + @Override protected Set knownFields() { return KNOWN_FIELDS; @@ -424,6 +614,196 @@ public Builder completedAt(@Nullable OffsetDateTime completedAt) { return setNullable("completed_at", Conv.DATE_TIME, completedAt); } + /** + * The job's state as the console shows it; errors is a completed job with rejected rows. + * + * @param state the value + * @return this builder + */ + public Builder state(SessionImportJob.State state) { + return set("state", Conv.enumeration(SessionImportJob.State::of), state); + } + + /** + * The source field. + * + * @param source the value + * @return this builder + */ + public Builder source(SessionImportJob.Source source) { + return set("source", Conv.enumeration(SessionImportJob.Source::of), source); + } + + /** + * Migration source; empty for a file or API import. + * + * @param provider the value + * @return this builder + */ + public Builder provider(String provider) { + return set("provider", Conv.STRING, provider); + } + + /** + * The provider_options field. + * + * @param providerOptions the value + * @return this builder + */ + public Builder providerOptions(Map providerOptions) { + return setAny("provider_options", providerOptions); + } + + /** + * The first characters of the key the migration holds. The key itself is never returned. + * + * @param credentialHint the value + * @return this builder + */ + public Builder credentialHint(String credentialHint) { + return set("credential_hint", Conv.STRING, credentialHint); + } + + /** + * The credentials_expires_at field. + * + * @param credentialsExpiresAt the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder credentialsExpiresAt(@Nullable OffsetDateTime credentialsExpiresAt) { + return setNullable("credentials_expires_at", Conv.DATE_TIME, credentialsExpiresAt); + } + + /** + * When a job paused by the provider's rate limit resumes by itself. + * + * @param resumesAt the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder resumesAt(@Nullable OffsetDateTime resumesAt) { + return setNullable("resumes_at", Conv.DATE_TIME, resumesAt); + } + + /** + * The status_mapping field. + * + * @param statusMapping the value + * @return this builder + */ + public Builder statusMapping(Map statusMapping) { + return set("status_mapping", Conv.map(Conv.STRING), statusMapping); + } + + /** + * The is_dry_run field. + * + * @param isDryRun the value + * @return this builder + */ + public Builder isDryRun(boolean isDryRun) { + return set("is_dry_run", Conv.BOOLEAN, isDryRun); + } + + /** + * What a dry run found: total, by_status, already_in_didit, same_person, not_finished, failed, unmapped_statuses. + * + * @param dryRunSummary the value + * @return this builder + */ + public Builder dryRunSummary(Map dryRunSummary) { + return setAny("dry_run_summary", dryRunSummary); + } + + /** + * The face_templates_enabled field. + * + * @param faceTemplatesEnabled the value + * @return this builder + */ + public Builder faceTemplatesEnabled(boolean faceTemplatesEnabled) { + return set("face_templates_enabled", Conv.BOOLEAN, faceTemplatesEnabled); + } + + /** + * The lawful_basis_confirmed_at field. + * + * @param lawfulBasisConfirmedAt the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder lawfulBasisConfirmedAt(@Nullable OffsetDateTime lawfulBasisConfirmedAt) { + return setNullable("lawful_basis_confirmed_at", Conv.DATE_TIME, lawfulBasisConfirmedAt); + } + + /** + * The not_finished_count field. + * + * @param notFinishedCount the value + * @return this builder + */ + public Builder notFinishedCount(long notFinishedCount) { + return set("not_finished_count", Conv.LONG, notFinishedCount); + } + + /** + * The same_person_count field. + * + * @param samePersonCount the value + * @return this builder + */ + public Builder samePersonCount(long samePersonCount) { + return set("same_person_count", Conv.LONG, samePersonCount); + } + + /** + * The face_templates_count field. + * + * @param faceTemplatesCount the value + * @return this builder + */ + public Builder faceTemplatesCount(long faceTemplatesCount) { + return set("face_templates_count", Conv.LONG, faceTemplatesCount); + } + + /** + * The face_duplicates_count field. + * + * @param faceDuplicatesCount the value + * @return this builder + */ + public Builder faceDuplicatesCount(long faceDuplicatesCount) { + return set("face_duplicates_count", Conv.LONG, faceDuplicatesCount); + } + + /** + * The face_blocklist_hits_count field. + * + * @param faceBlocklistHitsCount the value + * @return this builder + */ + public Builder faceBlocklistHitsCount(long faceBlocklistHitsCount) { + return set("face_blocklist_hits_count", Conv.LONG, faceBlocklistHitsCount); + } + + /** + * The created_by_name field. + * + * @param createdByName the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder createdByName(@Nullable String createdByName) { + return setNullable("created_by_name", Conv.STRING, createdByName); + } + + /** + * The created_by_email field. + * + * @param createdByEmail the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder createdByEmail(@Nullable String createdByEmail) { + return setNullable("created_by_email", Conv.STRING, createdByEmail); + } + /** * Builds the value. * @@ -474,7 +854,10 @@ public static final class Status extends StringEnum { /** The value {@code "CANCELLED"}. */ public static final Status CANCELLED = new Status("CANCELLED"); - private static final List KNOWN_VALUES = List.of(PENDING, PROCESSING, COMPLETED, FAILED, PAUSED, CANCELLED); + /** The value {@code "READY"}. */ + public static final Status READY = new Status("READY"); + + private static final List KNOWN_VALUES = List.of(PENDING, PROCESSING, COMPLETED, FAILED, PAUSED, CANCELLED, READY); private Status(String value) { super(value); @@ -594,4 +977,110 @@ public boolean isKnown() { return KNOWN_VALUES.contains(this); } } + + /** + * The job's state as the console shows it; errors is a completed job with rejected rows. + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class State extends StringEnum { + /** The value {@code "ready"}. */ + public static final State READY = new State("ready"); + + /** The value {@code "queued"}. */ + public static final State QUEUED = new State("queued"); + + /** The value {@code "running"}. */ + public static final State RUNNING = new State("running"); + + /** The value {@code "paused"}. */ + public static final State PAUSED = new State("paused"); + + /** The value {@code "completed"}. */ + public static final State COMPLETED = new State("completed"); + + /** The value {@code "errors"}. */ + public static final State ERRORS = new State("errors"); + + /** The value {@code "failed"}. */ + public static final State FAILED = new State("failed"); + + /** The value {@code "cancelled"}. */ + public static final State CANCELLED = new State("cancelled"); + + private static final List KNOWN_VALUES = List.of(READY, QUEUED, RUNNING, PAUSED, COMPLETED, ERRORS, FAILED, CANCELLED); + + private State(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 State of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, State::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 Source extends StringEnum { + /** The value {@code "file"}. */ + public static final Source FILE = new Source("file"); + + /** The value {@code "api"}. */ + public static final Source API = new Source("api"); + + /** The value {@code "provider"}. */ + public static final Source PROVIDER = new Source("provider"); + + private static final List KNOWN_VALUES = List.of(FILE, API, PROVIDER); + + private Source(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 Source of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Source::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/SessionsImportsCheckProviderParams.java b/src/main/java/me/didit/types/SessionsImportsCheckProviderParams.java new file mode 100644 index 0000000..14eb4e7 --- /dev/null +++ b/src/main/java/me/didit/types/SessionsImportsCheckProviderParams.java @@ -0,0 +1,330 @@ +// 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; + +/** Parameters for {@code sessions.imports.check_provider}. */ +public final class SessionsImportsCheckProviderParams extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("provider", "credentials", "options", "record_ids"); + + private SessionsImportsCheckProviderParams(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SessionsImportsCheckProviderParams} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SessionsImportsCheckProviderParams fromJson(JsonNode json) { + return new SessionsImportsCheckProviderParams(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); + } + + /** + * Migration source, from GET /v3/session/imports/providers/. Required when source is provider. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public SessionsImportsCheckProviderParams.Provider provider() { + return Json.required(json, "provider", Conv.enumeration(SessionsImportsCheckProviderParams.Provider::of)); + } + + /** + * The provider's read-only key, with the field names credential_fields lists. Encrypted at rest, never returned, and erased when the import ends. Send it as a JSON string in multipart. + * + * @return the value + * @throws me.didit.errors.UnexpectedResponseException when the field is absent or has another type + */ + public Map credentials() { + return Json.required(json, "credentials", Conv.map(Conv.STRING)); + } + + /** + * The options 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 options() { + return Json.optional(json, "options", Conv.model(SessionsImportsCheckProviderParams.Options::fromJson)); + } + + /** + * For api_ids providers: the first record ID of your export. + * + * @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> recordIds() { + return Json.optional(json, "record_ids", Conv.list(Conv.STRING)); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SessionsImportsCheckProviderParams}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SessionsImportsCheckProviderParams from) { + super(from); + } + + /** + * Migration source, from GET /v3/session/imports/providers/. Required when source is provider. + * + * @param provider the value + * @return this builder + */ + public Builder provider(SessionsImportsCheckProviderParams.Provider provider) { + return set("provider", Conv.enumeration(SessionsImportsCheckProviderParams.Provider::of), provider); + } + + /** + * The provider's read-only key, with the field names credential_fields lists. Encrypted at rest, never returned, and erased when the import ends. Send it as a JSON string in multipart. + * + * @param credentials the value + * @return this builder + */ + public Builder credentials(Map credentials) { + return set("credentials", Conv.map(Conv.STRING), credentials); + } + + /** + * The options field. + * + * @param options_ the value + * @return this builder + */ + public Builder options(SessionsImportsCheckProviderParams.Options options_) { + return set("options", Conv.model(SessionsImportsCheckProviderParams.Options::fromJson), options_); + } + + /** + * For api_ids providers: the first record ID of your export. + * + * @param recordIds the value + * @return this builder + */ + public Builder recordIds(List recordIds) { + return set("record_ids", Conv.list(Conv.STRING), recordIds); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SessionsImportsCheckProviderParams} + * @throws IllegalStateException when a required field is missing + */ + public SessionsImportsCheckProviderParams build() { + require("provider", false); + require("credentials", false); + return new SessionsImportsCheckProviderParams(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + /** + * Migration source, from GET /v3/session/imports/providers/. Required when source is provider. + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Provider extends StringEnum { + /** The value {@code "sumsub"}. */ + public static final Provider SUMSUB = new Provider("sumsub"); + + /** The value {@code "jumio"}. */ + public static final Provider JUMIO = new Provider("jumio"); + + /** The value {@code "veriff"}. */ + public static final Provider VERIFF = new Provider("veriff"); + + /** The value {@code "onfido"}. */ + public static final Provider ONFIDO = new Provider("onfido"); + + /** The value {@code "persona"}. */ + public static final Provider PERSONA = new Provider("persona"); + + /** The value {@code "metamap"}. */ + public static final Provider METAMAP = new Provider("metamap"); + + /** The value {@code "socure"}. */ + public static final Provider SOCURE = new Provider("socure"); + + /** The value {@code "idnow"}. */ + public static final Provider IDNOW = new Provider("idnow"); + + /** The value {@code "shufti"}. */ + public static final Provider SHUFTI = new Provider("shufti"); + + /** The value {@code "idenfy"}. */ + public static final Provider IDENFY = new Provider("idenfy"); + + /** The value {@code "ondato"}. */ + public static final Provider ONDATO = new Provider("ondato"); + + /** The value {@code "trulioo"}. */ + public static final Provider TRULIOO = new Provider("trulioo"); + + /** The value {@code "au10tix"}. */ + public static final Provider AU_10_TIX = new Provider("au10tix"); + + /** The value {@code "complycube"}. */ + public static final Provider COMPLYCUBE = new Provider("complycube"); + + /** The value {@code "other"}. */ + public static final Provider OTHER = new Provider("other"); + + private static final List KNOWN_VALUES = List.of(SUMSUB, JUMIO, VERIFF, ONFIDO, PERSONA, METAMAP, SOCURE, IDNOW, SHUFTI, IDENFY, ONDATO, TRULIOO, AU_10_TIX, COMPLYCUBE, OTHER); + + private Provider(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 Provider of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Provider::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 Options extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("region"); + + private Options(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Options} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Options fromJson(JsonNode json) { + return new Options(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 provider region, one of its regions (Onfido: eu, us, ca). + * + * @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 region() { + return Json.optional(json, "region", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Options}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Options from) { + super(from); + } + + /** + * The provider region, one of its regions (Onfido: eu, us, ca). + * + * @param region the value + * @return this builder + */ + public Builder region(String region) { + return set("region", Conv.STRING, region); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Options} + */ + public Options build() { + return new Options(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + } +} diff --git a/src/main/java/me/didit/types/SessionsImportsCheckProviderResponse.java b/src/main/java/me/didit/types/SessionsImportsCheckProviderResponse.java new file mode 100644 index 0000000..40a7f30 --- /dev/null +++ b/src/main/java/me/didit/types/SessionsImportsCheckProviderResponse.java @@ -0,0 +1,139 @@ +// 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; + +public final class SessionsImportsCheckProviderResponse extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("ok", "provider", "credential_hint"); + + private SessionsImportsCheckProviderResponse(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SessionsImportsCheckProviderResponse} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SessionsImportsCheckProviderResponse fromJson(JsonNode json) { + return new SessionsImportsCheckProviderResponse(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 ok 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 ok() { + return Json.optional(json, "ok", Conv.BOOLEAN); + } + + /** + * The provider 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 provider() { + return Json.optional(json, "provider", Conv.STRING); + } + + /** + * The credential_hint 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 credentialHint() { + return Json.optional(json, "credential_hint", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SessionsImportsCheckProviderResponse}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SessionsImportsCheckProviderResponse from) { + super(from); + } + + /** + * The ok field. + * + * @param ok the value + * @return this builder + */ + public Builder ok(boolean ok) { + return set("ok", Conv.BOOLEAN, ok); + } + + /** + * The provider field. + * + * @param provider the value + * @return this builder + */ + public Builder provider(String provider) { + return set("provider", Conv.STRING, provider); + } + + /** + * The credential_hint field. + * + * @param credentialHint the value, or {@code null} to send JSON null + * @return this builder + */ + public Builder credentialHint(@Nullable String credentialHint) { + return setNullable("credential_hint", Conv.STRING, credentialHint); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SessionsImportsCheckProviderResponse} + */ + public SessionsImportsCheckProviderResponse build() { + return new SessionsImportsCheckProviderResponse(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/SessionsImportsCreateParams.java b/src/main/java/me/didit/types/SessionsImportsCreateParams.java index 79fadcd..1e2993e 100644 --- a/src/main/java/me/didit/types/SessionsImportsCreateParams.java +++ b/src/main/java/me/didit/types/SessionsImportsCreateParams.java @@ -16,7 +16,7 @@ /** Parameters for {@code sessions.imports.create}. */ public final class SessionsImportsCreateParams extends JsonModel { - private static final Set KNOWN_FIELDS = Set.of("import_type", "workflow_id", "source_format", "file", "source_file_url"); + private static final Set KNOWN_FIELDS = Set.of("import_type", "workflow_id", "source_format", "file", "source_file_url", "source", "provider", "credentials", "options", "status_mapping", "dry_run", "face_templates", "lawful_basis_confirmed"); private SessionsImportsCreateParams(ObjectNode json, Map> files) { super(json, files); @@ -100,6 +100,86 @@ public Optional sourceFileUrl() { return Json.optional(json, "source_file_url", Conv.STRING); } + /** + * provider makes this a migration from another identity verification provider. Omit for a file import. + * + * @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.enumeration(SessionsImportsCreateParams.Source::of)); + } + + /** + * Migration source, from GET /v3/session/imports/providers/. Required when source is provider. + * + * @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 provider() { + return Json.optional(json, "provider", Conv.enumeration(SessionsImportsCreateParams.Provider::of)); + } + + /** + * The provider's read-only key, with the field names credential_fields lists. Encrypted at rest, never returned, and erased when the import ends. Send it as a JSON string in multipart. + * + * @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.map(Conv.STRING)); + } + + /** + * The options 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 options() { + return Json.optional(json, "options", Conv.model(SessionsImportsCreateParams.Options::fromJson)); + } + + /** + * Edits to the provider's default status mapping: source status to Didit status. Not Finished and Abandoned are skipped and counted, never imported. + * + * @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> statusMapping() { + return Json.optional(json, "status_mapping", Conv.map(Conv.enumeration(SessionsImportsCreateParams.StatusMappingValue::of))); + } + + /** + * Count what the migration would import (by status, already in Didit, same person, not finished) and write nothing. The job ends READY; start it with POST /v3/session/imports/{importId}/start/. + * + * @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 dryRun() { + return Json.optional(json, "dry_run", Conv.BOOLEAN); + } + + /** + * Build face templates from the imported selfies and search them against the application's faces and blocklist. Matches are flagged for review only. Requires lawful_basis_confirmed. + * + * @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 faceTemplates() { + return Json.optional(json, "face_templates", Conv.BOOLEAN); + } + + /** + * Confirms you have a lawful basis to share these selfies with Didit as processor. + * + * @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 lawfulBasisConfirmed() { + return Json.optional(json, "lawful_basis_confirmed", Conv.BOOLEAN); + } + @Override protected Set knownFields() { return KNOWN_FIELDS; @@ -173,6 +253,86 @@ public Builder sourceFileUrl(String sourceFileUrl) { return set("source_file_url", Conv.STRING, sourceFileUrl); } + /** + * provider makes this a migration from another identity verification provider. Omit for a file import. + * + * @param source the value + * @return this builder + */ + public Builder source(SessionsImportsCreateParams.Source source) { + return set("source", Conv.enumeration(SessionsImportsCreateParams.Source::of), source); + } + + /** + * Migration source, from GET /v3/session/imports/providers/. Required when source is provider. + * + * @param provider the value + * @return this builder + */ + public Builder provider(SessionsImportsCreateParams.Provider provider) { + return set("provider", Conv.enumeration(SessionsImportsCreateParams.Provider::of), provider); + } + + /** + * The provider's read-only key, with the field names credential_fields lists. Encrypted at rest, never returned, and erased when the import ends. Send it as a JSON string in multipart. + * + * @param credentials the value + * @return this builder + */ + public Builder credentials(Map credentials) { + return set("credentials", Conv.map(Conv.STRING), credentials); + } + + /** + * The options field. + * + * @param options_ the value + * @return this builder + */ + public Builder options(SessionsImportsCreateParams.Options options_) { + return set("options", Conv.model(SessionsImportsCreateParams.Options::fromJson), options_); + } + + /** + * Edits to the provider's default status mapping: source status to Didit status. Not Finished and Abandoned are skipped and counted, never imported. + * + * @param statusMapping the value + * @return this builder + */ + public Builder statusMapping(Map statusMapping) { + return set("status_mapping", Conv.map(Conv.enumeration(SessionsImportsCreateParams.StatusMappingValue::of)), statusMapping); + } + + /** + * Count what the migration would import (by status, already in Didit, same person, not finished) and write nothing. The job ends READY; start it with POST /v3/session/imports/{importId}/start/. + * + * @param dryRun the value + * @return this builder + */ + public Builder dryRun(boolean dryRun) { + return set("dry_run", Conv.BOOLEAN, dryRun); + } + + /** + * Build face templates from the imported selfies and search them against the application's faces and blocklist. Matches are flagged for review only. Requires lawful_basis_confirmed. + * + * @param faceTemplates the value + * @return this builder + */ + public Builder faceTemplates(boolean faceTemplates) { + return set("face_templates", Conv.BOOLEAN, faceTemplates); + } + + /** + * Confirms you have a lawful basis to share these selfies with Didit as processor. + * + * @param lawfulBasisConfirmed the value + * @return this builder + */ + public Builder lawfulBasisConfirmed(boolean lawfulBasisConfirmed) { + return set("lawful_basis_confirmed", Conv.BOOLEAN, lawfulBasisConfirmed); + } + /** * Builds the value. * @@ -279,4 +439,268 @@ public boolean isKnown() { return KNOWN_VALUES.contains(this); } } + + /** + * provider makes this a migration from another identity verification provider. Omit for a file import. + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Source extends StringEnum { + /** The value {@code "file"}. */ + public static final Source FILE = new Source("file"); + + /** The value {@code "provider"}. */ + public static final Source PROVIDER = new Source("provider"); + + private static final List KNOWN_VALUES = List.of(FILE, PROVIDER); + + private Source(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 Source of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Source::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); + } + } + + /** + * Migration source, from GET /v3/session/imports/providers/. Required when source is provider. + * + *

An open enum: {@link #of(String)} accepts values this SDK version does not know yet. + */ + public static final class Provider extends StringEnum { + /** The value {@code "sumsub"}. */ + public static final Provider SUMSUB = new Provider("sumsub"); + + /** The value {@code "jumio"}. */ + public static final Provider JUMIO = new Provider("jumio"); + + /** The value {@code "veriff"}. */ + public static final Provider VERIFF = new Provider("veriff"); + + /** The value {@code "onfido"}. */ + public static final Provider ONFIDO = new Provider("onfido"); + + /** The value {@code "persona"}. */ + public static final Provider PERSONA = new Provider("persona"); + + /** The value {@code "metamap"}. */ + public static final Provider METAMAP = new Provider("metamap"); + + /** The value {@code "socure"}. */ + public static final Provider SOCURE = new Provider("socure"); + + /** The value {@code "idnow"}. */ + public static final Provider IDNOW = new Provider("idnow"); + + /** The value {@code "shufti"}. */ + public static final Provider SHUFTI = new Provider("shufti"); + + /** The value {@code "idenfy"}. */ + public static final Provider IDENFY = new Provider("idenfy"); + + /** The value {@code "ondato"}. */ + public static final Provider ONDATO = new Provider("ondato"); + + /** The value {@code "trulioo"}. */ + public static final Provider TRULIOO = new Provider("trulioo"); + + /** The value {@code "au10tix"}. */ + public static final Provider AU_10_TIX = new Provider("au10tix"); + + /** The value {@code "complycube"}. */ + public static final Provider COMPLYCUBE = new Provider("complycube"); + + /** The value {@code "other"}. */ + public static final Provider OTHER = new Provider("other"); + + private static final List KNOWN_VALUES = List.of(SUMSUB, JUMIO, VERIFF, ONFIDO, PERSONA, METAMAP, SOCURE, IDNOW, SHUFTI, IDENFY, ONDATO, TRULIOO, AU_10_TIX, COMPLYCUBE, OTHER); + + private Provider(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 Provider of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Provider::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 Options extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("region"); + + private Options(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code Options} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static Options fromJson(JsonNode json) { + return new Options(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 provider region, one of its regions (Onfido: eu, us, ca). + * + * @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 region() { + return Json.optional(json, "region", Conv.STRING); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link Options}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(Options from) { + super(from); + } + + /** + * The provider region, one of its regions (Onfido: eu, us, ca). + * + * @param region the value + * @return this builder + */ + public Builder region(String region) { + return set("region", Conv.STRING, region); + } + + /** + * Builds the value. + * + * @return a new immutable {@code Options} + */ + public Options build() { + return new Options(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 StatusMappingValue extends StringEnum { + /** The value {@code "Approved"}. */ + public static final StatusMappingValue APPROVED = new StatusMappingValue("Approved"); + + /** The value {@code "Declined"}. */ + public static final StatusMappingValue DECLINED = new StatusMappingValue("Declined"); + + /** The value {@code "In Review"}. */ + public static final StatusMappingValue IN_REVIEW = new StatusMappingValue("In Review"); + + /** The value {@code "Expired"}. */ + public static final StatusMappingValue EXPIRED = new StatusMappingValue("Expired"); + + /** The value {@code "Not Finished"}. */ + public static final StatusMappingValue NOT_FINISHED = new StatusMappingValue("Not Finished"); + + /** The value {@code "Abandoned"}. */ + public static final StatusMappingValue ABANDONED = new StatusMappingValue("Abandoned"); + + private static final List KNOWN_VALUES = List.of(APPROVED, DECLINED, IN_REVIEW, EXPIRED, NOT_FINISHED, ABANDONED); + + private StatusMappingValue(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 StatusMappingValue of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, StatusMappingValue::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/SessionsImportsListActiveJobsResponse.java b/src/main/java/me/didit/types/SessionsImportsListActiveJobsResponse.java new file mode 100644 index 0000000..38a0ea4 --- /dev/null +++ b/src/main/java/me/didit/types/SessionsImportsListActiveJobsResponse.java @@ -0,0 +1,118 @@ +// 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; + +public final class SessionsImportsListActiveJobsResponse extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("results", "running"); + + private SessionsImportsListActiveJobsResponse(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SessionsImportsListActiveJobsResponse} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SessionsImportsListActiveJobsResponse fromJson(JsonNode json) { + return new SessionsImportsListActiveJobsResponse(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 results 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> results() { + return Json.optional(json, "results", Conv.list(Conv.model(ImportJobSummary::fromJson))); + } + + /** + * The running 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 running() { + return Json.optional(json, "running", Conv.LONG); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SessionsImportsListActiveJobsResponse}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SessionsImportsListActiveJobsResponse from) { + super(from); + } + + /** + * The results field. + * + * @param results the value + * @return this builder + */ + public Builder results(List results) { + return set("results", Conv.list(Conv.model(ImportJobSummary::fromJson)), results); + } + + /** + * The running field. + * + * @param running the value + * @return this builder + */ + public Builder running(long running) { + return set("running", Conv.LONG, running); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SessionsImportsListActiveJobsResponse} + */ + public SessionsImportsListActiveJobsResponse build() { + return new SessionsImportsListActiveJobsResponse(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/SessionsImportsListJobsParams.java b/src/main/java/me/didit/types/SessionsImportsListJobsParams.java new file mode 100644 index 0000000..37d7ee0 --- /dev/null +++ b/src/main/java/me/didit/types/SessionsImportsListJobsParams.java @@ -0,0 +1,168 @@ +// 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; + +/** Parameters for {@code sessions.imports.list_jobs}. */ +public final class SessionsImportsListJobsParams extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("scope", "limit"); + + private SessionsImportsListJobsParams(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SessionsImportsListJobsParams} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SessionsImportsListJobsParams fromJson(JsonNode json) { + return new SessionsImportsListJobsParams(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 scope 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 scope() { + return Json.optional(json, "scope", Conv.enumeration(SessionsImportsListJobsParams.Scope::of)); + } + + /** + * 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); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SessionsImportsListJobsParams}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SessionsImportsListJobsParams from) { + super(from); + } + + /** + * The scope field. + * + * @param scope the value + * @return this builder + */ + public Builder scope(SessionsImportsListJobsParams.Scope scope) { + return set("scope", Conv.enumeration(SessionsImportsListJobsParams.Scope::of), scope); + } + + /** + * The limit field. + * + * @param limit the value + * @return this builder + */ + public Builder limit(long limit) { + return set("limit", Conv.LONG, limit); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SessionsImportsListJobsParams} + */ + public SessionsImportsListJobsParams build() { + return new SessionsImportsListJobsParams(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 Scope extends StringEnum { + /** The value {@code "all"}. */ + public static final Scope ALL = new Scope("all"); + + /** The value {@code "sessions"}. */ + public static final Scope SESSIONS = new Scope("sessions"); + + /** The value {@code "users"}. */ + public static final Scope USERS = new Scope("users"); + + /** The value {@code "businesses"}. */ + public static final Scope BUSINESSES = new Scope("businesses"); + + private static final List KNOWN_VALUES = List.of(ALL, SESSIONS, USERS, BUSINESSES); + + private Scope(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 Scope of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, Scope::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/SessionsImportsListJobsResponse.java b/src/main/java/me/didit/types/SessionsImportsListJobsResponse.java new file mode 100644 index 0000000..92c51ab --- /dev/null +++ b/src/main/java/me/didit/types/SessionsImportsListJobsResponse.java @@ -0,0 +1,263 @@ +// 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; + +public final class SessionsImportsListJobsResponse extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("results", "counts"); + + private SessionsImportsListJobsResponse(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SessionsImportsListJobsResponse} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SessionsImportsListJobsResponse fromJson(JsonNode json) { + return new SessionsImportsListJobsResponse(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 results 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> results() { + return Json.optional(json, "results", Conv.list(Conv.model(ImportJobSummary::fromJson))); + } + + /** + * 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(SessionsImportsListJobsResponse.Counts::fromJson)); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SessionsImportsListJobsResponse}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SessionsImportsListJobsResponse from) { + super(from); + } + + /** + * The results field. + * + * @param results the value + * @return this builder + */ + public Builder results(List results) { + return set("results", Conv.list(Conv.model(ImportJobSummary::fromJson)), results); + } + + /** + * The counts field. + * + * @param counts the value + * @return this builder + */ + public Builder counts(SessionsImportsListJobsResponse.Counts counts) { + return set("counts", Conv.model(SessionsImportsListJobsResponse.Counts::fromJson), counts); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SessionsImportsListJobsResponse} + */ + public SessionsImportsListJobsResponse build() { + return new SessionsImportsListJobsResponse(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } + + public static final class Counts extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("all", "running_and_waiting", "needs_attention", "done"); + + 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 all 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 all() { + return Json.optional(json, "all", Conv.LONG); + } + + /** + * The running_and_waiting 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 runningAndWaiting() { + return Json.optional(json, "running_and_waiting", Conv.LONG); + } + + /** + * The needs_attention 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 needsAttention() { + return Json.optional(json, "needs_attention", Conv.LONG); + } + + /** + * The done 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 done() { + return Json.optional(json, "done", 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 all field. + * + * @param all the value + * @return this builder + */ + public Builder all(long all) { + return set("all", Conv.LONG, all); + } + + /** + * The running_and_waiting field. + * + * @param runningAndWaiting the value + * @return this builder + */ + public Builder runningAndWaiting(long runningAndWaiting) { + return set("running_and_waiting", Conv.LONG, runningAndWaiting); + } + + /** + * The needs_attention field. + * + * @param needsAttention the value + * @return this builder + */ + public Builder needsAttention(long needsAttention) { + return set("needs_attention", Conv.LONG, needsAttention); + } + + /** + * The done field. + * + * @param done the value + * @return this builder + */ + public Builder done(long done) { + return set("done", Conv.LONG, done); + } + + /** + * 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/SessionsImportsListProvidersResponse.java b/src/main/java/me/didit/types/SessionsImportsListProvidersResponse.java new file mode 100644 index 0000000..03a461f --- /dev/null +++ b/src/main/java/me/didit/types/SessionsImportsListProvidersResponse.java @@ -0,0 +1,138 @@ +// 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; + +public final class SessionsImportsListProvidersResponse extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("providers", "mapping_targets", "skipped_statuses"); + + private SessionsImportsListProvidersResponse(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SessionsImportsListProvidersResponse} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SessionsImportsListProvidersResponse fromJson(JsonNode json) { + return new SessionsImportsListProvidersResponse(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 providers 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> providers() { + return Json.optional(json, "providers", Conv.list(Conv.model(ImportProvider::fromJson))); + } + + /** + * The mapping_targets 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> mappingTargets() { + return Json.optional(json, "mapping_targets", Conv.list(Conv.STRING)); + } + + /** + * The skipped_statuses 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> skippedStatuses() { + return Json.optional(json, "skipped_statuses", Conv.list(Conv.STRING)); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SessionsImportsListProvidersResponse}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SessionsImportsListProvidersResponse from) { + super(from); + } + + /** + * The providers field. + * + * @param providers the value + * @return this builder + */ + public Builder providers(List providers) { + return set("providers", Conv.list(Conv.model(ImportProvider::fromJson)), providers); + } + + /** + * The mapping_targets field. + * + * @param mappingTargets the value + * @return this builder + */ + public Builder mappingTargets(List mappingTargets) { + return set("mapping_targets", Conv.list(Conv.STRING), mappingTargets); + } + + /** + * The skipped_statuses field. + * + * @param skippedStatuses the value + * @return this builder + */ + public Builder skippedStatuses(List skippedStatuses) { + return set("skipped_statuses", Conv.list(Conv.STRING), skippedStatuses); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SessionsImportsListProvidersResponse} + */ + public SessionsImportsListProvidersResponse build() { + return new SessionsImportsListProvidersResponse(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/SessionsImportsRetryParams.java b/src/main/java/me/didit/types/SessionsImportsRetryParams.java new file mode 100644 index 0000000..38a71d4 --- /dev/null +++ b/src/main/java/me/didit/types/SessionsImportsRetryParams.java @@ -0,0 +1,129 @@ +// 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.nio.file.Path; +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 sessions.imports.retry}. */ +public final class SessionsImportsRetryParams extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("credentials", "file"); + + private SessionsImportsRetryParams(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SessionsImportsRetryParams} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SessionsImportsRetryParams fromJson(JsonNode json) { + return new SessionsImportsRetryParams(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 provider's read-only key, with the field names credential_fields lists. Encrypted at rest, never returned, and erased when the import ends. Send it as a JSON string in multipart. + * + * @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.map(Conv.STRING)); + } + + /** + * The record IDs or export file again, for api_ids and export_file providers. + * + * @return the file to upload, if set + */ + public Optional file() { + return file("file"); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SessionsImportsRetryParams}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SessionsImportsRetryParams from) { + super(from); + } + + /** + * The provider's read-only key, with the field names credential_fields lists. Encrypted at rest, never returned, and erased when the import ends. Send it as a JSON string in multipart. + * + * @param credentials the value + * @return this builder + */ + public Builder credentials(Map credentials) { + return set("credentials", Conv.map(Conv.STRING), credentials); + } + + /** + * The record IDs or export file again, for api_ids and export_file providers. + * + * @param file the value + * @return this builder + */ + public Builder file(FileUpload file) { + return setFile("file", file); + } + + /** + * Uploads the file at {@code path} as {@code file}. + * + * @param path the file to read when the request is sent + * @return this builder + */ + public Builder file(Path path) { + return setFile("file", FileUpload.of(path)); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SessionsImportsRetryParams} + */ + public SessionsImportsRetryParams build() { + return new SessionsImportsRetryParams(buildJson(), buildFiles()); + } + + @Override + protected Builder self() { + return this; + } + } +} diff --git a/src/main/java/me/didit/types/SessionsImportsStartParams.java b/src/main/java/me/didit/types/SessionsImportsStartParams.java new file mode 100644 index 0000000..616730a --- /dev/null +++ b/src/main/java/me/didit/types/SessionsImportsStartParams.java @@ -0,0 +1,194 @@ +// 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; + +/** Parameters for {@code sessions.imports.start}. */ +public final class SessionsImportsStartParams extends JsonModel { + private static final Set KNOWN_FIELDS = Set.of("status_mapping", "face_templates", "lawful_basis_confirmed"); + + private SessionsImportsStartParams(ObjectNode json, Map> files) { + super(json, files); + } + + /** + * Reads a {@code SessionsImportsStartParams} from JSON. Unknown fields are kept and readable + * through {@link #_additionalProperties()}. + * + * @param json a JSON object + * @return the parsed value + */ + public static SessionsImportsStartParams fromJson(JsonNode json) { + return new SessionsImportsStartParams(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); + } + + /** + * Edits to the provider's default status mapping: source status to Didit status. Not Finished and Abandoned are skipped and counted, never imported. + * + * @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> statusMapping() { + return Json.optional(json, "status_mapping", Conv.map(Conv.enumeration(SessionsImportsStartParams.StatusMappingValue::of))); + } + + /** + * Build face templates from the imported selfies and search them against the application's faces and blocklist. Matches are flagged for review only. Requires lawful_basis_confirmed. + * + * @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 faceTemplates() { + return Json.optional(json, "face_templates", Conv.BOOLEAN); + } + + /** + * Confirms you have a lawful basis to share these selfies with Didit as processor. + * + * @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 lawfulBasisConfirmed() { + return Json.optional(json, "lawful_basis_confirmed", Conv.BOOLEAN); + } + + @Override + protected Set knownFields() { + return KNOWN_FIELDS; + } + + /** Builds a {@link SessionsImportsStartParams}. */ + public static final class Builder extends JsonModel.BaseBuilder { + private Builder() {} + + private Builder(SessionsImportsStartParams from) { + super(from); + } + + /** + * Edits to the provider's default status mapping: source status to Didit status. Not Finished and Abandoned are skipped and counted, never imported. + * + * @param statusMapping the value + * @return this builder + */ + public Builder statusMapping(Map statusMapping) { + return set("status_mapping", Conv.map(Conv.enumeration(SessionsImportsStartParams.StatusMappingValue::of)), statusMapping); + } + + /** + * Build face templates from the imported selfies and search them against the application's faces and blocklist. Matches are flagged for review only. Requires lawful_basis_confirmed. + * + * @param faceTemplates the value + * @return this builder + */ + public Builder faceTemplates(boolean faceTemplates) { + return set("face_templates", Conv.BOOLEAN, faceTemplates); + } + + /** + * Confirms you have a lawful basis to share these selfies with Didit as processor. + * + * @param lawfulBasisConfirmed the value + * @return this builder + */ + public Builder lawfulBasisConfirmed(boolean lawfulBasisConfirmed) { + return set("lawful_basis_confirmed", Conv.BOOLEAN, lawfulBasisConfirmed); + } + + /** + * Builds the value. + * + * @return a new immutable {@code SessionsImportsStartParams} + */ + public SessionsImportsStartParams build() { + return new SessionsImportsStartParams(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 StatusMappingValue extends StringEnum { + /** The value {@code "Approved"}. */ + public static final StatusMappingValue APPROVED = new StatusMappingValue("Approved"); + + /** The value {@code "Declined"}. */ + public static final StatusMappingValue DECLINED = new StatusMappingValue("Declined"); + + /** The value {@code "In Review"}. */ + public static final StatusMappingValue IN_REVIEW = new StatusMappingValue("In Review"); + + /** The value {@code "Expired"}. */ + public static final StatusMappingValue EXPIRED = new StatusMappingValue("Expired"); + + /** The value {@code "Not Finished"}. */ + public static final StatusMappingValue NOT_FINISHED = new StatusMappingValue("Not Finished"); + + /** The value {@code "Abandoned"}. */ + public static final StatusMappingValue ABANDONED = new StatusMappingValue("Abandoned"); + + private static final List KNOWN_VALUES = List.of(APPROVED, DECLINED, IN_REVIEW, EXPIRED, NOT_FINISHED, ABANDONED); + + private StatusMappingValue(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 StatusMappingValue of(String value) { + return StringEnum.lookup(KNOWN_VALUES, value, StatusMappingValue::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/WorkflowDetail.java b/src/main/java/me/didit/types/WorkflowDetail.java index 57ad033..15db478 100644 --- a/src/main/java/me/didit/types/WorkflowDetail.java +++ b/src/main/java/me/didit/types/WorkflowDetail.java @@ -19,7 +19,7 @@ * The fields below are typed; the object also carries every other column of the workflow configuration (feature toggles, thresholds, warning actions, allowed documents, callbacks) as additional properties. Fields that do not apply to the workflow_type are null. */ public final class WorkflowDetail extends JsonModel { - private static final Set KNOWN_FIELDS = Set.of("uuid", "workflow_id", "workflow_label", "workflow_type", "is_default", "is_archived", "version", "status", "published_at", "is_simple_workflow", "is_editable", "workflow_url", "workflow_graph", "features", "total_price", "min_price", "max_price", "special_add_on_prices", "max_retry_attempts", "retry_window_days", "session_expiration_time", "questionnaire", "kyb_role_settings", "created_at", "updated_at"); + private static final Set KNOWN_FIELDS = Set.of("uuid", "workflow_id", "workflow_label", "workflow_type", "is_default", "is_archived", "version", "status", "published_at", "is_simple_workflow", "is_editable", "workflow_url", "workflow_graph", "features", "total_price", "min_price", "max_price", "special_add_on_prices", "max_retry_attempts", "retry_window_days", "session_expiration_time", "questionnaire", "kyb_role_settings", "created_at", "updated_at", "is_bank_verification_enabled", "bank_verification_config", "is_geolocation_enabled", "geolocation_config"); private WorkflowDetail(ObjectNode json, Map> files) { super(json, files); @@ -304,6 +304,46 @@ public Optional updatedAt() { return Json.optional(json, "updated_at", Conv.DATE_TIME); } + /** + * Whether a simple KYC or KYB workflow runs Bank verification. It runs after the contact steps and before database validation, AML and IP analysis. Set in the console. + * + * @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 isBankVerificationEnabled() { + return Json.optional(json, "is_bank_verification_enabled", Conv.BOOLEAN); + } + + /** + * Bank verification settings of a simple workflow, with the same keys a BANK_VERIFICATION node takes (for example bank_countries and bank_method_order). Every key is optional and an absent key keeps its default, so {} means all defaults. See [Bank verification settings](/management-api/workflows/feature-configs#bank-verification). + * + * @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> bankVerificationConfig() { + return Json.optional(json, "bank_verification_config", Conv.OBJECT); + } + + /** + * Whether a simple KYC workflow runs Location verification. It runs after the contact steps and before Bank verification. Never on KYB workflows. Set in the console. + * + * @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 isGeolocationEnabled() { + return Json.optional(json, "is_geolocation_enabled", Conv.BOOLEAN); + } + + /** + * Location verification settings of a simple workflow, with the same keys a GEOLOCATION node takes (for example is_geolocation_geofencing_enabled and geolocation_max_attempts). Every key is optional and an absent key keeps its default, so {} means all defaults. + * + * @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> geolocationConfig() { + return Json.optional(json, "geolocation_config", Conv.OBJECT); + } + @Override protected Set knownFields() { return KNOWN_FIELDS; @@ -567,6 +607,46 @@ public Builder updatedAt(OffsetDateTime updatedAt) { return set("updated_at", Conv.DATE_TIME, updatedAt); } + /** + * Whether a simple KYC or KYB workflow runs Bank verification. It runs after the contact steps and before database validation, AML and IP analysis. Set in the console. + * + * @param isBankVerificationEnabled the value + * @return this builder + */ + public Builder isBankVerificationEnabled(boolean isBankVerificationEnabled) { + return set("is_bank_verification_enabled", Conv.BOOLEAN, isBankVerificationEnabled); + } + + /** + * Bank verification settings of a simple workflow, with the same keys a BANK_VERIFICATION node takes (for example bank_countries and bank_method_order). Every key is optional and an absent key keeps its default, so {} means all defaults. See [Bank verification settings](/management-api/workflows/feature-configs#bank-verification). + * + * @param bankVerificationConfig the value + * @return this builder + */ + public Builder bankVerificationConfig(Map bankVerificationConfig) { + return setAny("bank_verification_config", bankVerificationConfig); + } + + /** + * Whether a simple KYC workflow runs Location verification. It runs after the contact steps and before Bank verification. Never on KYB workflows. Set in the console. + * + * @param isGeolocationEnabled the value + * @return this builder + */ + public Builder isGeolocationEnabled(boolean isGeolocationEnabled) { + return set("is_geolocation_enabled", Conv.BOOLEAN, isGeolocationEnabled); + } + + /** + * Location verification settings of a simple workflow, with the same keys a GEOLOCATION node takes (for example is_geolocation_geofencing_enabled and geolocation_max_attempts). Every key is optional and an absent key keeps its default, so {} means all defaults. + * + * @param geolocationConfig the value + * @return this builder + */ + public Builder geolocationConfig(Map geolocationConfig) { + return setAny("geolocation_config", geolocationConfig); + } + /** * Builds the value. * diff --git a/src/test/java/me/didit/resources/PricingResourceTest.java b/src/test/java/me/didit/resources/PricingResourceTest.java new file mode 100644 index 0000000..34c37aa --- /dev/null +++ b/src/test/java/me/didit/resources/PricingResourceTest.java @@ -0,0 +1,40 @@ +// 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 org.junit.jupiter.api.Test; + +/** One test per operation of {@code pricing}, against a stubbed HTTP layer. */ +@SuppressWarnings({"deprecation", "unused"}) +final class PricingResourceTest { + private final MockTransport transport = new MockTransport(); + private final Didit client = transport.client(); + + @Test + void bankVerification() { + JsonNode example = SpecExamples.response("verification.json", "GET", "/v3/organization/bank-verification-pricing/", "200"); + transport.respondJson(200, example); + var result = client.pricing().bankVerification(); + RecordedRequest request = transport.only(); + assertEquals("GET", request.method()); + assertEquals("/v3/organization/bank-verification-pricing/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals(null, request.header("x-api-key")); + assertEquals(null, request.header("Authorization")); + assertEquals(0, request.body().length); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } +} diff --git a/src/test/java/me/didit/resources/SessionsImportsResourceTest.java b/src/test/java/me/didit/resources/SessionsImportsResourceTest.java index 02dd3b1..2a3a55d 100644 --- a/src/test/java/me/didit/resources/SessionsImportsResourceTest.java +++ b/src/test/java/me/didit/resources/SessionsImportsResourceTest.java @@ -15,9 +15,13 @@ import me.didit.testing.SpecExamples; import me.didit.testing.TestJson; import me.didit.testing.TestModels; +import me.didit.types.SessionsImportsCheckProviderParams; import me.didit.types.SessionsImportsCreateParams; import me.didit.types.SessionsImportsListErrorsParams; +import me.didit.types.SessionsImportsListJobsParams; import me.didit.types.SessionsImportsRetrieveTemplateParams; +import me.didit.types.SessionsImportsRetryParams; +import me.didit.types.SessionsImportsStartParams; import org.junit.jupiter.api.Test; /** One test per operation of {@code sessions.imports}, against a stubbed HTTP layer. */ @@ -28,7 +32,7 @@ final class SessionsImportsResourceTest { @Test void create() { - SessionsImportsCreateParams params = SessionsImportsCreateParams.builder().importType(SessionsImportsCreateParams.ImportType.USER_VERIFICATION).workflowId("00000000-0000-4000-8000-000000001b5b").sourceFormat(SessionsImportsCreateParams.SourceFormat.CSV).file(FileUpload.of(new byte[] {37, 80, 68, 70}, "file.pdf", "application/pdf")).sourceFileUrl("https://example.com/callback").build(); + SessionsImportsCreateParams params = SessionsImportsCreateParams.builder().importType(SessionsImportsCreateParams.ImportType.USER_VERIFICATION).workflowId("00000000-0000-4000-8000-000000001b5b").sourceFormat(SessionsImportsCreateParams.SourceFormat.CSV).file(FileUpload.of(new byte[] {37, 80, 68, 70}, "file.pdf", "application/pdf")).sourceFileUrl("https://example.com/callback").source(SessionsImportsCreateParams.Source.FILE).provider(SessionsImportsCreateParams.Provider.SUMSUB).credentials(Map.of("key", "value-credentials")).options(SessionsImportsCreateParams.Options.builder().region("value-region").build()).statusMapping(Map.of("key", SessionsImportsCreateParams.StatusMappingValue.APPROVED)).dryRun(true).faceTemplates(true).lawfulBasisConfirmed(true).build(); JsonNode example = SpecExamples.response("verification.json", "POST", "/v3/session/imports/", "201"); transport.respondJson(201, example); var result = client.sessions().imports().create(params); @@ -38,7 +42,7 @@ void create() { assertEquals(Map.of(), request.query()); assertEquals("test-api-key", request.header("x-api-key")); assertEquals("https://verification.didit.me", request.origin()); - assertEquals(Map.ofEntries(Map.entry("import_type", List.of("user_verification")), Map.entry("workflow_id", List.of("00000000-0000-4000-8000-000000001b5b")), Map.entry("source_format", List.of("csv")), Map.entry("source_file_url", List.of("https://example.com/callback"))), request.multipartFields()); + assertEquals(Map.ofEntries(Map.entry("import_type", List.of("user_verification")), Map.entry("workflow_id", List.of("00000000-0000-4000-8000-000000001b5b")), Map.entry("source_format", List.of("csv")), Map.entry("source_file_url", List.of("https://example.com/callback")), Map.entry("source", List.of("file")), Map.entry("provider", List.of("sumsub")), Map.entry("credentials", List.of("{\"key\":\"value-credentials\"}")), Map.entry("options", List.of("{\"region\":\"value-region\"}")), Map.entry("status_mapping", List.of("{\"key\":\"Approved\"}")), Map.entry("dry_run", List.of("true")), Map.entry("face_templates", List.of("true")), Map.entry("lawful_basis_confirmed", List.of("true"))), request.multipartFields()); assertEquals(Map.ofEntries(Map.entry("file", List.of("file.pdf"))), request.multipartFiles()); TestJson.assertJsonEquals(example, Json.toNode(result)); TestModels.readAll(result); @@ -93,4 +97,153 @@ void listErrors() { assertEquals(example.path("results").size(), result.results().size()); TestModels.readAll(result.results()); } + + @Test + void listProviders() { + JsonNode example = TestJson.parse("{}"); + transport.respondJson(200, example); + var result = client.sessions().imports().listProviders(); + RecordedRequest request = transport.only(); + assertEquals("GET", request.method()); + assertEquals("/v3/session/imports/providers/", 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); + } + + @Test + void checkProvider() { + SessionsImportsCheckProviderParams params = SessionsImportsCheckProviderParams.builder().provider(SessionsImportsCheckProviderParams.Provider.SUMSUB).credentials(Map.of("key", "value-credentials")).options(SessionsImportsCheckProviderParams.Options.builder().region("value-region").build()).recordIds(List.of("value-record-ids")).build(); + JsonNode example = TestJson.parse("{}"); + transport.respondJson(200, example); + var result = client.sessions().imports().checkProvider(params); + RecordedRequest request = transport.only(); + assertEquals("POST", request.method()); + assertEquals("/v3/session/imports/providers/check/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://verification.didit.me", request.origin()); + TestJson.assertJsonEquals("{\"provider\":\"sumsub\",\"credentials\":{\"key\":\"value-credentials\"},\"options\":{\"region\":\"value-region\"},\"record_ids\":[\"value-record-ids\"]}", request.body()); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void start() { + SessionsImportsStartParams params = SessionsImportsStartParams.builder().statusMapping(Map.of("key", SessionsImportsStartParams.StatusMappingValue.APPROVED)).faceTemplates(true).lawfulBasisConfirmed(true).build(); + JsonNode example = TestJson.parse("{\"created_count\":1,\"failed_count\":1,\"import_type\":\"user_verification\",\"processed_rows\":1,\"skipped_count\":1,\"source_filename\":\"value\",\"source_format\":\"csv\",\"status\":\"PENDING\",\"total_rows\":1,\"updated_count\":1,\"uuid\":\"value\"}"); + transport.respondJson(200, example); + var result = client.sessions().imports().start("00000000-0000-4000-8000-00000000be5b", params); + RecordedRequest request = transport.only(); + assertEquals("POST", request.method()); + assertEquals("/v3/session/imports/00000000-0000-4000-8000-00000000be5b/start/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://verification.didit.me", request.origin()); + TestJson.assertJsonEquals("{\"status_mapping\":{\"key\":\"Approved\"},\"face_templates\":true,\"lawful_basis_confirmed\":true}", request.body()); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void pause() { + JsonNode example = TestJson.parse("{\"created_count\":1,\"failed_count\":1,\"import_type\":\"user_verification\",\"processed_rows\":1,\"skipped_count\":1,\"source_filename\":\"value\",\"source_format\":\"csv\",\"status\":\"PENDING\",\"total_rows\":1,\"updated_count\":1,\"uuid\":\"value\"}"); + transport.respondJson(200, example); + var result = client.sessions().imports().pause("00000000-0000-4000-8000-00000000bd17"); + RecordedRequest request = transport.only(); + assertEquals("POST", request.method()); + assertEquals("/v3/session/imports/00000000-0000-4000-8000-00000000bd17/pause/", 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); + } + + @Test + void resume() { + JsonNode example = TestJson.parse("{\"created_count\":1,\"failed_count\":1,\"import_type\":\"user_verification\",\"processed_rows\":1,\"skipped_count\":1,\"source_filename\":\"value\",\"source_format\":\"csv\",\"status\":\"PENDING\",\"total_rows\":1,\"updated_count\":1,\"uuid\":\"value\"}"); + transport.respondJson(200, example); + var result = client.sessions().imports().resume("00000000-0000-4000-8000-00000000ca94"); + RecordedRequest request = transport.only(); + assertEquals("POST", request.method()); + assertEquals("/v3/session/imports/00000000-0000-4000-8000-00000000ca94/resume/", 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); + } + + @Test + void cancel() { + JsonNode example = TestJson.parse("{\"created_count\":1,\"failed_count\":1,\"import_type\":\"user_verification\",\"processed_rows\":1,\"skipped_count\":1,\"source_filename\":\"value\",\"source_format\":\"csv\",\"status\":\"PENDING\",\"total_rows\":1,\"updated_count\":1,\"uuid\":\"value\"}"); + transport.respondJson(200, example); + var result = client.sessions().imports().cancel("00000000-0000-4000-8000-00000000c74d"); + RecordedRequest request = transport.only(); + assertEquals("POST", request.method()); + assertEquals("/v3/session/imports/00000000-0000-4000-8000-00000000c74d/cancel/", 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); + } + + @Test + void retry() { + SessionsImportsRetryParams params = SessionsImportsRetryParams.builder().credentials(Map.of("key", "value-credentials")).file(FileUpload.of(new byte[] {37, 80, 68, 70}, "file.pdf", "application/pdf")).build(); + JsonNode example = TestJson.parse("{\"created_count\":1,\"failed_count\":1,\"import_type\":\"user_verification\",\"processed_rows\":1,\"skipped_count\":1,\"source_filename\":\"value\",\"source_format\":\"csv\",\"status\":\"PENDING\",\"total_rows\":1,\"updated_count\":1,\"uuid\":\"value\"}"); + transport.respondJson(201, example); + var result = client.sessions().imports().retry("00000000-0000-4000-8000-00000000bf16", params); + RecordedRequest request = transport.only(); + assertEquals("POST", request.method()); + assertEquals("/v3/session/imports/00000000-0000-4000-8000-00000000bf16/retry/", request.path()); + assertEquals(Map.of(), request.query()); + assertEquals("test-api-key", request.header("x-api-key")); + assertEquals("https://verification.didit.me", request.origin()); + assertEquals(Map.ofEntries(Map.entry("credentials", List.of("{\"key\":\"value-credentials\"}"))), request.multipartFields()); + assertEquals(Map.ofEntries(Map.entry("file", List.of("file.pdf"))), request.multipartFiles()); + TestJson.assertJsonEquals(example, Json.toNode(result)); + TestModels.readAll(result); + } + + @Test + void listJobs() { + SessionsImportsListJobsParams params = SessionsImportsListJobsParams.builder().scope(SessionsImportsListJobsParams.Scope.ALL).limit(1L).build(); + JsonNode example = TestJson.parse("{}"); + transport.respondJson(200, example); + var result = client.sessions().imports().listJobs(params); + RecordedRequest request = transport.only(); + assertEquals("GET", request.method()); + assertEquals("/v3/import-jobs/", request.path()); + assertEquals(Map.ofEntries(Map.entry("scope", List.of("all")), Map.entry("limit", List.of("1"))), 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); + } + + @Test + void listActiveJobs() { + JsonNode example = TestJson.parse("{}"); + transport.respondJson(200, example); + var result = client.sessions().imports().listActiveJobs(); + RecordedRequest request = transport.only(); + assertEquals("GET", request.method()); + assertEquals("/v3/import-jobs/active/", 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); + } }