From 421d1fa6a4635bc96416e37aa7df4a964437853b Mon Sep 17 00:00:00 2001 From: dvacca-onfido <134616519+dvacca-onfido@users.noreply.github.com> Date: Thu, 2 Jul 2026 14:36:14 +0000 Subject: [PATCH 1/2] Upgrade after onfido-openapi-spec change d9d749d --- .release.json | 8 +- composer.json | 2 +- composer.lock | 2 +- lib/Api/DefaultApi.php | 3401 ++++++++++++----- lib/Configuration.php | 4 +- lib/Model/BiometricToken.php | 412 ++ lib/Model/BiometricTokenData.php | 527 +++ lib/Model/BiometricTokenUpdater.php | 442 +++ lib/Model/BiometricTokensList.php | 412 ++ .../InvalidatedBiometricTokenSummary.php | 412 ++ ...datedBiometricTokenSummaryDeletedItems.php | 413 ++ .../InvalidatedBiometricTokensSummary.php | 412 ++ lib/Model/UpdateBiometricToken200Response.php | 412 ++ lib/Model/Webhook.php | 34 + lib/Model/WebhookBuilder.php | 34 + lib/Model/WebhookCreate.php | 34 + lib/Model/WebhookResponse.php | 34 + lib/Model/WebhookUpdate.php | 34 + lib/Model/WebhookUpdater.php | 34 + 19 files changed, 6129 insertions(+), 934 deletions(-) create mode 100644 lib/Model/BiometricToken.php create mode 100644 lib/Model/BiometricTokenData.php create mode 100644 lib/Model/BiometricTokenUpdater.php create mode 100644 lib/Model/BiometricTokensList.php create mode 100644 lib/Model/InvalidatedBiometricTokenSummary.php create mode 100644 lib/Model/InvalidatedBiometricTokenSummaryDeletedItems.php create mode 100644 lib/Model/InvalidatedBiometricTokensSummary.php create mode 100644 lib/Model/UpdateBiometricToken200Response.php diff --git a/.release.json b/.release.json index 09a5418..4c24b84 100644 --- a/.release.json +++ b/.release.json @@ -1,9 +1,9 @@ { "source": { "repo_url": "https://github.com/onfido/onfido-openapi-spec", - "short_sha": "6a36202", - "long_sha": "6a362029f0a58437e8be7185303ef14d3f342feb", - "version": "v6.1.0" + "short_sha": "d9d749d", + "long_sha": "d9d749dfbd3873524400efe236f7d398bb9e948e", + "version": "v6.2.0" }, - "release": "v10.2.0" + "release": "v10.3.0" } diff --git a/composer.json b/composer.json index 9f0477a..c9cb1b0 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "onfido/onfido-php", - "version": "10.2.0", + "version": "10.3.0", "description": "The Onfido Public API (v3.6)", "keywords": [ "openapitools", diff --git a/composer.lock b/composer.lock index 2b600af..9f61e9d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "efa9c4e7a1c904ac7ad6ea50671dde56", + "content-hash": "7257f64ad8754ddec1072973b9258cec", "packages": [ { "name": "guzzlehttp/guzzle", diff --git a/lib/Api/DefaultApi.php b/lib/Api/DefaultApi.php index 45eaca0..cd9a1f0 100644 --- a/lib/Api/DefaultApi.php +++ b/lib/Api/DefaultApi.php @@ -173,6 +173,9 @@ class DefaultApi 'findApplicantConsents' => [ 'application/json', ], + 'findBiometricToken' => [ + 'application/json', + ], 'findCheck' => [ 'application/json', ], @@ -221,9 +224,18 @@ class DefaultApi 'generateSdkToken' => [ 'application/json', ], + 'invalidateBiometricToken' => [ + 'application/json', + ], + 'invalidateBiometricTokens' => [ + 'application/json', + ], 'listApplicants' => [ 'application/json', ], + 'listBiometricTokens' => [ + 'application/json', + ], 'listChecks' => [ 'application/json', ], @@ -290,6 +302,9 @@ class DefaultApi 'updateApplicant' => [ 'application/json', ], + 'updateBiometricToken' => [ + 'application/json', + ], 'updatePasskey' => [ 'application/json', ], @@ -9691,38 +9706,40 @@ public function findApplicantConsentsRequest($applicant_id, string $contentType } /** - * Operation findCheck + * Operation findBiometricToken * - * Retrieve a Check + * Retrieve biometric token * - * @param string $check_id check_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findCheck'] to see the possible values for this operation + * @param string $user_id Customer user ID that owns the biometric token. (required) + * @param string $token_uuid Biometric token UUID. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findBiometricToken'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Onfido\Model\Check|\Onfido\Model\Error + * @return \Onfido\Model\BiometricToken|\Onfido\Model\Error */ - public function findCheck($check_id, string $contentType = self::contentTypes['findCheck'][0]) + public function findBiometricToken($user_id, $token_uuid, string $contentType = self::contentTypes['findBiometricToken'][0]) { - list($response) = $this->findCheckWithHttpInfo($check_id, $contentType); + list($response) = $this->findBiometricTokenWithHttpInfo($user_id, $token_uuid, $contentType); return $response; } /** - * Operation findCheckWithHttpInfo + * Operation findBiometricTokenWithHttpInfo * - * Retrieve a Check + * Retrieve biometric token * - * @param string $check_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findCheck'] to see the possible values for this operation + * @param string $user_id Customer user ID that owns the biometric token. (required) + * @param string $token_uuid Biometric token UUID. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findBiometricToken'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Onfido\Model\Check|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\BiometricToken|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function findCheckWithHttpInfo($check_id, string $contentType = self::contentTypes['findCheck'][0]) + public function findBiometricTokenWithHttpInfo($user_id, $token_uuid, string $contentType = self::contentTypes['findBiometricToken'][0]) { - $request = $this->findCheckRequest($check_id, $contentType); + $request = $this->findBiometricTokenRequest($user_id, $token_uuid, $contentType); try { $options = $this->createHttpClientOption(); @@ -9750,7 +9767,7 @@ public function findCheckWithHttpInfo($check_id, string $contentType = self::con switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Onfido\Model\Check', + '\Onfido\Model\BiometricToken', $request, $response, ); @@ -9778,7 +9795,7 @@ public function findCheckWithHttpInfo($check_id, string $contentType = self::con } return $this->handleResponseWithDataType( - '\Onfido\Model\Check', + '\Onfido\Model\BiometricToken', $request, $response, ); @@ -9787,7 +9804,7 @@ public function findCheckWithHttpInfo($check_id, string $contentType = self::con case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Onfido\Model\Check', + '\Onfido\Model\BiometricToken', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9808,19 +9825,20 @@ public function findCheckWithHttpInfo($check_id, string $contentType = self::con } /** - * Operation findCheckAsync + * Operation findBiometricTokenAsync * - * Retrieve a Check + * Retrieve biometric token * - * @param string $check_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findCheck'] to see the possible values for this operation + * @param string $user_id Customer user ID that owns the biometric token. (required) + * @param string $token_uuid Biometric token UUID. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findBiometricToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findCheckAsync($check_id, string $contentType = self::contentTypes['findCheck'][0]) + public function findBiometricTokenAsync($user_id, $token_uuid, string $contentType = self::contentTypes['findBiometricToken'][0]) { - return $this->findCheckAsyncWithHttpInfo($check_id, $contentType) + return $this->findBiometricTokenAsyncWithHttpInfo($user_id, $token_uuid, $contentType) ->then( function ($response) { return $response[0]; @@ -9829,20 +9847,21 @@ function ($response) { } /** - * Operation findCheckAsyncWithHttpInfo + * Operation findBiometricTokenAsyncWithHttpInfo * - * Retrieve a Check + * Retrieve biometric token * - * @param string $check_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findCheck'] to see the possible values for this operation + * @param string $user_id Customer user ID that owns the biometric token. (required) + * @param string $token_uuid Biometric token UUID. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findBiometricToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findCheckAsyncWithHttpInfo($check_id, string $contentType = self::contentTypes['findCheck'][0]) + public function findBiometricTokenAsyncWithHttpInfo($user_id, $token_uuid, string $contentType = self::contentTypes['findBiometricToken'][0]) { - $returnType = '\Onfido\Model\Check'; - $request = $this->findCheckRequest($check_id, $contentType); + $returnType = '\Onfido\Model\BiometricToken'; + $request = $this->findBiometricTokenRequest($user_id, $token_uuid, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9881,26 +9900,34 @@ function ($exception) { } /** - * Create request for operation 'findCheck' + * Create request for operation 'findBiometricToken' * - * @param string $check_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findCheck'] to see the possible values for this operation + * @param string $user_id Customer user ID that owns the biometric token. (required) + * @param string $token_uuid Biometric token UUID. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findBiometricToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findCheckRequest($check_id, string $contentType = self::contentTypes['findCheck'][0]) + public function findBiometricTokenRequest($user_id, $token_uuid, string $contentType = self::contentTypes['findBiometricToken'][0]) { - // verify the required parameter 'check_id' is set - if ($check_id === null || (is_array($check_id) && count($check_id) === 0)) { + // verify the required parameter 'user_id' is set + if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $check_id when calling findCheck' + 'Missing the required parameter $user_id when calling findBiometricToken' + ); + } + + // verify the required parameter 'token_uuid' is set + if ($token_uuid === null || (is_array($token_uuid) && count($token_uuid) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $token_uuid when calling findBiometricToken' ); } - $resourcePath = '/checks/{check_id}'; + $resourcePath = '/biometric_tokens/{user_id}/{token_uuid}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9910,10 +9937,18 @@ public function findCheckRequest($check_id, string $contentType = self::contentT // path params - if ($check_id !== null) { + if ($user_id !== null) { $resourcePath = str_replace( - '{' . 'check_id' . '}', - ObjectSerializer::toPathValue($check_id), + '{' . 'user_id' . '}', + ObjectSerializer::toPathValue($user_id), + $resourcePath + ); + } + // path params + if ($token_uuid !== null) { + $resourcePath = str_replace( + '{' . 'token_uuid' . '}', + ObjectSerializer::toPathValue($token_uuid), $resourcePath ); } @@ -9982,38 +10017,38 @@ public function findCheckRequest($check_id, string $contentType = self::contentT } /** - * Operation findDocument + * Operation findCheck * - * Retrieve document + * Retrieve a Check * - * @param string $document_id document_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findDocument'] to see the possible values for this operation + * @param string $check_id check_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findCheck'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Onfido\Model\Document|\Onfido\Model\Error + * @return \Onfido\Model\Check|\Onfido\Model\Error */ - public function findDocument($document_id, string $contentType = self::contentTypes['findDocument'][0]) + public function findCheck($check_id, string $contentType = self::contentTypes['findCheck'][0]) { - list($response) = $this->findDocumentWithHttpInfo($document_id, $contentType); + list($response) = $this->findCheckWithHttpInfo($check_id, $contentType); return $response; } /** - * Operation findDocumentWithHttpInfo + * Operation findCheckWithHttpInfo * - * Retrieve document + * Retrieve a Check * - * @param string $document_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findDocument'] to see the possible values for this operation + * @param string $check_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findCheck'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Onfido\Model\Document|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\Check|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function findDocumentWithHttpInfo($document_id, string $contentType = self::contentTypes['findDocument'][0]) + public function findCheckWithHttpInfo($check_id, string $contentType = self::contentTypes['findCheck'][0]) { - $request = $this->findDocumentRequest($document_id, $contentType); + $request = $this->findCheckRequest($check_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -10041,7 +10076,7 @@ public function findDocumentWithHttpInfo($document_id, string $contentType = sel switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Onfido\Model\Document', + '\Onfido\Model\Check', $request, $response, ); @@ -10069,7 +10104,7 @@ public function findDocumentWithHttpInfo($document_id, string $contentType = sel } return $this->handleResponseWithDataType( - '\Onfido\Model\Document', + '\Onfido\Model\Check', $request, $response, ); @@ -10078,7 +10113,7 @@ public function findDocumentWithHttpInfo($document_id, string $contentType = sel case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Onfido\Model\Document', + '\Onfido\Model\Check', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10099,19 +10134,19 @@ public function findDocumentWithHttpInfo($document_id, string $contentType = sel } /** - * Operation findDocumentAsync + * Operation findCheckAsync * - * Retrieve document + * Retrieve a Check * - * @param string $document_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findDocument'] to see the possible values for this operation + * @param string $check_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findCheck'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findDocumentAsync($document_id, string $contentType = self::contentTypes['findDocument'][0]) + public function findCheckAsync($check_id, string $contentType = self::contentTypes['findCheck'][0]) { - return $this->findDocumentAsyncWithHttpInfo($document_id, $contentType) + return $this->findCheckAsyncWithHttpInfo($check_id, $contentType) ->then( function ($response) { return $response[0]; @@ -10120,20 +10155,20 @@ function ($response) { } /** - * Operation findDocumentAsyncWithHttpInfo + * Operation findCheckAsyncWithHttpInfo * - * Retrieve document + * Retrieve a Check * - * @param string $document_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findDocument'] to see the possible values for this operation + * @param string $check_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findCheck'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findDocumentAsyncWithHttpInfo($document_id, string $contentType = self::contentTypes['findDocument'][0]) + public function findCheckAsyncWithHttpInfo($check_id, string $contentType = self::contentTypes['findCheck'][0]) { - $returnType = '\Onfido\Model\Document'; - $request = $this->findDocumentRequest($document_id, $contentType); + $returnType = '\Onfido\Model\Check'; + $request = $this->findCheckRequest($check_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10172,26 +10207,26 @@ function ($exception) { } /** - * Create request for operation 'findDocument' + * Create request for operation 'findCheck' * - * @param string $document_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findDocument'] to see the possible values for this operation + * @param string $check_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findCheck'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findDocumentRequest($document_id, string $contentType = self::contentTypes['findDocument'][0]) + public function findCheckRequest($check_id, string $contentType = self::contentTypes['findCheck'][0]) { - // verify the required parameter 'document_id' is set - if ($document_id === null || (is_array($document_id) && count($document_id) === 0)) { + // verify the required parameter 'check_id' is set + if ($check_id === null || (is_array($check_id) && count($check_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $document_id when calling findDocument' + 'Missing the required parameter $check_id when calling findCheck' ); } - $resourcePath = '/documents/{document_id}'; + $resourcePath = '/checks/{check_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10201,10 +10236,10 @@ public function findDocumentRequest($document_id, string $contentType = self::co // path params - if ($document_id !== null) { + if ($check_id !== null) { $resourcePath = str_replace( - '{' . 'document_id' . '}', - ObjectSerializer::toPathValue($document_id), + '{' . 'check_id' . '}', + ObjectSerializer::toPathValue($check_id), $resourcePath ); } @@ -10273,38 +10308,38 @@ public function findDocumentRequest($document_id, string $contentType = self::co } /** - * Operation findIdPhoto + * Operation findDocument * - * Retrieve ID photo + * Retrieve document * - * @param string $id_photo_id The ID photo's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findIdPhoto'] to see the possible values for this operation + * @param string $document_id document_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findDocument'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Onfido\Model\IdPhoto|\Onfido\Model\Error + * @return \Onfido\Model\Document|\Onfido\Model\Error */ - public function findIdPhoto($id_photo_id, string $contentType = self::contentTypes['findIdPhoto'][0]) + public function findDocument($document_id, string $contentType = self::contentTypes['findDocument'][0]) { - list($response) = $this->findIdPhotoWithHttpInfo($id_photo_id, $contentType); + list($response) = $this->findDocumentWithHttpInfo($document_id, $contentType); return $response; } /** - * Operation findIdPhotoWithHttpInfo + * Operation findDocumentWithHttpInfo * - * Retrieve ID photo + * Retrieve document * - * @param string $id_photo_id The ID photo's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findIdPhoto'] to see the possible values for this operation + * @param string $document_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findDocument'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Onfido\Model\IdPhoto|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\Document|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function findIdPhotoWithHttpInfo($id_photo_id, string $contentType = self::contentTypes['findIdPhoto'][0]) + public function findDocumentWithHttpInfo($document_id, string $contentType = self::contentTypes['findDocument'][0]) { - $request = $this->findIdPhotoRequest($id_photo_id, $contentType); + $request = $this->findDocumentRequest($document_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -10332,7 +10367,7 @@ public function findIdPhotoWithHttpInfo($id_photo_id, string $contentType = self switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Onfido\Model\IdPhoto', + '\Onfido\Model\Document', $request, $response, ); @@ -10360,7 +10395,7 @@ public function findIdPhotoWithHttpInfo($id_photo_id, string $contentType = self } return $this->handleResponseWithDataType( - '\Onfido\Model\IdPhoto', + '\Onfido\Model\Document', $request, $response, ); @@ -10369,7 +10404,7 @@ public function findIdPhotoWithHttpInfo($id_photo_id, string $contentType = self case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Onfido\Model\IdPhoto', + '\Onfido\Model\Document', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10390,19 +10425,19 @@ public function findIdPhotoWithHttpInfo($id_photo_id, string $contentType = self } /** - * Operation findIdPhotoAsync + * Operation findDocumentAsync * - * Retrieve ID photo + * Retrieve document * - * @param string $id_photo_id The ID photo's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findIdPhoto'] to see the possible values for this operation + * @param string $document_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findDocument'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findIdPhotoAsync($id_photo_id, string $contentType = self::contentTypes['findIdPhoto'][0]) + public function findDocumentAsync($document_id, string $contentType = self::contentTypes['findDocument'][0]) { - return $this->findIdPhotoAsyncWithHttpInfo($id_photo_id, $contentType) + return $this->findDocumentAsyncWithHttpInfo($document_id, $contentType) ->then( function ($response) { return $response[0]; @@ -10411,20 +10446,20 @@ function ($response) { } /** - * Operation findIdPhotoAsyncWithHttpInfo + * Operation findDocumentAsyncWithHttpInfo * - * Retrieve ID photo + * Retrieve document * - * @param string $id_photo_id The ID photo's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findIdPhoto'] to see the possible values for this operation + * @param string $document_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findDocument'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findIdPhotoAsyncWithHttpInfo($id_photo_id, string $contentType = self::contentTypes['findIdPhoto'][0]) + public function findDocumentAsyncWithHttpInfo($document_id, string $contentType = self::contentTypes['findDocument'][0]) { - $returnType = '\Onfido\Model\IdPhoto'; - $request = $this->findIdPhotoRequest($id_photo_id, $contentType); + $returnType = '\Onfido\Model\Document'; + $request = $this->findDocumentRequest($document_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10463,26 +10498,26 @@ function ($exception) { } /** - * Create request for operation 'findIdPhoto' + * Create request for operation 'findDocument' * - * @param string $id_photo_id The ID photo's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findIdPhoto'] to see the possible values for this operation + * @param string $document_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findDocument'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findIdPhotoRequest($id_photo_id, string $contentType = self::contentTypes['findIdPhoto'][0]) + public function findDocumentRequest($document_id, string $contentType = self::contentTypes['findDocument'][0]) { - // verify the required parameter 'id_photo_id' is set - if ($id_photo_id === null || (is_array($id_photo_id) && count($id_photo_id) === 0)) { + // verify the required parameter 'document_id' is set + if ($document_id === null || (is_array($document_id) && count($document_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id_photo_id when calling findIdPhoto' + 'Missing the required parameter $document_id when calling findDocument' ); } - $resourcePath = '/id_photos/{id_photo_id}'; + $resourcePath = '/documents/{document_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10492,10 +10527,10 @@ public function findIdPhotoRequest($id_photo_id, string $contentType = self::con // path params - if ($id_photo_id !== null) { + if ($document_id !== null) { $resourcePath = str_replace( - '{' . 'id_photo_id' . '}', - ObjectSerializer::toPathValue($id_photo_id), + '{' . 'document_id' . '}', + ObjectSerializer::toPathValue($document_id), $resourcePath ); } @@ -10564,38 +10599,38 @@ public function findIdPhotoRequest($id_photo_id, string $contentType = self::con } /** - * Operation findLivePhoto + * Operation findIdPhoto * - * Retrieve live photo + * Retrieve ID photo * - * @param string $live_photo_id The live photo's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLivePhoto'] to see the possible values for this operation + * @param string $id_photo_id The ID photo's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findIdPhoto'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Onfido\Model\LivePhoto|\Onfido\Model\Error + * @return \Onfido\Model\IdPhoto|\Onfido\Model\Error */ - public function findLivePhoto($live_photo_id, string $contentType = self::contentTypes['findLivePhoto'][0]) + public function findIdPhoto($id_photo_id, string $contentType = self::contentTypes['findIdPhoto'][0]) { - list($response) = $this->findLivePhotoWithHttpInfo($live_photo_id, $contentType); + list($response) = $this->findIdPhotoWithHttpInfo($id_photo_id, $contentType); return $response; } /** - * Operation findLivePhotoWithHttpInfo + * Operation findIdPhotoWithHttpInfo * - * Retrieve live photo + * Retrieve ID photo * - * @param string $live_photo_id The live photo's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLivePhoto'] to see the possible values for this operation + * @param string $id_photo_id The ID photo's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findIdPhoto'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Onfido\Model\LivePhoto|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\IdPhoto|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function findLivePhotoWithHttpInfo($live_photo_id, string $contentType = self::contentTypes['findLivePhoto'][0]) + public function findIdPhotoWithHttpInfo($id_photo_id, string $contentType = self::contentTypes['findIdPhoto'][0]) { - $request = $this->findLivePhotoRequest($live_photo_id, $contentType); + $request = $this->findIdPhotoRequest($id_photo_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -10623,7 +10658,7 @@ public function findLivePhotoWithHttpInfo($live_photo_id, string $contentType = switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Onfido\Model\LivePhoto', + '\Onfido\Model\IdPhoto', $request, $response, ); @@ -10651,7 +10686,7 @@ public function findLivePhotoWithHttpInfo($live_photo_id, string $contentType = } return $this->handleResponseWithDataType( - '\Onfido\Model\LivePhoto', + '\Onfido\Model\IdPhoto', $request, $response, ); @@ -10660,7 +10695,7 @@ public function findLivePhotoWithHttpInfo($live_photo_id, string $contentType = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Onfido\Model\LivePhoto', + '\Onfido\Model\IdPhoto', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10681,19 +10716,19 @@ public function findLivePhotoWithHttpInfo($live_photo_id, string $contentType = } /** - * Operation findLivePhotoAsync + * Operation findIdPhotoAsync * - * Retrieve live photo + * Retrieve ID photo * - * @param string $live_photo_id The live photo's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLivePhoto'] to see the possible values for this operation + * @param string $id_photo_id The ID photo's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findIdPhoto'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findLivePhotoAsync($live_photo_id, string $contentType = self::contentTypes['findLivePhoto'][0]) + public function findIdPhotoAsync($id_photo_id, string $contentType = self::contentTypes['findIdPhoto'][0]) { - return $this->findLivePhotoAsyncWithHttpInfo($live_photo_id, $contentType) + return $this->findIdPhotoAsyncWithHttpInfo($id_photo_id, $contentType) ->then( function ($response) { return $response[0]; @@ -10702,20 +10737,20 @@ function ($response) { } /** - * Operation findLivePhotoAsyncWithHttpInfo + * Operation findIdPhotoAsyncWithHttpInfo * - * Retrieve live photo + * Retrieve ID photo * - * @param string $live_photo_id The live photo's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLivePhoto'] to see the possible values for this operation + * @param string $id_photo_id The ID photo's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findIdPhoto'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findLivePhotoAsyncWithHttpInfo($live_photo_id, string $contentType = self::contentTypes['findLivePhoto'][0]) + public function findIdPhotoAsyncWithHttpInfo($id_photo_id, string $contentType = self::contentTypes['findIdPhoto'][0]) { - $returnType = '\Onfido\Model\LivePhoto'; - $request = $this->findLivePhotoRequest($live_photo_id, $contentType); + $returnType = '\Onfido\Model\IdPhoto'; + $request = $this->findIdPhotoRequest($id_photo_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10754,26 +10789,26 @@ function ($exception) { } /** - * Create request for operation 'findLivePhoto' + * Create request for operation 'findIdPhoto' * - * @param string $live_photo_id The live photo's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLivePhoto'] to see the possible values for this operation + * @param string $id_photo_id The ID photo's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findIdPhoto'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findLivePhotoRequest($live_photo_id, string $contentType = self::contentTypes['findLivePhoto'][0]) + public function findIdPhotoRequest($id_photo_id, string $contentType = self::contentTypes['findIdPhoto'][0]) { - // verify the required parameter 'live_photo_id' is set - if ($live_photo_id === null || (is_array($live_photo_id) && count($live_photo_id) === 0)) { + // verify the required parameter 'id_photo_id' is set + if ($id_photo_id === null || (is_array($id_photo_id) && count($id_photo_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $live_photo_id when calling findLivePhoto' + 'Missing the required parameter $id_photo_id when calling findIdPhoto' ); } - $resourcePath = '/live_photos/{live_photo_id}'; + $resourcePath = '/id_photos/{id_photo_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10783,10 +10818,10 @@ public function findLivePhotoRequest($live_photo_id, string $contentType = self: // path params - if ($live_photo_id !== null) { + if ($id_photo_id !== null) { $resourcePath = str_replace( - '{' . 'live_photo_id' . '}', - ObjectSerializer::toPathValue($live_photo_id), + '{' . 'id_photo_id' . '}', + ObjectSerializer::toPathValue($id_photo_id), $resourcePath ); } @@ -10855,38 +10890,38 @@ public function findLivePhotoRequest($live_photo_id, string $contentType = self: } /** - * Operation findLiveVideo + * Operation findLivePhoto * - * Retrieve live video + * Retrieve live photo * - * @param string $live_video_id The live video's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLiveVideo'] to see the possible values for this operation + * @param string $live_photo_id The live photo's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLivePhoto'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Onfido\Model\LiveVideo|\Onfido\Model\Error + * @return \Onfido\Model\LivePhoto|\Onfido\Model\Error */ - public function findLiveVideo($live_video_id, string $contentType = self::contentTypes['findLiveVideo'][0]) + public function findLivePhoto($live_photo_id, string $contentType = self::contentTypes['findLivePhoto'][0]) { - list($response) = $this->findLiveVideoWithHttpInfo($live_video_id, $contentType); + list($response) = $this->findLivePhotoWithHttpInfo($live_photo_id, $contentType); return $response; } /** - * Operation findLiveVideoWithHttpInfo + * Operation findLivePhotoWithHttpInfo * - * Retrieve live video + * Retrieve live photo * - * @param string $live_video_id The live video's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLiveVideo'] to see the possible values for this operation + * @param string $live_photo_id The live photo's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLivePhoto'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Onfido\Model\LiveVideo|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\LivePhoto|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function findLiveVideoWithHttpInfo($live_video_id, string $contentType = self::contentTypes['findLiveVideo'][0]) + public function findLivePhotoWithHttpInfo($live_photo_id, string $contentType = self::contentTypes['findLivePhoto'][0]) { - $request = $this->findLiveVideoRequest($live_video_id, $contentType); + $request = $this->findLivePhotoRequest($live_photo_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -10914,7 +10949,7 @@ public function findLiveVideoWithHttpInfo($live_video_id, string $contentType = switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Onfido\Model\LiveVideo', + '\Onfido\Model\LivePhoto', $request, $response, ); @@ -10942,7 +10977,7 @@ public function findLiveVideoWithHttpInfo($live_video_id, string $contentType = } return $this->handleResponseWithDataType( - '\Onfido\Model\LiveVideo', + '\Onfido\Model\LivePhoto', $request, $response, ); @@ -10951,7 +10986,7 @@ public function findLiveVideoWithHttpInfo($live_video_id, string $contentType = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Onfido\Model\LiveVideo', + '\Onfido\Model\LivePhoto', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10972,19 +11007,19 @@ public function findLiveVideoWithHttpInfo($live_video_id, string $contentType = } /** - * Operation findLiveVideoAsync + * Operation findLivePhotoAsync * - * Retrieve live video + * Retrieve live photo * - * @param string $live_video_id The live video's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLiveVideo'] to see the possible values for this operation + * @param string $live_photo_id The live photo's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLivePhoto'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findLiveVideoAsync($live_video_id, string $contentType = self::contentTypes['findLiveVideo'][0]) + public function findLivePhotoAsync($live_photo_id, string $contentType = self::contentTypes['findLivePhoto'][0]) { - return $this->findLiveVideoAsyncWithHttpInfo($live_video_id, $contentType) + return $this->findLivePhotoAsyncWithHttpInfo($live_photo_id, $contentType) ->then( function ($response) { return $response[0]; @@ -10993,20 +11028,20 @@ function ($response) { } /** - * Operation findLiveVideoAsyncWithHttpInfo + * Operation findLivePhotoAsyncWithHttpInfo * - * Retrieve live video + * Retrieve live photo * - * @param string $live_video_id The live video's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLiveVideo'] to see the possible values for this operation + * @param string $live_photo_id The live photo's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLivePhoto'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findLiveVideoAsyncWithHttpInfo($live_video_id, string $contentType = self::contentTypes['findLiveVideo'][0]) + public function findLivePhotoAsyncWithHttpInfo($live_photo_id, string $contentType = self::contentTypes['findLivePhoto'][0]) { - $returnType = '\Onfido\Model\LiveVideo'; - $request = $this->findLiveVideoRequest($live_video_id, $contentType); + $returnType = '\Onfido\Model\LivePhoto'; + $request = $this->findLivePhotoRequest($live_photo_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11045,26 +11080,26 @@ function ($exception) { } /** - * Create request for operation 'findLiveVideo' + * Create request for operation 'findLivePhoto' * - * @param string $live_video_id The live video's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLiveVideo'] to see the possible values for this operation + * @param string $live_photo_id The live photo's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLivePhoto'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findLiveVideoRequest($live_video_id, string $contentType = self::contentTypes['findLiveVideo'][0]) + public function findLivePhotoRequest($live_photo_id, string $contentType = self::contentTypes['findLivePhoto'][0]) { - // verify the required parameter 'live_video_id' is set - if ($live_video_id === null || (is_array($live_video_id) && count($live_video_id) === 0)) { + // verify the required parameter 'live_photo_id' is set + if ($live_photo_id === null || (is_array($live_photo_id) && count($live_photo_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $live_video_id when calling findLiveVideo' + 'Missing the required parameter $live_photo_id when calling findLivePhoto' ); } - $resourcePath = '/live_videos/{live_video_id}'; + $resourcePath = '/live_photos/{live_photo_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11074,10 +11109,10 @@ public function findLiveVideoRequest($live_video_id, string $contentType = self: // path params - if ($live_video_id !== null) { + if ($live_photo_id !== null) { $resourcePath = str_replace( - '{' . 'live_video_id' . '}', - ObjectSerializer::toPathValue($live_video_id), + '{' . 'live_photo_id' . '}', + ObjectSerializer::toPathValue($live_photo_id), $resourcePath ); } @@ -11146,38 +11181,38 @@ public function findLiveVideoRequest($live_video_id, string $contentType = self: } /** - * Operation findMotionCapture + * Operation findLiveVideo * - * Retrieve motion capture + * Retrieve live video * - * @param string $motion_capture_id The motion capture's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findMotionCapture'] to see the possible values for this operation + * @param string $live_video_id The live video's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLiveVideo'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Onfido\Model\MotionCapture|\Onfido\Model\Error + * @return \Onfido\Model\LiveVideo|\Onfido\Model\Error */ - public function findMotionCapture($motion_capture_id, string $contentType = self::contentTypes['findMotionCapture'][0]) + public function findLiveVideo($live_video_id, string $contentType = self::contentTypes['findLiveVideo'][0]) { - list($response) = $this->findMotionCaptureWithHttpInfo($motion_capture_id, $contentType); + list($response) = $this->findLiveVideoWithHttpInfo($live_video_id, $contentType); return $response; } /** - * Operation findMotionCaptureWithHttpInfo + * Operation findLiveVideoWithHttpInfo * - * Retrieve motion capture + * Retrieve live video * - * @param string $motion_capture_id The motion capture's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findMotionCapture'] to see the possible values for this operation + * @param string $live_video_id The live video's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLiveVideo'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Onfido\Model\MotionCapture|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\LiveVideo|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function findMotionCaptureWithHttpInfo($motion_capture_id, string $contentType = self::contentTypes['findMotionCapture'][0]) + public function findLiveVideoWithHttpInfo($live_video_id, string $contentType = self::contentTypes['findLiveVideo'][0]) { - $request = $this->findMotionCaptureRequest($motion_capture_id, $contentType); + $request = $this->findLiveVideoRequest($live_video_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -11205,7 +11240,7 @@ public function findMotionCaptureWithHttpInfo($motion_capture_id, string $conten switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Onfido\Model\MotionCapture', + '\Onfido\Model\LiveVideo', $request, $response, ); @@ -11233,7 +11268,7 @@ public function findMotionCaptureWithHttpInfo($motion_capture_id, string $conten } return $this->handleResponseWithDataType( - '\Onfido\Model\MotionCapture', + '\Onfido\Model\LiveVideo', $request, $response, ); @@ -11242,7 +11277,7 @@ public function findMotionCaptureWithHttpInfo($motion_capture_id, string $conten case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Onfido\Model\MotionCapture', + '\Onfido\Model\LiveVideo', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11263,19 +11298,19 @@ public function findMotionCaptureWithHttpInfo($motion_capture_id, string $conten } /** - * Operation findMotionCaptureAsync + * Operation findLiveVideoAsync * - * Retrieve motion capture + * Retrieve live video * - * @param string $motion_capture_id The motion capture's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findMotionCapture'] to see the possible values for this operation + * @param string $live_video_id The live video's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLiveVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findMotionCaptureAsync($motion_capture_id, string $contentType = self::contentTypes['findMotionCapture'][0]) + public function findLiveVideoAsync($live_video_id, string $contentType = self::contentTypes['findLiveVideo'][0]) { - return $this->findMotionCaptureAsyncWithHttpInfo($motion_capture_id, $contentType) + return $this->findLiveVideoAsyncWithHttpInfo($live_video_id, $contentType) ->then( function ($response) { return $response[0]; @@ -11284,20 +11319,20 @@ function ($response) { } /** - * Operation findMotionCaptureAsyncWithHttpInfo + * Operation findLiveVideoAsyncWithHttpInfo * - * Retrieve motion capture + * Retrieve live video * - * @param string $motion_capture_id The motion capture's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findMotionCapture'] to see the possible values for this operation + * @param string $live_video_id The live video's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLiveVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findMotionCaptureAsyncWithHttpInfo($motion_capture_id, string $contentType = self::contentTypes['findMotionCapture'][0]) + public function findLiveVideoAsyncWithHttpInfo($live_video_id, string $contentType = self::contentTypes['findLiveVideo'][0]) { - $returnType = '\Onfido\Model\MotionCapture'; - $request = $this->findMotionCaptureRequest($motion_capture_id, $contentType); + $returnType = '\Onfido\Model\LiveVideo'; + $request = $this->findLiveVideoRequest($live_video_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11336,26 +11371,26 @@ function ($exception) { } /** - * Create request for operation 'findMotionCapture' + * Create request for operation 'findLiveVideo' * - * @param string $motion_capture_id The motion capture's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findMotionCapture'] to see the possible values for this operation + * @param string $live_video_id The live video's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findLiveVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findMotionCaptureRequest($motion_capture_id, string $contentType = self::contentTypes['findMotionCapture'][0]) + public function findLiveVideoRequest($live_video_id, string $contentType = self::contentTypes['findLiveVideo'][0]) { - // verify the required parameter 'motion_capture_id' is set - if ($motion_capture_id === null || (is_array($motion_capture_id) && count($motion_capture_id) === 0)) { + // verify the required parameter 'live_video_id' is set + if ($live_video_id === null || (is_array($live_video_id) && count($live_video_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $motion_capture_id when calling findMotionCapture' + 'Missing the required parameter $live_video_id when calling findLiveVideo' ); } - $resourcePath = '/motion_captures/{motion_capture_id}'; + $resourcePath = '/live_videos/{live_video_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11365,10 +11400,10 @@ public function findMotionCaptureRequest($motion_capture_id, string $contentType // path params - if ($motion_capture_id !== null) { + if ($live_video_id !== null) { $resourcePath = str_replace( - '{' . 'motion_capture_id' . '}', - ObjectSerializer::toPathValue($motion_capture_id), + '{' . 'live_video_id' . '}', + ObjectSerializer::toPathValue($live_video_id), $resourcePath ); } @@ -11437,40 +11472,38 @@ public function findMotionCaptureRequest($motion_capture_id, string $contentType } /** - * Operation findPasskey + * Operation findMotionCapture * - * Retrieve passkey + * Retrieve motion capture * - * @param string $username Username that owns the passkey. (required) - * @param string $passkey_id Passkey ID. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPasskey'] to see the possible values for this operation + * @param string $motion_capture_id The motion capture's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findMotionCapture'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Onfido\Model\Passkey|\Onfido\Model\Error + * @return \Onfido\Model\MotionCapture|\Onfido\Model\Error */ - public function findPasskey($username, $passkey_id, string $contentType = self::contentTypes['findPasskey'][0]) + public function findMotionCapture($motion_capture_id, string $contentType = self::contentTypes['findMotionCapture'][0]) { - list($response) = $this->findPasskeyWithHttpInfo($username, $passkey_id, $contentType); + list($response) = $this->findMotionCaptureWithHttpInfo($motion_capture_id, $contentType); return $response; } /** - * Operation findPasskeyWithHttpInfo + * Operation findMotionCaptureWithHttpInfo * - * Retrieve passkey + * Retrieve motion capture * - * @param string $username Username that owns the passkey. (required) - * @param string $passkey_id Passkey ID. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPasskey'] to see the possible values for this operation + * @param string $motion_capture_id The motion capture's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findMotionCapture'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Onfido\Model\Passkey|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\MotionCapture|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function findPasskeyWithHttpInfo($username, $passkey_id, string $contentType = self::contentTypes['findPasskey'][0]) + public function findMotionCaptureWithHttpInfo($motion_capture_id, string $contentType = self::contentTypes['findMotionCapture'][0]) { - $request = $this->findPasskeyRequest($username, $passkey_id, $contentType); + $request = $this->findMotionCaptureRequest($motion_capture_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -11498,7 +11531,7 @@ public function findPasskeyWithHttpInfo($username, $passkey_id, string $contentT switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Onfido\Model\Passkey', + '\Onfido\Model\MotionCapture', $request, $response, ); @@ -11526,7 +11559,7 @@ public function findPasskeyWithHttpInfo($username, $passkey_id, string $contentT } return $this->handleResponseWithDataType( - '\Onfido\Model\Passkey', + '\Onfido\Model\MotionCapture', $request, $response, ); @@ -11535,7 +11568,7 @@ public function findPasskeyWithHttpInfo($username, $passkey_id, string $contentT case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Onfido\Model\Passkey', + '\Onfido\Model\MotionCapture', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11556,20 +11589,19 @@ public function findPasskeyWithHttpInfo($username, $passkey_id, string $contentT } /** - * Operation findPasskeyAsync + * Operation findMotionCaptureAsync * - * Retrieve passkey + * Retrieve motion capture * - * @param string $username Username that owns the passkey. (required) - * @param string $passkey_id Passkey ID. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPasskey'] to see the possible values for this operation + * @param string $motion_capture_id The motion capture's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findMotionCapture'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findPasskeyAsync($username, $passkey_id, string $contentType = self::contentTypes['findPasskey'][0]) + public function findMotionCaptureAsync($motion_capture_id, string $contentType = self::contentTypes['findMotionCapture'][0]) { - return $this->findPasskeyAsyncWithHttpInfo($username, $passkey_id, $contentType) + return $this->findMotionCaptureAsyncWithHttpInfo($motion_capture_id, $contentType) ->then( function ($response) { return $response[0]; @@ -11578,21 +11610,20 @@ function ($response) { } /** - * Operation findPasskeyAsyncWithHttpInfo + * Operation findMotionCaptureAsyncWithHttpInfo * - * Retrieve passkey + * Retrieve motion capture * - * @param string $username Username that owns the passkey. (required) - * @param string $passkey_id Passkey ID. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPasskey'] to see the possible values for this operation + * @param string $motion_capture_id The motion capture's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findMotionCapture'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findPasskeyAsyncWithHttpInfo($username, $passkey_id, string $contentType = self::contentTypes['findPasskey'][0]) + public function findMotionCaptureAsyncWithHttpInfo($motion_capture_id, string $contentType = self::contentTypes['findMotionCapture'][0]) { - $returnType = '\Onfido\Model\Passkey'; - $request = $this->findPasskeyRequest($username, $passkey_id, $contentType); + $returnType = '\Onfido\Model\MotionCapture'; + $request = $this->findMotionCaptureRequest($motion_capture_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11631,34 +11662,26 @@ function ($exception) { } /** - * Create request for operation 'findPasskey' + * Create request for operation 'findMotionCapture' * - * @param string $username Username that owns the passkey. (required) - * @param string $passkey_id Passkey ID. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPasskey'] to see the possible values for this operation + * @param string $motion_capture_id The motion capture's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findMotionCapture'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findPasskeyRequest($username, $passkey_id, string $contentType = self::contentTypes['findPasskey'][0]) + public function findMotionCaptureRequest($motion_capture_id, string $contentType = self::contentTypes['findMotionCapture'][0]) { - // verify the required parameter 'username' is set - if ($username === null || (is_array($username) && count($username) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $username when calling findPasskey' - ); - } - - // verify the required parameter 'passkey_id' is set - if ($passkey_id === null || (is_array($passkey_id) && count($passkey_id) === 0)) { + // verify the required parameter 'motion_capture_id' is set + if ($motion_capture_id === null || (is_array($motion_capture_id) && count($motion_capture_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $passkey_id when calling findPasskey' + 'Missing the required parameter $motion_capture_id when calling findMotionCapture' ); } - $resourcePath = '/passkeys/{username}/{passkey_id}'; + $resourcePath = '/motion_captures/{motion_capture_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11668,18 +11691,10 @@ public function findPasskeyRequest($username, $passkey_id, string $contentType = // path params - if ($username !== null) { - $resourcePath = str_replace( - '{' . 'username' . '}', - ObjectSerializer::toPathValue($username), - $resourcePath - ); - } - // path params - if ($passkey_id !== null) { + if ($motion_capture_id !== null) { $resourcePath = str_replace( - '{' . 'passkey_id' . '}', - ObjectSerializer::toPathValue($passkey_id), + '{' . 'motion_capture_id' . '}', + ObjectSerializer::toPathValue($motion_capture_id), $resourcePath ); } @@ -11748,38 +11763,40 @@ public function findPasskeyRequest($username, $passkey_id, string $contentType = } /** - * Operation findReport + * Operation findPasskey * - * Retrieve report + * Retrieve passkey * - * @param string $report_id report_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findReport'] to see the possible values for this operation + * @param string $username Username that owns the passkey. (required) + * @param string $passkey_id Passkey ID. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPasskey'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Onfido\Model\Report|\Onfido\Model\Error + * @return \Onfido\Model\Passkey|\Onfido\Model\Error */ - public function findReport($report_id, string $contentType = self::contentTypes['findReport'][0]) + public function findPasskey($username, $passkey_id, string $contentType = self::contentTypes['findPasskey'][0]) { - list($response) = $this->findReportWithHttpInfo($report_id, $contentType); + list($response) = $this->findPasskeyWithHttpInfo($username, $passkey_id, $contentType); return $response; } /** - * Operation findReportWithHttpInfo + * Operation findPasskeyWithHttpInfo * - * Retrieve report + * Retrieve passkey * - * @param string $report_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findReport'] to see the possible values for this operation + * @param string $username Username that owns the passkey. (required) + * @param string $passkey_id Passkey ID. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPasskey'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Onfido\Model\Report|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\Passkey|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function findReportWithHttpInfo($report_id, string $contentType = self::contentTypes['findReport'][0]) + public function findPasskeyWithHttpInfo($username, $passkey_id, string $contentType = self::contentTypes['findPasskey'][0]) { - $request = $this->findReportRequest($report_id, $contentType); + $request = $this->findPasskeyRequest($username, $passkey_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -11807,7 +11824,7 @@ public function findReportWithHttpInfo($report_id, string $contentType = self::c switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Onfido\Model\Report', + '\Onfido\Model\Passkey', $request, $response, ); @@ -11835,7 +11852,7 @@ public function findReportWithHttpInfo($report_id, string $contentType = self::c } return $this->handleResponseWithDataType( - '\Onfido\Model\Report', + '\Onfido\Model\Passkey', $request, $response, ); @@ -11844,7 +11861,7 @@ public function findReportWithHttpInfo($report_id, string $contentType = self::c case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Onfido\Model\Report', + '\Onfido\Model\Passkey', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11865,19 +11882,20 @@ public function findReportWithHttpInfo($report_id, string $contentType = self::c } /** - * Operation findReportAsync + * Operation findPasskeyAsync * - * Retrieve report + * Retrieve passkey * - * @param string $report_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findReport'] to see the possible values for this operation + * @param string $username Username that owns the passkey. (required) + * @param string $passkey_id Passkey ID. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPasskey'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findReportAsync($report_id, string $contentType = self::contentTypes['findReport'][0]) + public function findPasskeyAsync($username, $passkey_id, string $contentType = self::contentTypes['findPasskey'][0]) { - return $this->findReportAsyncWithHttpInfo($report_id, $contentType) + return $this->findPasskeyAsyncWithHttpInfo($username, $passkey_id, $contentType) ->then( function ($response) { return $response[0]; @@ -11886,20 +11904,21 @@ function ($response) { } /** - * Operation findReportAsyncWithHttpInfo + * Operation findPasskeyAsyncWithHttpInfo * - * Retrieve report + * Retrieve passkey * - * @param string $report_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findReport'] to see the possible values for this operation + * @param string $username Username that owns the passkey. (required) + * @param string $passkey_id Passkey ID. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPasskey'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findReportAsyncWithHttpInfo($report_id, string $contentType = self::contentTypes['findReport'][0]) + public function findPasskeyAsyncWithHttpInfo($username, $passkey_id, string $contentType = self::contentTypes['findPasskey'][0]) { - $returnType = '\Onfido\Model\Report'; - $request = $this->findReportRequest($report_id, $contentType); + $returnType = '\Onfido\Model\Passkey'; + $request = $this->findPasskeyRequest($username, $passkey_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11938,26 +11957,34 @@ function ($exception) { } /** - * Create request for operation 'findReport' + * Create request for operation 'findPasskey' * - * @param string $report_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findReport'] to see the possible values for this operation + * @param string $username Username that owns the passkey. (required) + * @param string $passkey_id Passkey ID. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findPasskey'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findReportRequest($report_id, string $contentType = self::contentTypes['findReport'][0]) + public function findPasskeyRequest($username, $passkey_id, string $contentType = self::contentTypes['findPasskey'][0]) { - // verify the required parameter 'report_id' is set - if ($report_id === null || (is_array($report_id) && count($report_id) === 0)) { + // verify the required parameter 'username' is set + if ($username === null || (is_array($username) && count($username) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $report_id when calling findReport' + 'Missing the required parameter $username when calling findPasskey' + ); + } + + // verify the required parameter 'passkey_id' is set + if ($passkey_id === null || (is_array($passkey_id) && count($passkey_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $passkey_id when calling findPasskey' ); } - $resourcePath = '/reports/{report_id}'; + $resourcePath = '/passkeys/{username}/{passkey_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11967,10 +11994,18 @@ public function findReportRequest($report_id, string $contentType = self::conten // path params - if ($report_id !== null) { + if ($username !== null) { $resourcePath = str_replace( - '{' . 'report_id' . '}', - ObjectSerializer::toPathValue($report_id), + '{' . 'username' . '}', + ObjectSerializer::toPathValue($username), + $resourcePath + ); + } + // path params + if ($passkey_id !== null) { + $resourcePath = str_replace( + '{' . 'passkey_id' . '}', + ObjectSerializer::toPathValue($passkey_id), $resourcePath ); } @@ -12039,38 +12074,38 @@ public function findReportRequest($report_id, string $contentType = self::conten } /** - * Operation findSigningDocument + * Operation findReport * - * Retrieve signing document + * Retrieve report * - * @param string $signing_document_id signing_document_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findSigningDocument'] to see the possible values for this operation + * @param string $report_id report_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findReport'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Onfido\Model\SigningDocument|\Onfido\Model\Error + * @return \Onfido\Model\Report|\Onfido\Model\Error */ - public function findSigningDocument($signing_document_id, string $contentType = self::contentTypes['findSigningDocument'][0]) + public function findReport($report_id, string $contentType = self::contentTypes['findReport'][0]) { - list($response) = $this->findSigningDocumentWithHttpInfo($signing_document_id, $contentType); + list($response) = $this->findReportWithHttpInfo($report_id, $contentType); return $response; } /** - * Operation findSigningDocumentWithHttpInfo + * Operation findReportWithHttpInfo * - * Retrieve signing document + * Retrieve report * - * @param string $signing_document_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findSigningDocument'] to see the possible values for this operation + * @param string $report_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findReport'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Onfido\Model\SigningDocument|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\Report|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function findSigningDocumentWithHttpInfo($signing_document_id, string $contentType = self::contentTypes['findSigningDocument'][0]) + public function findReportWithHttpInfo($report_id, string $contentType = self::contentTypes['findReport'][0]) { - $request = $this->findSigningDocumentRequest($signing_document_id, $contentType); + $request = $this->findReportRequest($report_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -12098,7 +12133,7 @@ public function findSigningDocumentWithHttpInfo($signing_document_id, string $co switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Onfido\Model\SigningDocument', + '\Onfido\Model\Report', $request, $response, ); @@ -12126,7 +12161,7 @@ public function findSigningDocumentWithHttpInfo($signing_document_id, string $co } return $this->handleResponseWithDataType( - '\Onfido\Model\SigningDocument', + '\Onfido\Model\Report', $request, $response, ); @@ -12135,7 +12170,7 @@ public function findSigningDocumentWithHttpInfo($signing_document_id, string $co case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Onfido\Model\SigningDocument', + '\Onfido\Model\Report', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12156,19 +12191,19 @@ public function findSigningDocumentWithHttpInfo($signing_document_id, string $co } /** - * Operation findSigningDocumentAsync + * Operation findReportAsync * - * Retrieve signing document + * Retrieve report * - * @param string $signing_document_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findSigningDocument'] to see the possible values for this operation + * @param string $report_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findSigningDocumentAsync($signing_document_id, string $contentType = self::contentTypes['findSigningDocument'][0]) + public function findReportAsync($report_id, string $contentType = self::contentTypes['findReport'][0]) { - return $this->findSigningDocumentAsyncWithHttpInfo($signing_document_id, $contentType) + return $this->findReportAsyncWithHttpInfo($report_id, $contentType) ->then( function ($response) { return $response[0]; @@ -12177,20 +12212,20 @@ function ($response) { } /** - * Operation findSigningDocumentAsyncWithHttpInfo + * Operation findReportAsyncWithHttpInfo * - * Retrieve signing document + * Retrieve report * - * @param string $signing_document_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findSigningDocument'] to see the possible values for this operation + * @param string $report_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findSigningDocumentAsyncWithHttpInfo($signing_document_id, string $contentType = self::contentTypes['findSigningDocument'][0]) + public function findReportAsyncWithHttpInfo($report_id, string $contentType = self::contentTypes['findReport'][0]) { - $returnType = '\Onfido\Model\SigningDocument'; - $request = $this->findSigningDocumentRequest($signing_document_id, $contentType); + $returnType = '\Onfido\Model\Report'; + $request = $this->findReportRequest($report_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12229,26 +12264,26 @@ function ($exception) { } /** - * Create request for operation 'findSigningDocument' + * Create request for operation 'findReport' * - * @param string $signing_document_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findSigningDocument'] to see the possible values for this operation + * @param string $report_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findSigningDocumentRequest($signing_document_id, string $contentType = self::contentTypes['findSigningDocument'][0]) + public function findReportRequest($report_id, string $contentType = self::contentTypes['findReport'][0]) { - // verify the required parameter 'signing_document_id' is set - if ($signing_document_id === null || (is_array($signing_document_id) && count($signing_document_id) === 0)) { + // verify the required parameter 'report_id' is set + if ($report_id === null || (is_array($report_id) && count($report_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $signing_document_id when calling findSigningDocument' + 'Missing the required parameter $report_id when calling findReport' ); } - $resourcePath = '/signing_documents/{signing_document_id}'; + $resourcePath = '/reports/{report_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12258,10 +12293,10 @@ public function findSigningDocumentRequest($signing_document_id, string $content // path params - if ($signing_document_id !== null) { + if ($report_id !== null) { $resourcePath = str_replace( - '{' . 'signing_document_id' . '}', - ObjectSerializer::toPathValue($signing_document_id), + '{' . 'report_id' . '}', + ObjectSerializer::toPathValue($report_id), $resourcePath ); } @@ -12330,40 +12365,38 @@ public function findSigningDocumentRequest($signing_document_id, string $content } /** - * Operation findTask + * Operation findSigningDocument * - * Retrieve Task + * Retrieve signing document * - * @param string $workflow_run_id The unique identifier of the Workflow Run to which the Task belongs. (required) - * @param string $task_id The identifier of the Task you want to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTask'] to see the possible values for this operation + * @param string $signing_document_id signing_document_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findSigningDocument'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Onfido\Model\Task|\Onfido\Model\Error + * @return \Onfido\Model\SigningDocument|\Onfido\Model\Error */ - public function findTask($workflow_run_id, $task_id, string $contentType = self::contentTypes['findTask'][0]) + public function findSigningDocument($signing_document_id, string $contentType = self::contentTypes['findSigningDocument'][0]) { - list($response) = $this->findTaskWithHttpInfo($workflow_run_id, $task_id, $contentType); + list($response) = $this->findSigningDocumentWithHttpInfo($signing_document_id, $contentType); return $response; } /** - * Operation findTaskWithHttpInfo + * Operation findSigningDocumentWithHttpInfo * - * Retrieve Task + * Retrieve signing document * - * @param string $workflow_run_id The unique identifier of the Workflow Run to which the Task belongs. (required) - * @param string $task_id The identifier of the Task you want to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTask'] to see the possible values for this operation + * @param string $signing_document_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findSigningDocument'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Onfido\Model\Task|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\SigningDocument|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function findTaskWithHttpInfo($workflow_run_id, $task_id, string $contentType = self::contentTypes['findTask'][0]) + public function findSigningDocumentWithHttpInfo($signing_document_id, string $contentType = self::contentTypes['findSigningDocument'][0]) { - $request = $this->findTaskRequest($workflow_run_id, $task_id, $contentType); + $request = $this->findSigningDocumentRequest($signing_document_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -12391,7 +12424,7 @@ public function findTaskWithHttpInfo($workflow_run_id, $task_id, string $content switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Onfido\Model\Task', + '\Onfido\Model\SigningDocument', $request, $response, ); @@ -12419,7 +12452,7 @@ public function findTaskWithHttpInfo($workflow_run_id, $task_id, string $content } return $this->handleResponseWithDataType( - '\Onfido\Model\Task', + '\Onfido\Model\SigningDocument', $request, $response, ); @@ -12428,7 +12461,7 @@ public function findTaskWithHttpInfo($workflow_run_id, $task_id, string $content case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Onfido\Model\Task', + '\Onfido\Model\SigningDocument', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12449,20 +12482,19 @@ public function findTaskWithHttpInfo($workflow_run_id, $task_id, string $content } /** - * Operation findTaskAsync + * Operation findSigningDocumentAsync * - * Retrieve Task + * Retrieve signing document * - * @param string $workflow_run_id The unique identifier of the Workflow Run to which the Task belongs. (required) - * @param string $task_id The identifier of the Task you want to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTask'] to see the possible values for this operation + * @param string $signing_document_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findSigningDocument'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findTaskAsync($workflow_run_id, $task_id, string $contentType = self::contentTypes['findTask'][0]) + public function findSigningDocumentAsync($signing_document_id, string $contentType = self::contentTypes['findSigningDocument'][0]) { - return $this->findTaskAsyncWithHttpInfo($workflow_run_id, $task_id, $contentType) + return $this->findSigningDocumentAsyncWithHttpInfo($signing_document_id, $contentType) ->then( function ($response) { return $response[0]; @@ -12471,21 +12503,20 @@ function ($response) { } /** - * Operation findTaskAsyncWithHttpInfo + * Operation findSigningDocumentAsyncWithHttpInfo * - * Retrieve Task + * Retrieve signing document * - * @param string $workflow_run_id The unique identifier of the Workflow Run to which the Task belongs. (required) - * @param string $task_id The identifier of the Task you want to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTask'] to see the possible values for this operation + * @param string $signing_document_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findSigningDocument'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findTaskAsyncWithHttpInfo($workflow_run_id, $task_id, string $contentType = self::contentTypes['findTask'][0]) + public function findSigningDocumentAsyncWithHttpInfo($signing_document_id, string $contentType = self::contentTypes['findSigningDocument'][0]) { - $returnType = '\Onfido\Model\Task'; - $request = $this->findTaskRequest($workflow_run_id, $task_id, $contentType); + $returnType = '\Onfido\Model\SigningDocument'; + $request = $this->findSigningDocumentRequest($signing_document_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12524,34 +12555,26 @@ function ($exception) { } /** - * Create request for operation 'findTask' + * Create request for operation 'findSigningDocument' * - * @param string $workflow_run_id The unique identifier of the Workflow Run to which the Task belongs. (required) - * @param string $task_id The identifier of the Task you want to retrieve. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTask'] to see the possible values for this operation + * @param string $signing_document_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findSigningDocument'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findTaskRequest($workflow_run_id, $task_id, string $contentType = self::contentTypes['findTask'][0]) + public function findSigningDocumentRequest($signing_document_id, string $contentType = self::contentTypes['findSigningDocument'][0]) { - // verify the required parameter 'workflow_run_id' is set - if ($workflow_run_id === null || (is_array($workflow_run_id) && count($workflow_run_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $workflow_run_id when calling findTask' - ); - } - - // verify the required parameter 'task_id' is set - if ($task_id === null || (is_array($task_id) && count($task_id) === 0)) { + // verify the required parameter 'signing_document_id' is set + if ($signing_document_id === null || (is_array($signing_document_id) && count($signing_document_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $task_id when calling findTask' + 'Missing the required parameter $signing_document_id when calling findSigningDocument' ); } - $resourcePath = '/workflow_runs/{workflow_run_id}/tasks/{task_id}'; + $resourcePath = '/signing_documents/{signing_document_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12561,18 +12584,10 @@ public function findTaskRequest($workflow_run_id, $task_id, string $contentType // path params - if ($workflow_run_id !== null) { - $resourcePath = str_replace( - '{' . 'workflow_run_id' . '}', - ObjectSerializer::toPathValue($workflow_run_id), - $resourcePath - ); - } - // path params - if ($task_id !== null) { + if ($signing_document_id !== null) { $resourcePath = str_replace( - '{' . 'task_id' . '}', - ObjectSerializer::toPathValue($task_id), + '{' . 'signing_document_id' . '}', + ObjectSerializer::toPathValue($signing_document_id), $resourcePath ); } @@ -12641,40 +12656,40 @@ public function findTaskRequest($workflow_run_id, $task_id, string $contentType } /** - * Operation findTimelineFile + * Operation findTask * - * Retrieve Timeline File for Workflow Run + * Retrieve Task * - * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) - * @param string $timeline_file_id The unique identifier for the Timefile File. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTimelineFile'] to see the possible values for this operation + * @param string $workflow_run_id The unique identifier of the Workflow Run to which the Task belongs. (required) + * @param string $task_id The identifier of the Task you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTask'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return |\SplFileObject|\Onfido\Model\Error + * @return \Onfido\Model\Task|\Onfido\Model\Error */ - public function findTimelineFile($workflow_run_id, $timeline_file_id, string $contentType = self::contentTypes['findTimelineFile'][0]) + public function findTask($workflow_run_id, $task_id, string $contentType = self::contentTypes['findTask'][0]) { - list($response) = $this->findTimelineFileWithHttpInfo($workflow_run_id, $timeline_file_id, $contentType); + list($response) = $this->findTaskWithHttpInfo($workflow_run_id, $task_id, $contentType); return $response; } /** - * Operation findTimelineFileWithHttpInfo + * Operation findTaskWithHttpInfo * - * Retrieve Timeline File for Workflow Run + * Retrieve Task * - * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) - * @param string $timeline_file_id The unique identifier for the Timefile File. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTimelineFile'] to see the possible values for this operation + * @param string $workflow_run_id The unique identifier of the Workflow Run to which the Task belongs. (required) + * @param string $task_id The identifier of the Task you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTask'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of |\SplFileObject|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\Task|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function findTimelineFileWithHttpInfo($workflow_run_id, $timeline_file_id, string $contentType = self::contentTypes['findTimelineFile'][0]) + public function findTaskWithHttpInfo($workflow_run_id, $task_id, string $contentType = self::contentTypes['findTask'][0]) { - $request = $this->findTimelineFileRequest($workflow_run_id, $timeline_file_id, $contentType); + $request = $this->findTaskRequest($workflow_run_id, $task_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -12702,7 +12717,7 @@ public function findTimelineFileWithHttpInfo($workflow_run_id, $timeline_file_id switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\SplFileObject', + '\Onfido\Model\Task', $request, $response, ); @@ -12730,7 +12745,7 @@ public function findTimelineFileWithHttpInfo($workflow_run_id, $timeline_file_id } return $this->handleResponseWithDataType( - '\SplFileObject', + '\Onfido\Model\Task', $request, $response, ); @@ -12739,7 +12754,7 @@ public function findTimelineFileWithHttpInfo($workflow_run_id, $timeline_file_id case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\Onfido\Model\Task', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12760,20 +12775,20 @@ public function findTimelineFileWithHttpInfo($workflow_run_id, $timeline_file_id } /** - * Operation findTimelineFileAsync + * Operation findTaskAsync * - * Retrieve Timeline File for Workflow Run + * Retrieve Task * - * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) - * @param string $timeline_file_id The unique identifier for the Timefile File. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTimelineFile'] to see the possible values for this operation + * @param string $workflow_run_id The unique identifier of the Workflow Run to which the Task belongs. (required) + * @param string $task_id The identifier of the Task you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTask'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findTimelineFileAsync($workflow_run_id, $timeline_file_id, string $contentType = self::contentTypes['findTimelineFile'][0]) + public function findTaskAsync($workflow_run_id, $task_id, string $contentType = self::contentTypes['findTask'][0]) { - return $this->findTimelineFileAsyncWithHttpInfo($workflow_run_id, $timeline_file_id, $contentType) + return $this->findTaskAsyncWithHttpInfo($workflow_run_id, $task_id, $contentType) ->then( function ($response) { return $response[0]; @@ -12782,21 +12797,21 @@ function ($response) { } /** - * Operation findTimelineFileAsyncWithHttpInfo + * Operation findTaskAsyncWithHttpInfo * - * Retrieve Timeline File for Workflow Run + * Retrieve Task * - * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) - * @param string $timeline_file_id The unique identifier for the Timefile File. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTimelineFile'] to see the possible values for this operation + * @param string $workflow_run_id The unique identifier of the Workflow Run to which the Task belongs. (required) + * @param string $task_id The identifier of the Task you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTask'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findTimelineFileAsyncWithHttpInfo($workflow_run_id, $timeline_file_id, string $contentType = self::contentTypes['findTimelineFile'][0]) + public function findTaskAsyncWithHttpInfo($workflow_run_id, $task_id, string $contentType = self::contentTypes['findTask'][0]) { - $returnType = '\SplFileObject'; - $request = $this->findTimelineFileRequest($workflow_run_id, $timeline_file_id, $contentType); + $returnType = '\Onfido\Model\Task'; + $request = $this->findTaskRequest($workflow_run_id, $task_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12835,34 +12850,34 @@ function ($exception) { } /** - * Create request for operation 'findTimelineFile' + * Create request for operation 'findTask' * - * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) - * @param string $timeline_file_id The unique identifier for the Timefile File. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTimelineFile'] to see the possible values for this operation + * @param string $workflow_run_id The unique identifier of the Workflow Run to which the Task belongs. (required) + * @param string $task_id The identifier of the Task you want to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTask'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findTimelineFileRequest($workflow_run_id, $timeline_file_id, string $contentType = self::contentTypes['findTimelineFile'][0]) + public function findTaskRequest($workflow_run_id, $task_id, string $contentType = self::contentTypes['findTask'][0]) { // verify the required parameter 'workflow_run_id' is set if ($workflow_run_id === null || (is_array($workflow_run_id) && count($workflow_run_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $workflow_run_id when calling findTimelineFile' + 'Missing the required parameter $workflow_run_id when calling findTask' ); } - // verify the required parameter 'timeline_file_id' is set - if ($timeline_file_id === null || (is_array($timeline_file_id) && count($timeline_file_id) === 0)) { + // verify the required parameter 'task_id' is set + if ($task_id === null || (is_array($task_id) && count($task_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $timeline_file_id when calling findTimelineFile' + 'Missing the required parameter $task_id when calling findTask' ); } - $resourcePath = '/workflow_runs/{workflow_run_id}/timeline_file/{timeline_file_id}'; + $resourcePath = '/workflow_runs/{workflow_run_id}/tasks/{task_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -12880,17 +12895,17 @@ public function findTimelineFileRequest($workflow_run_id, $timeline_file_id, str ); } // path params - if ($timeline_file_id !== null) { + if ($task_id !== null) { $resourcePath = str_replace( - '{' . 'timeline_file_id' . '}', - ObjectSerializer::toPathValue($timeline_file_id), + '{' . 'task_id' . '}', + ObjectSerializer::toPathValue($task_id), $resourcePath ); } $headers = $this->headerSelector->selectHeaders( - ['application/pdf', 'application/json', ], + ['application/json', ], $contentType, $multipart ); @@ -12952,38 +12967,40 @@ public function findTimelineFileRequest($workflow_run_id, $timeline_file_id, str } /** - * Operation findWatchlistMonitor + * Operation findTimelineFile * - * Retrieve monitor + * Retrieve Timeline File for Workflow Run * - * @param string $monitor_id The watchlist monitor's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWatchlistMonitor'] to see the possible values for this operation + * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) + * @param string $timeline_file_id The unique identifier for the Timefile File. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTimelineFile'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Onfido\Model\WatchlistMonitor|\Onfido\Model\Error + * @return |\SplFileObject|\Onfido\Model\Error */ - public function findWatchlistMonitor($monitor_id, string $contentType = self::contentTypes['findWatchlistMonitor'][0]) + public function findTimelineFile($workflow_run_id, $timeline_file_id, string $contentType = self::contentTypes['findTimelineFile'][0]) { - list($response) = $this->findWatchlistMonitorWithHttpInfo($monitor_id, $contentType); + list($response) = $this->findTimelineFileWithHttpInfo($workflow_run_id, $timeline_file_id, $contentType); return $response; } /** - * Operation findWatchlistMonitorWithHttpInfo + * Operation findTimelineFileWithHttpInfo * - * Retrieve monitor + * Retrieve Timeline File for Workflow Run * - * @param string $monitor_id The watchlist monitor's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWatchlistMonitor'] to see the possible values for this operation + * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) + * @param string $timeline_file_id The unique identifier for the Timefile File. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTimelineFile'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Onfido\Model\WatchlistMonitor|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of |\SplFileObject|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function findWatchlistMonitorWithHttpInfo($monitor_id, string $contentType = self::contentTypes['findWatchlistMonitor'][0]) + public function findTimelineFileWithHttpInfo($workflow_run_id, $timeline_file_id, string $contentType = self::contentTypes['findTimelineFile'][0]) { - $request = $this->findWatchlistMonitorRequest($monitor_id, $contentType); + $request = $this->findTimelineFileRequest($workflow_run_id, $timeline_file_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -13011,7 +13028,7 @@ public function findWatchlistMonitorWithHttpInfo($monitor_id, string $contentTyp switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Onfido\Model\WatchlistMonitor', + '\SplFileObject', $request, $response, ); @@ -13039,7 +13056,7 @@ public function findWatchlistMonitorWithHttpInfo($monitor_id, string $contentTyp } return $this->handleResponseWithDataType( - '\Onfido\Model\WatchlistMonitor', + '\SplFileObject', $request, $response, ); @@ -13048,7 +13065,7 @@ public function findWatchlistMonitorWithHttpInfo($monitor_id, string $contentTyp case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Onfido\Model\WatchlistMonitor', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13069,19 +13086,20 @@ public function findWatchlistMonitorWithHttpInfo($monitor_id, string $contentTyp } /** - * Operation findWatchlistMonitorAsync + * Operation findTimelineFileAsync * - * Retrieve monitor + * Retrieve Timeline File for Workflow Run * - * @param string $monitor_id The watchlist monitor's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWatchlistMonitor'] to see the possible values for this operation + * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) + * @param string $timeline_file_id The unique identifier for the Timefile File. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTimelineFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findWatchlistMonitorAsync($monitor_id, string $contentType = self::contentTypes['findWatchlistMonitor'][0]) + public function findTimelineFileAsync($workflow_run_id, $timeline_file_id, string $contentType = self::contentTypes['findTimelineFile'][0]) { - return $this->findWatchlistMonitorAsyncWithHttpInfo($monitor_id, $contentType) + return $this->findTimelineFileAsyncWithHttpInfo($workflow_run_id, $timeline_file_id, $contentType) ->then( function ($response) { return $response[0]; @@ -13090,20 +13108,21 @@ function ($response) { } /** - * Operation findWatchlistMonitorAsyncWithHttpInfo + * Operation findTimelineFileAsyncWithHttpInfo * - * Retrieve monitor + * Retrieve Timeline File for Workflow Run * - * @param string $monitor_id The watchlist monitor's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWatchlistMonitor'] to see the possible values for this operation + * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) + * @param string $timeline_file_id The unique identifier for the Timefile File. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTimelineFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findWatchlistMonitorAsyncWithHttpInfo($monitor_id, string $contentType = self::contentTypes['findWatchlistMonitor'][0]) + public function findTimelineFileAsyncWithHttpInfo($workflow_run_id, $timeline_file_id, string $contentType = self::contentTypes['findTimelineFile'][0]) { - $returnType = '\Onfido\Model\WatchlistMonitor'; - $request = $this->findWatchlistMonitorRequest($monitor_id, $contentType); + $returnType = '\SplFileObject'; + $request = $this->findTimelineFileRequest($workflow_run_id, $timeline_file_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13142,26 +13161,34 @@ function ($exception) { } /** - * Create request for operation 'findWatchlistMonitor' - * - * @param string $monitor_id The watchlist monitor's unique identifier. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWatchlistMonitor'] to see the possible values for this operation + * Create request for operation 'findTimelineFile' * - * @throws \InvalidArgumentException + * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) + * @param string $timeline_file_id The unique identifier for the Timefile File. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findTimelineFile'] to see the possible values for this operation + * + * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findWatchlistMonitorRequest($monitor_id, string $contentType = self::contentTypes['findWatchlistMonitor'][0]) + public function findTimelineFileRequest($workflow_run_id, $timeline_file_id, string $contentType = self::contentTypes['findTimelineFile'][0]) { - // verify the required parameter 'monitor_id' is set - if ($monitor_id === null || (is_array($monitor_id) && count($monitor_id) === 0)) { + // verify the required parameter 'workflow_run_id' is set + if ($workflow_run_id === null || (is_array($workflow_run_id) && count($workflow_run_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $monitor_id when calling findWatchlistMonitor' + 'Missing the required parameter $workflow_run_id when calling findTimelineFile' + ); + } + + // verify the required parameter 'timeline_file_id' is set + if ($timeline_file_id === null || (is_array($timeline_file_id) && count($timeline_file_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $timeline_file_id when calling findTimelineFile' ); } - $resourcePath = '/watchlist_monitors/{monitor_id}'; + $resourcePath = '/workflow_runs/{workflow_run_id}/timeline_file/{timeline_file_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13171,17 +13198,25 @@ public function findWatchlistMonitorRequest($monitor_id, string $contentType = s // path params - if ($monitor_id !== null) { + if ($workflow_run_id !== null) { $resourcePath = str_replace( - '{' . 'monitor_id' . '}', - ObjectSerializer::toPathValue($monitor_id), + '{' . 'workflow_run_id' . '}', + ObjectSerializer::toPathValue($workflow_run_id), + $resourcePath + ); + } + // path params + if ($timeline_file_id !== null) { + $resourcePath = str_replace( + '{' . 'timeline_file_id' . '}', + ObjectSerializer::toPathValue($timeline_file_id), $resourcePath ); } $headers = $this->headerSelector->selectHeaders( - ['application/json', ], + ['application/pdf', 'application/json', ], $contentType, $multipart ); @@ -13243,38 +13278,38 @@ public function findWatchlistMonitorRequest($monitor_id, string $contentType = s } /** - * Operation findWebhook + * Operation findWatchlistMonitor * - * Retrieve a Webhook + * Retrieve monitor * - * @param string $webhook_id webhook_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWebhook'] to see the possible values for this operation + * @param string $monitor_id The watchlist monitor's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWatchlistMonitor'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Onfido\Model\Webhook|\Onfido\Model\Error + * @return \Onfido\Model\WatchlistMonitor|\Onfido\Model\Error */ - public function findWebhook($webhook_id, string $contentType = self::contentTypes['findWebhook'][0]) + public function findWatchlistMonitor($monitor_id, string $contentType = self::contentTypes['findWatchlistMonitor'][0]) { - list($response) = $this->findWebhookWithHttpInfo($webhook_id, $contentType); + list($response) = $this->findWatchlistMonitorWithHttpInfo($monitor_id, $contentType); return $response; } /** - * Operation findWebhookWithHttpInfo + * Operation findWatchlistMonitorWithHttpInfo * - * Retrieve a Webhook + * Retrieve monitor * - * @param string $webhook_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWebhook'] to see the possible values for this operation + * @param string $monitor_id The watchlist monitor's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWatchlistMonitor'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Onfido\Model\Webhook|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\WatchlistMonitor|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function findWebhookWithHttpInfo($webhook_id, string $contentType = self::contentTypes['findWebhook'][0]) + public function findWatchlistMonitorWithHttpInfo($monitor_id, string $contentType = self::contentTypes['findWatchlistMonitor'][0]) { - $request = $this->findWebhookRequest($webhook_id, $contentType); + $request = $this->findWatchlistMonitorRequest($monitor_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -13302,7 +13337,7 @@ public function findWebhookWithHttpInfo($webhook_id, string $contentType = self: switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Onfido\Model\Webhook', + '\Onfido\Model\WatchlistMonitor', $request, $response, ); @@ -13330,7 +13365,7 @@ public function findWebhookWithHttpInfo($webhook_id, string $contentType = self: } return $this->handleResponseWithDataType( - '\Onfido\Model\Webhook', + '\Onfido\Model\WatchlistMonitor', $request, $response, ); @@ -13339,7 +13374,7 @@ public function findWebhookWithHttpInfo($webhook_id, string $contentType = self: case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Onfido\Model\Webhook', + '\Onfido\Model\WatchlistMonitor', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13360,19 +13395,19 @@ public function findWebhookWithHttpInfo($webhook_id, string $contentType = self: } /** - * Operation findWebhookAsync + * Operation findWatchlistMonitorAsync * - * Retrieve a Webhook + * Retrieve monitor * - * @param string $webhook_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWebhook'] to see the possible values for this operation + * @param string $monitor_id The watchlist monitor's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWatchlistMonitor'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findWebhookAsync($webhook_id, string $contentType = self::contentTypes['findWebhook'][0]) + public function findWatchlistMonitorAsync($monitor_id, string $contentType = self::contentTypes['findWatchlistMonitor'][0]) { - return $this->findWebhookAsyncWithHttpInfo($webhook_id, $contentType) + return $this->findWatchlistMonitorAsyncWithHttpInfo($monitor_id, $contentType) ->then( function ($response) { return $response[0]; @@ -13381,20 +13416,20 @@ function ($response) { } /** - * Operation findWebhookAsyncWithHttpInfo + * Operation findWatchlistMonitorAsyncWithHttpInfo * - * Retrieve a Webhook + * Retrieve monitor * - * @param string $webhook_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWebhook'] to see the possible values for this operation + * @param string $monitor_id The watchlist monitor's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWatchlistMonitor'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findWebhookAsyncWithHttpInfo($webhook_id, string $contentType = self::contentTypes['findWebhook'][0]) + public function findWatchlistMonitorAsyncWithHttpInfo($monitor_id, string $contentType = self::contentTypes['findWatchlistMonitor'][0]) { - $returnType = '\Onfido\Model\Webhook'; - $request = $this->findWebhookRequest($webhook_id, $contentType); + $returnType = '\Onfido\Model\WatchlistMonitor'; + $request = $this->findWatchlistMonitorRequest($monitor_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13433,26 +13468,26 @@ function ($exception) { } /** - * Create request for operation 'findWebhook' + * Create request for operation 'findWatchlistMonitor' * - * @param string $webhook_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWebhook'] to see the possible values for this operation + * @param string $monitor_id The watchlist monitor's unique identifier. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWatchlistMonitor'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findWebhookRequest($webhook_id, string $contentType = self::contentTypes['findWebhook'][0]) + public function findWatchlistMonitorRequest($monitor_id, string $contentType = self::contentTypes['findWatchlistMonitor'][0]) { - // verify the required parameter 'webhook_id' is set - if ($webhook_id === null || (is_array($webhook_id) && count($webhook_id) === 0)) { + // verify the required parameter 'monitor_id' is set + if ($monitor_id === null || (is_array($monitor_id) && count($monitor_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $webhook_id when calling findWebhook' + 'Missing the required parameter $monitor_id when calling findWatchlistMonitor' ); } - $resourcePath = '/webhooks/{webhook_id}'; + $resourcePath = '/watchlist_monitors/{monitor_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13462,10 +13497,10 @@ public function findWebhookRequest($webhook_id, string $contentType = self::cont // path params - if ($webhook_id !== null) { + if ($monitor_id !== null) { $resourcePath = str_replace( - '{' . 'webhook_id' . '}', - ObjectSerializer::toPathValue($webhook_id), + '{' . 'monitor_id' . '}', + ObjectSerializer::toPathValue($monitor_id), $resourcePath ); } @@ -13534,38 +13569,38 @@ public function findWebhookRequest($webhook_id, string $contentType = self::cont } /** - * Operation findWorkflowRun + * Operation findWebhook * - * Retrieve Workflow Run + * Retrieve a Webhook * - * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWorkflowRun'] to see the possible values for this operation + * @param string $webhook_id webhook_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWebhook'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Onfido\Model\WorkflowRun|\Onfido\Model\Error + * @return \Onfido\Model\Webhook|\Onfido\Model\Error */ - public function findWorkflowRun($workflow_run_id, string $contentType = self::contentTypes['findWorkflowRun'][0]) + public function findWebhook($webhook_id, string $contentType = self::contentTypes['findWebhook'][0]) { - list($response) = $this->findWorkflowRunWithHttpInfo($workflow_run_id, $contentType); + list($response) = $this->findWebhookWithHttpInfo($webhook_id, $contentType); return $response; } /** - * Operation findWorkflowRunWithHttpInfo + * Operation findWebhookWithHttpInfo * - * Retrieve Workflow Run + * Retrieve a Webhook * - * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWorkflowRun'] to see the possible values for this operation + * @param string $webhook_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWebhook'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Onfido\Model\WorkflowRun|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\Webhook|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function findWorkflowRunWithHttpInfo($workflow_run_id, string $contentType = self::contentTypes['findWorkflowRun'][0]) + public function findWebhookWithHttpInfo($webhook_id, string $contentType = self::contentTypes['findWebhook'][0]) { - $request = $this->findWorkflowRunRequest($workflow_run_id, $contentType); + $request = $this->findWebhookRequest($webhook_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -13593,7 +13628,7 @@ public function findWorkflowRunWithHttpInfo($workflow_run_id, string $contentTyp switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Onfido\Model\WorkflowRun', + '\Onfido\Model\Webhook', $request, $response, ); @@ -13621,7 +13656,7 @@ public function findWorkflowRunWithHttpInfo($workflow_run_id, string $contentTyp } return $this->handleResponseWithDataType( - '\Onfido\Model\WorkflowRun', + '\Onfido\Model\Webhook', $request, $response, ); @@ -13630,7 +13665,7 @@ public function findWorkflowRunWithHttpInfo($workflow_run_id, string $contentTyp case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Onfido\Model\WorkflowRun', + '\Onfido\Model\Webhook', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13651,19 +13686,19 @@ public function findWorkflowRunWithHttpInfo($workflow_run_id, string $contentTyp } /** - * Operation findWorkflowRunAsync + * Operation findWebhookAsync * - * Retrieve Workflow Run + * Retrieve a Webhook * - * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWorkflowRun'] to see the possible values for this operation + * @param string $webhook_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWebhook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findWorkflowRunAsync($workflow_run_id, string $contentType = self::contentTypes['findWorkflowRun'][0]) + public function findWebhookAsync($webhook_id, string $contentType = self::contentTypes['findWebhook'][0]) { - return $this->findWorkflowRunAsyncWithHttpInfo($workflow_run_id, $contentType) + return $this->findWebhookAsyncWithHttpInfo($webhook_id, $contentType) ->then( function ($response) { return $response[0]; @@ -13672,20 +13707,20 @@ function ($response) { } /** - * Operation findWorkflowRunAsyncWithHttpInfo + * Operation findWebhookAsyncWithHttpInfo * - * Retrieve Workflow Run + * Retrieve a Webhook * - * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWorkflowRun'] to see the possible values for this operation + * @param string $webhook_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWebhook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findWorkflowRunAsyncWithHttpInfo($workflow_run_id, string $contentType = self::contentTypes['findWorkflowRun'][0]) + public function findWebhookAsyncWithHttpInfo($webhook_id, string $contentType = self::contentTypes['findWebhook'][0]) { - $returnType = '\Onfido\Model\WorkflowRun'; - $request = $this->findWorkflowRunRequest($workflow_run_id, $contentType); + $returnType = '\Onfido\Model\Webhook'; + $request = $this->findWebhookRequest($webhook_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13724,26 +13759,26 @@ function ($exception) { } /** - * Create request for operation 'findWorkflowRun' + * Create request for operation 'findWebhook' * - * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWorkflowRun'] to see the possible values for this operation + * @param string $webhook_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWebhook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findWorkflowRunRequest($workflow_run_id, string $contentType = self::contentTypes['findWorkflowRun'][0]) + public function findWebhookRequest($webhook_id, string $contentType = self::contentTypes['findWebhook'][0]) { - // verify the required parameter 'workflow_run_id' is set - if ($workflow_run_id === null || (is_array($workflow_run_id) && count($workflow_run_id) === 0)) { + // verify the required parameter 'webhook_id' is set + if ($webhook_id === null || (is_array($webhook_id) && count($webhook_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $workflow_run_id when calling findWorkflowRun' + 'Missing the required parameter $webhook_id when calling findWebhook' ); } - $resourcePath = '/workflow_runs/{workflow_run_id}'; + $resourcePath = '/webhooks/{webhook_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13753,10 +13788,10 @@ public function findWorkflowRunRequest($workflow_run_id, string $contentType = s // path params - if ($workflow_run_id !== null) { + if ($webhook_id !== null) { $resourcePath = str_replace( - '{' . 'workflow_run_id' . '}', - ObjectSerializer::toPathValue($workflow_run_id), + '{' . 'webhook_id' . '}', + ObjectSerializer::toPathValue($webhook_id), $resourcePath ); } @@ -13825,37 +13860,38 @@ public function findWorkflowRunRequest($workflow_run_id, string $contentType = s } /** - * Operation forceReportCreationFromWatchlistMonitor + * Operation findWorkflowRun * - * Force new report creation (BETA) + * Retrieve Workflow Run * - * @param string $monitor_id monitor_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forceReportCreationFromWatchlistMonitor'] to see the possible values for this operation + * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWorkflowRun'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return void + * @return \Onfido\Model\WorkflowRun|\Onfido\Model\Error */ - public function forceReportCreationFromWatchlistMonitor($monitor_id, string $contentType = self::contentTypes['forceReportCreationFromWatchlistMonitor'][0]) + public function findWorkflowRun($workflow_run_id, string $contentType = self::contentTypes['findWorkflowRun'][0]) { - $this->forceReportCreationFromWatchlistMonitorWithHttpInfo($monitor_id, $contentType); + list($response) = $this->findWorkflowRunWithHttpInfo($workflow_run_id, $contentType); + return $response; } /** - * Operation forceReportCreationFromWatchlistMonitorWithHttpInfo + * Operation findWorkflowRunWithHttpInfo * - * Force new report creation (BETA) + * Retrieve Workflow Run * - * @param string $monitor_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forceReportCreationFromWatchlistMonitor'] to see the possible values for this operation + * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWorkflowRun'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\WorkflowRun|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function forceReportCreationFromWatchlistMonitorWithHttpInfo($monitor_id, string $contentType = self::contentTypes['forceReportCreationFromWatchlistMonitor'][0]) + public function findWorkflowRunWithHttpInfo($workflow_run_id, string $contentType = self::contentTypes['findWorkflowRun'][0]) { - $request = $this->forceReportCreationFromWatchlistMonitorRequest($monitor_id, $contentType); + $request = $this->findWorkflowRunRequest($workflow_run_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -13880,38 +13916,1207 @@ public function forceReportCreationFromWatchlistMonitorWithHttpInfo($monitor_id, $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { - switch ($e->getCode()) { + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\Onfido\Model\WorkflowRun', + $request, + $response, + ); default: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), + return $this->handleResponseWithDataType( '\Onfido\Model\Error', - $e->getResponseHeaders() + $request, + $response, ); - $e->setResponseObject($data); - throw $e; } - - throw $e; - } - } + - /** - * Operation forceReportCreationFromWatchlistMonitorAsync + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\Onfido\Model\WorkflowRun', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Onfido\Model\WorkflowRun', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Onfido\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation findWorkflowRunAsync + * + * Retrieve Workflow Run + * + * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWorkflowRun'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function findWorkflowRunAsync($workflow_run_id, string $contentType = self::contentTypes['findWorkflowRun'][0]) + { + return $this->findWorkflowRunAsyncWithHttpInfo($workflow_run_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation findWorkflowRunAsyncWithHttpInfo + * + * Retrieve Workflow Run + * + * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWorkflowRun'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function findWorkflowRunAsyncWithHttpInfo($workflow_run_id, string $contentType = self::contentTypes['findWorkflowRun'][0]) + { + $returnType = '\Onfido\Model\WorkflowRun'; + $request = $this->findWorkflowRunRequest($workflow_run_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'findWorkflowRun' + * + * @param string $workflow_run_id The unique identifier of the Workflow Run. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findWorkflowRun'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function findWorkflowRunRequest($workflow_run_id, string $contentType = self::contentTypes['findWorkflowRun'][0]) + { + + // verify the required parameter 'workflow_run_id' is set + if ($workflow_run_id === null || (is_array($workflow_run_id) && count($workflow_run_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $workflow_run_id when calling findWorkflowRun' + ); + } + + + $resourcePath = '/workflow_runs/{workflow_run_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($workflow_run_id !== null) { + $resourcePath = str_replace( + '{' . 'workflow_run_id' . '}', + ObjectSerializer::toPathValue($workflow_run_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation forceReportCreationFromWatchlistMonitor + * + * Force new report creation (BETA) + * + * @param string $monitor_id monitor_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forceReportCreationFromWatchlistMonitor'] to see the possible values for this operation + * + * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function forceReportCreationFromWatchlistMonitor($monitor_id, string $contentType = self::contentTypes['forceReportCreationFromWatchlistMonitor'][0]) + { + $this->forceReportCreationFromWatchlistMonitorWithHttpInfo($monitor_id, $contentType); + } + + /** + * Operation forceReportCreationFromWatchlistMonitorWithHttpInfo + * + * Force new report creation (BETA) + * + * @param string $monitor_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forceReportCreationFromWatchlistMonitor'] to see the possible values for this operation + * + * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function forceReportCreationFromWatchlistMonitorWithHttpInfo($monitor_id, string $contentType = self::contentTypes['forceReportCreationFromWatchlistMonitor'][0]) + { + $request = $this->forceReportCreationFromWatchlistMonitorRequest($monitor_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Onfido\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation forceReportCreationFromWatchlistMonitorAsync + * + * Force new report creation (BETA) + * + * @param string $monitor_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forceReportCreationFromWatchlistMonitor'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forceReportCreationFromWatchlistMonitorAsync($monitor_id, string $contentType = self::contentTypes['forceReportCreationFromWatchlistMonitor'][0]) + { + return $this->forceReportCreationFromWatchlistMonitorAsyncWithHttpInfo($monitor_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation forceReportCreationFromWatchlistMonitorAsyncWithHttpInfo + * + * Force new report creation (BETA) + * + * @param string $monitor_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forceReportCreationFromWatchlistMonitor'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function forceReportCreationFromWatchlistMonitorAsyncWithHttpInfo($monitor_id, string $contentType = self::contentTypes['forceReportCreationFromWatchlistMonitor'][0]) + { + $returnType = ''; + $request = $this->forceReportCreationFromWatchlistMonitorRequest($monitor_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'forceReportCreationFromWatchlistMonitor' + * + * @param string $monitor_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forceReportCreationFromWatchlistMonitor'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function forceReportCreationFromWatchlistMonitorRequest($monitor_id, string $contentType = self::contentTypes['forceReportCreationFromWatchlistMonitor'][0]) + { + + // verify the required parameter 'monitor_id' is set + if ($monitor_id === null || (is_array($monitor_id) && count($monitor_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $monitor_id when calling forceReportCreationFromWatchlistMonitor' + ); + } + + + $resourcePath = '/watchlist_monitors/{monitor_id}/new_report'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($monitor_id !== null) { + $resourcePath = str_replace( + '{' . 'monitor_id' . '}', + ObjectSerializer::toPathValue($monitor_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation generateSdkToken + * + * Generate a SDK token + * + * @param \Onfido\Model\SdkTokenBuilder $sdk_token_builder sdk_token_builder (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSdkToken'] to see the possible values for this operation + * + * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \Onfido\Model\SdkToken|\Onfido\Model\Error + */ + public function generateSdkToken($sdk_token_builder, string $contentType = self::contentTypes['generateSdkToken'][0]) + { + list($response) = $this->generateSdkTokenWithHttpInfo($sdk_token_builder, $contentType); + return $response; + } + + /** + * Operation generateSdkTokenWithHttpInfo + * + * Generate a SDK token + * + * @param \Onfido\Model\SdkTokenBuilder $sdk_token_builder (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSdkToken'] to see the possible values for this operation + * + * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \Onfido\Model\SdkToken|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + */ + public function generateSdkTokenWithHttpInfo($sdk_token_builder, string $contentType = self::contentTypes['generateSdkToken'][0]) + { + $request = $this->generateSdkTokenRequest($sdk_token_builder, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\Onfido\Model\SdkToken', + $request, + $response, + ); + default: + return $this->handleResponseWithDataType( + '\Onfido\Model\Error', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\Onfido\Model\SdkToken', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Onfido\Model\SdkToken', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Onfido\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation generateSdkTokenAsync + * + * Generate a SDK token + * + * @param \Onfido\Model\SdkTokenBuilder $sdk_token_builder (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSdkToken'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateSdkTokenAsync($sdk_token_builder, string $contentType = self::contentTypes['generateSdkToken'][0]) + { + return $this->generateSdkTokenAsyncWithHttpInfo($sdk_token_builder, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation generateSdkTokenAsyncWithHttpInfo + * + * Generate a SDK token + * + * @param \Onfido\Model\SdkTokenBuilder $sdk_token_builder (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSdkToken'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function generateSdkTokenAsyncWithHttpInfo($sdk_token_builder, string $contentType = self::contentTypes['generateSdkToken'][0]) + { + $returnType = '\Onfido\Model\SdkToken'; + $request = $this->generateSdkTokenRequest($sdk_token_builder, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'generateSdkToken' + * + * @param \Onfido\Model\SdkTokenBuilder $sdk_token_builder (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSdkToken'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function generateSdkTokenRequest($sdk_token_builder, string $contentType = self::contentTypes['generateSdkToken'][0]) + { + + // verify the required parameter 'sdk_token_builder' is set + if ($sdk_token_builder === null || (is_array($sdk_token_builder) && count($sdk_token_builder) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sdk_token_builder when calling generateSdkToken' + ); + } + + + $resourcePath = '/sdk_token'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($sdk_token_builder)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($sdk_token_builder)); + } else { + $httpBody = $sdk_token_builder; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation invalidateBiometricToken + * + * Invalidate biometric token + * + * @param string $user_id Customer user ID that owns the biometric token. (required) + * @param string $token_uuid Biometric token UUID. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['invalidateBiometricToken'] to see the possible values for this operation + * + * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \Onfido\Model\InvalidatedBiometricTokenSummary|\Onfido\Model\Error + */ + public function invalidateBiometricToken($user_id, $token_uuid, string $contentType = self::contentTypes['invalidateBiometricToken'][0]) + { + list($response) = $this->invalidateBiometricTokenWithHttpInfo($user_id, $token_uuid, $contentType); + return $response; + } + + /** + * Operation invalidateBiometricTokenWithHttpInfo + * + * Invalidate biometric token + * + * @param string $user_id Customer user ID that owns the biometric token. (required) + * @param string $token_uuid Biometric token UUID. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['invalidateBiometricToken'] to see the possible values for this operation + * + * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \Onfido\Model\InvalidatedBiometricTokenSummary|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + */ + public function invalidateBiometricTokenWithHttpInfo($user_id, $token_uuid, string $contentType = self::contentTypes['invalidateBiometricToken'][0]) + { + $request = $this->invalidateBiometricTokenRequest($user_id, $token_uuid, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\Onfido\Model\InvalidatedBiometricTokenSummary', + $request, + $response, + ); + default: + return $this->handleResponseWithDataType( + '\Onfido\Model\Error', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\Onfido\Model\InvalidatedBiometricTokenSummary', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Onfido\Model\InvalidatedBiometricTokenSummary', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Onfido\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation invalidateBiometricTokenAsync + * + * Invalidate biometric token + * + * @param string $user_id Customer user ID that owns the biometric token. (required) + * @param string $token_uuid Biometric token UUID. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['invalidateBiometricToken'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function invalidateBiometricTokenAsync($user_id, $token_uuid, string $contentType = self::contentTypes['invalidateBiometricToken'][0]) + { + return $this->invalidateBiometricTokenAsyncWithHttpInfo($user_id, $token_uuid, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation invalidateBiometricTokenAsyncWithHttpInfo + * + * Invalidate biometric token + * + * @param string $user_id Customer user ID that owns the biometric token. (required) + * @param string $token_uuid Biometric token UUID. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['invalidateBiometricToken'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function invalidateBiometricTokenAsyncWithHttpInfo($user_id, $token_uuid, string $contentType = self::contentTypes['invalidateBiometricToken'][0]) + { + $returnType = '\Onfido\Model\InvalidatedBiometricTokenSummary'; + $request = $this->invalidateBiometricTokenRequest($user_id, $token_uuid, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'invalidateBiometricToken' + * + * @param string $user_id Customer user ID that owns the biometric token. (required) + * @param string $token_uuid Biometric token UUID. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['invalidateBiometricToken'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function invalidateBiometricTokenRequest($user_id, $token_uuid, string $contentType = self::contentTypes['invalidateBiometricToken'][0]) + { + + // verify the required parameter 'user_id' is set + if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_id when calling invalidateBiometricToken' + ); + } + + // verify the required parameter 'token_uuid' is set + if ($token_uuid === null || (is_array($token_uuid) && count($token_uuid) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $token_uuid when calling invalidateBiometricToken' + ); + } + + + $resourcePath = '/biometric_tokens/{user_id}/{token_uuid}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($user_id !== null) { + $resourcePath = str_replace( + '{' . 'user_id' . '}', + ObjectSerializer::toPathValue($user_id), + $resourcePath + ); + } + // path params + if ($token_uuid !== null) { + $resourcePath = str_replace( + '{' . 'token_uuid' . '}', + ObjectSerializer::toPathValue($token_uuid), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation invalidateBiometricTokens + * + * Invalidate biometric tokens + * + * @param string $user_id Customer user ID whose biometric tokens will be invalidated. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['invalidateBiometricTokens'] to see the possible values for this operation + * + * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \Onfido\Model\InvalidatedBiometricTokensSummary|\Onfido\Model\Error + */ + public function invalidateBiometricTokens($user_id, string $contentType = self::contentTypes['invalidateBiometricTokens'][0]) + { + list($response) = $this->invalidateBiometricTokensWithHttpInfo($user_id, $contentType); + return $response; + } + + /** + * Operation invalidateBiometricTokensWithHttpInfo + * + * Invalidate biometric tokens + * + * @param string $user_id Customer user ID whose biometric tokens will be invalidated. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['invalidateBiometricTokens'] to see the possible values for this operation + * + * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \Onfido\Model\InvalidatedBiometricTokensSummary|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + */ + public function invalidateBiometricTokensWithHttpInfo($user_id, string $contentType = self::contentTypes['invalidateBiometricTokens'][0]) + { + $request = $this->invalidateBiometricTokensRequest($user_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\Onfido\Model\InvalidatedBiometricTokensSummary', + $request, + $response, + ); + default: + return $this->handleResponseWithDataType( + '\Onfido\Model\Error', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\Onfido\Model\InvalidatedBiometricTokensSummary', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Onfido\Model\InvalidatedBiometricTokensSummary', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Onfido\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation invalidateBiometricTokensAsync * - * Force new report creation (BETA) + * Invalidate biometric tokens * - * @param string $monitor_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forceReportCreationFromWatchlistMonitor'] to see the possible values for this operation + * @param string $user_id Customer user ID whose biometric tokens will be invalidated. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['invalidateBiometricTokens'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function forceReportCreationFromWatchlistMonitorAsync($monitor_id, string $contentType = self::contentTypes['forceReportCreationFromWatchlistMonitor'][0]) + public function invalidateBiometricTokensAsync($user_id, string $contentType = self::contentTypes['invalidateBiometricTokens'][0]) { - return $this->forceReportCreationFromWatchlistMonitorAsyncWithHttpInfo($monitor_id, $contentType) + return $this->invalidateBiometricTokensAsyncWithHttpInfo($user_id, $contentType) ->then( function ($response) { return $response[0]; @@ -13920,26 +15125,39 @@ function ($response) { } /** - * Operation forceReportCreationFromWatchlistMonitorAsyncWithHttpInfo + * Operation invalidateBiometricTokensAsyncWithHttpInfo * - * Force new report creation (BETA) + * Invalidate biometric tokens * - * @param string $monitor_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forceReportCreationFromWatchlistMonitor'] to see the possible values for this operation + * @param string $user_id Customer user ID whose biometric tokens will be invalidated. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['invalidateBiometricTokens'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function forceReportCreationFromWatchlistMonitorAsyncWithHttpInfo($monitor_id, string $contentType = self::contentTypes['forceReportCreationFromWatchlistMonitor'][0]) + public function invalidateBiometricTokensAsyncWithHttpInfo($user_id, string $contentType = self::contentTypes['invalidateBiometricTokens'][0]) { - $returnType = ''; - $request = $this->forceReportCreationFromWatchlistMonitorRequest($monitor_id, $contentType); + $returnType = '\Onfido\Model\InvalidatedBiometricTokensSummary'; + $request = $this->invalidateBiometricTokensRequest($user_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -13959,26 +15177,26 @@ function ($exception) { } /** - * Create request for operation 'forceReportCreationFromWatchlistMonitor' + * Create request for operation 'invalidateBiometricTokens' * - * @param string $monitor_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['forceReportCreationFromWatchlistMonitor'] to see the possible values for this operation + * @param string $user_id Customer user ID whose biometric tokens will be invalidated. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['invalidateBiometricTokens'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function forceReportCreationFromWatchlistMonitorRequest($monitor_id, string $contentType = self::contentTypes['forceReportCreationFromWatchlistMonitor'][0]) + public function invalidateBiometricTokensRequest($user_id, string $contentType = self::contentTypes['invalidateBiometricTokens'][0]) { - // verify the required parameter 'monitor_id' is set - if ($monitor_id === null || (is_array($monitor_id) && count($monitor_id) === 0)) { + // verify the required parameter 'user_id' is set + if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $monitor_id when calling forceReportCreationFromWatchlistMonitor' + 'Missing the required parameter $user_id when calling invalidateBiometricTokens' ); } - $resourcePath = '/watchlist_monitors/{monitor_id}/new_report'; + $resourcePath = '/biometric_tokens/{user_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13988,10 +15206,10 @@ public function forceReportCreationFromWatchlistMonitorRequest($monitor_id, stri // path params - if ($monitor_id !== null) { + if ($user_id !== null) { $resourcePath = str_replace( - '{' . 'monitor_id' . '}', - ObjectSerializer::toPathValue($monitor_id), + '{' . 'user_id' . '}', + ObjectSerializer::toPathValue($user_id), $resourcePath ); } @@ -14052,7 +15270,7 @@ public function forceReportCreationFromWatchlistMonitorRequest($monitor_id, stri $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'DELETE', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -14060,38 +15278,42 @@ public function forceReportCreationFromWatchlistMonitorRequest($monitor_id, stri } /** - * Operation generateSdkToken + * Operation listApplicants * - * Generate a SDK token + * List Applicants * - * @param \Onfido\Model\SdkTokenBuilder $sdk_token_builder sdk_token_builder (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSdkToken'] to see the possible values for this operation + * @param int|null $page The page to return. The first page is `page=1` (optional, default to 1) + * @param int|null $per_page The number of objects per page. (optional, default to 20) + * @param bool|null $include_deleted Whether to also include applicants scheduled for deletion. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listApplicants'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Onfido\Model\SdkToken|\Onfido\Model\Error + * @return \Onfido\Model\ApplicantsList|\Onfido\Model\Error */ - public function generateSdkToken($sdk_token_builder, string $contentType = self::contentTypes['generateSdkToken'][0]) + public function listApplicants($page = 1, $per_page = 20, $include_deleted = false, string $contentType = self::contentTypes['listApplicants'][0]) { - list($response) = $this->generateSdkTokenWithHttpInfo($sdk_token_builder, $contentType); + list($response) = $this->listApplicantsWithHttpInfo($page, $per_page, $include_deleted, $contentType); return $response; } /** - * Operation generateSdkTokenWithHttpInfo + * Operation listApplicantsWithHttpInfo * - * Generate a SDK token + * List Applicants * - * @param \Onfido\Model\SdkTokenBuilder $sdk_token_builder (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSdkToken'] to see the possible values for this operation + * @param int|null $page The page to return. The first page is `page=1` (optional, default to 1) + * @param int|null $per_page The number of objects per page. (optional, default to 20) + * @param bool|null $include_deleted Whether to also include applicants scheduled for deletion. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listApplicants'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Onfido\Model\SdkToken|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\ApplicantsList|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function generateSdkTokenWithHttpInfo($sdk_token_builder, string $contentType = self::contentTypes['generateSdkToken'][0]) + public function listApplicantsWithHttpInfo($page = 1, $per_page = 20, $include_deleted = false, string $contentType = self::contentTypes['listApplicants'][0]) { - $request = $this->generateSdkTokenRequest($sdk_token_builder, $contentType); + $request = $this->listApplicantsRequest($page, $per_page, $include_deleted, $contentType); try { $options = $this->createHttpClientOption(); @@ -14119,7 +15341,7 @@ public function generateSdkTokenWithHttpInfo($sdk_token_builder, string $content switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Onfido\Model\SdkToken', + '\Onfido\Model\ApplicantsList', $request, $response, ); @@ -14147,7 +15369,7 @@ public function generateSdkTokenWithHttpInfo($sdk_token_builder, string $content } return $this->handleResponseWithDataType( - '\Onfido\Model\SdkToken', + '\Onfido\Model\ApplicantsList', $request, $response, ); @@ -14156,7 +15378,7 @@ public function generateSdkTokenWithHttpInfo($sdk_token_builder, string $content case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Onfido\Model\SdkToken', + '\Onfido\Model\ApplicantsList', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14177,19 +15399,21 @@ public function generateSdkTokenWithHttpInfo($sdk_token_builder, string $content } /** - * Operation generateSdkTokenAsync + * Operation listApplicantsAsync * - * Generate a SDK token + * List Applicants * - * @param \Onfido\Model\SdkTokenBuilder $sdk_token_builder (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSdkToken'] to see the possible values for this operation + * @param int|null $page The page to return. The first page is `page=1` (optional, default to 1) + * @param int|null $per_page The number of objects per page. (optional, default to 20) + * @param bool|null $include_deleted Whether to also include applicants scheduled for deletion. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listApplicants'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateSdkTokenAsync($sdk_token_builder, string $contentType = self::contentTypes['generateSdkToken'][0]) + public function listApplicantsAsync($page = 1, $per_page = 20, $include_deleted = false, string $contentType = self::contentTypes['listApplicants'][0]) { - return $this->generateSdkTokenAsyncWithHttpInfo($sdk_token_builder, $contentType) + return $this->listApplicantsAsyncWithHttpInfo($page, $per_page, $include_deleted, $contentType) ->then( function ($response) { return $response[0]; @@ -14198,20 +15422,22 @@ function ($response) { } /** - * Operation generateSdkTokenAsyncWithHttpInfo + * Operation listApplicantsAsyncWithHttpInfo * - * Generate a SDK token + * List Applicants * - * @param \Onfido\Model\SdkTokenBuilder $sdk_token_builder (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSdkToken'] to see the possible values for this operation + * @param int|null $page The page to return. The first page is `page=1` (optional, default to 1) + * @param int|null $per_page The number of objects per page. (optional, default to 20) + * @param bool|null $include_deleted Whether to also include applicants scheduled for deletion. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listApplicants'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generateSdkTokenAsyncWithHttpInfo($sdk_token_builder, string $contentType = self::contentTypes['generateSdkToken'][0]) + public function listApplicantsAsyncWithHttpInfo($page = 1, $per_page = 20, $include_deleted = false, string $contentType = self::contentTypes['listApplicants'][0]) { - $returnType = '\Onfido\Model\SdkToken'; - $request = $this->generateSdkTokenRequest($sdk_token_builder, $contentType); + $returnType = '\Onfido\Model\ApplicantsList'; + $request = $this->listApplicantsRequest($page, $per_page, $include_deleted, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14250,32 +15476,57 @@ function ($exception) { } /** - * Create request for operation 'generateSdkToken' + * Create request for operation 'listApplicants' * - * @param \Onfido\Model\SdkTokenBuilder $sdk_token_builder (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generateSdkToken'] to see the possible values for this operation + * @param int|null $page The page to return. The first page is `page=1` (optional, default to 1) + * @param int|null $per_page The number of objects per page. (optional, default to 20) + * @param bool|null $include_deleted Whether to also include applicants scheduled for deletion. (optional, default to false) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listApplicants'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function generateSdkTokenRequest($sdk_token_builder, string $contentType = self::contentTypes['generateSdkToken'][0]) + public function listApplicantsRequest($page = 1, $per_page = 20, $include_deleted = false, string $contentType = self::contentTypes['listApplicants'][0]) { - // verify the required parameter 'sdk_token_builder' is set - if ($sdk_token_builder === null || (is_array($sdk_token_builder) && count($sdk_token_builder) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $sdk_token_builder when calling generateSdkToken' - ); - } - $resourcePath = '/sdk_token'; + + + $resourcePath = '/applicants'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $per_page, + 'per_page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_deleted, + 'include_deleted', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); @@ -14287,14 +15538,7 @@ public function generateSdkTokenRequest($sdk_token_builder, string $contentType ); // for model (json/xml) - if (isset($sdk_token_builder)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($sdk_token_builder)); - } else { - $httpBody = $sdk_token_builder; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -14342,7 +15586,7 @@ public function generateSdkTokenRequest($sdk_token_builder, string $contentType $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -14350,42 +15594,38 @@ public function generateSdkTokenRequest($sdk_token_builder, string $contentType } /** - * Operation listApplicants + * Operation listBiometricTokens * - * List Applicants + * List biometric tokens * - * @param int|null $page The page to return. The first page is `page=1` (optional, default to 1) - * @param int|null $per_page The number of objects per page. (optional, default to 20) - * @param bool|null $include_deleted Whether to also include applicants scheduled for deletion. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listApplicants'] to see the possible values for this operation + * @param string $user_id Customer user ID that owns the biometric tokens. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBiometricTokens'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Onfido\Model\ApplicantsList|\Onfido\Model\Error + * @return \Onfido\Model\BiometricTokensList|\Onfido\Model\Error */ - public function listApplicants($page = 1, $per_page = 20, $include_deleted = false, string $contentType = self::contentTypes['listApplicants'][0]) + public function listBiometricTokens($user_id, string $contentType = self::contentTypes['listBiometricTokens'][0]) { - list($response) = $this->listApplicantsWithHttpInfo($page, $per_page, $include_deleted, $contentType); + list($response) = $this->listBiometricTokensWithHttpInfo($user_id, $contentType); return $response; } /** - * Operation listApplicantsWithHttpInfo + * Operation listBiometricTokensWithHttpInfo * - * List Applicants + * List biometric tokens * - * @param int|null $page The page to return. The first page is `page=1` (optional, default to 1) - * @param int|null $per_page The number of objects per page. (optional, default to 20) - * @param bool|null $include_deleted Whether to also include applicants scheduled for deletion. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listApplicants'] to see the possible values for this operation + * @param string $user_id Customer user ID that owns the biometric tokens. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBiometricTokens'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Onfido\Model\ApplicantsList|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\BiometricTokensList|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function listApplicantsWithHttpInfo($page = 1, $per_page = 20, $include_deleted = false, string $contentType = self::contentTypes['listApplicants'][0]) + public function listBiometricTokensWithHttpInfo($user_id, string $contentType = self::contentTypes['listBiometricTokens'][0]) { - $request = $this->listApplicantsRequest($page, $per_page, $include_deleted, $contentType); + $request = $this->listBiometricTokensRequest($user_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -14413,7 +15653,7 @@ public function listApplicantsWithHttpInfo($page = 1, $per_page = 20, $include_d switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Onfido\Model\ApplicantsList', + '\Onfido\Model\BiometricTokensList', $request, $response, ); @@ -14441,7 +15681,7 @@ public function listApplicantsWithHttpInfo($page = 1, $per_page = 20, $include_d } return $this->handleResponseWithDataType( - '\Onfido\Model\ApplicantsList', + '\Onfido\Model\BiometricTokensList', $request, $response, ); @@ -14450,7 +15690,7 @@ public function listApplicantsWithHttpInfo($page = 1, $per_page = 20, $include_d case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Onfido\Model\ApplicantsList', + '\Onfido\Model\BiometricTokensList', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14471,21 +15711,19 @@ public function listApplicantsWithHttpInfo($page = 1, $per_page = 20, $include_d } /** - * Operation listApplicantsAsync + * Operation listBiometricTokensAsync * - * List Applicants + * List biometric tokens * - * @param int|null $page The page to return. The first page is `page=1` (optional, default to 1) - * @param int|null $per_page The number of objects per page. (optional, default to 20) - * @param bool|null $include_deleted Whether to also include applicants scheduled for deletion. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listApplicants'] to see the possible values for this operation + * @param string $user_id Customer user ID that owns the biometric tokens. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBiometricTokens'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listApplicantsAsync($page = 1, $per_page = 20, $include_deleted = false, string $contentType = self::contentTypes['listApplicants'][0]) + public function listBiometricTokensAsync($user_id, string $contentType = self::contentTypes['listBiometricTokens'][0]) { - return $this->listApplicantsAsyncWithHttpInfo($page, $per_page, $include_deleted, $contentType) + return $this->listBiometricTokensAsyncWithHttpInfo($user_id, $contentType) ->then( function ($response) { return $response[0]; @@ -14494,22 +15732,20 @@ function ($response) { } /** - * Operation listApplicantsAsyncWithHttpInfo + * Operation listBiometricTokensAsyncWithHttpInfo * - * List Applicants + * List biometric tokens * - * @param int|null $page The page to return. The first page is `page=1` (optional, default to 1) - * @param int|null $per_page The number of objects per page. (optional, default to 20) - * @param bool|null $include_deleted Whether to also include applicants scheduled for deletion. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listApplicants'] to see the possible values for this operation + * @param string $user_id Customer user ID that owns the biometric tokens. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBiometricTokens'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listApplicantsAsyncWithHttpInfo($page = 1, $per_page = 20, $include_deleted = false, string $contentType = self::contentTypes['listApplicants'][0]) + public function listBiometricTokensAsyncWithHttpInfo($user_id, string $contentType = self::contentTypes['listBiometricTokens'][0]) { - $returnType = '\Onfido\Model\ApplicantsList'; - $request = $this->listApplicantsRequest($page, $per_page, $include_deleted, $contentType); + $returnType = '\Onfido\Model\BiometricTokensList'; + $request = $this->listBiometricTokensRequest($user_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14548,59 +15784,42 @@ function ($exception) { } /** - * Create request for operation 'listApplicants' + * Create request for operation 'listBiometricTokens' * - * @param int|null $page The page to return. The first page is `page=1` (optional, default to 1) - * @param int|null $per_page The number of objects per page. (optional, default to 20) - * @param bool|null $include_deleted Whether to also include applicants scheduled for deletion. (optional, default to false) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listApplicants'] to see the possible values for this operation + * @param string $user_id Customer user ID that owns the biometric tokens. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBiometricTokens'] to see the possible values for this operation * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function listApplicantsRequest($page = 1, $per_page = 20, $include_deleted = false, string $contentType = self::contentTypes['listApplicants'][0]) - { - - - - - - $resourcePath = '/applicants'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $page, - 'page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $per_page, - 'per_page', // param base name - 'integer', // openApiType - '', // style - false, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include_deleted, - 'include_deleted', // param base name - 'boolean', // openApiType - '', // style - false, // explode - false // required - ) ?? []); + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listBiometricTokensRequest($user_id, string $contentType = self::contentTypes['listBiometricTokens'][0]) + { + + // verify the required parameter 'user_id' is set + if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $user_id when calling listBiometricTokens' + ); + } + + + $resourcePath = '/biometric_tokens/{user_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // path params + if ($user_id !== null) { + $resourcePath = str_replace( + '{' . 'user_id' . '}', + ObjectSerializer::toPathValue($user_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -20222,7 +21441,242 @@ public function resumeCheckWithHttpInfo($check_id, string $contentType = self::c */ public function resumeCheckAsync($check_id, string $contentType = self::contentTypes['resumeCheck'][0]) { - return $this->resumeCheckAsyncWithHttpInfo($check_id, $contentType) + return $this->resumeCheckAsyncWithHttpInfo($check_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation resumeCheckAsyncWithHttpInfo + * + * Resume a Check + * + * @param string $check_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeCheck'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function resumeCheckAsyncWithHttpInfo($check_id, string $contentType = self::contentTypes['resumeCheck'][0]) + { + $returnType = ''; + $request = $this->resumeCheckRequest($check_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'resumeCheck' + * + * @param string $check_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeCheck'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function resumeCheckRequest($check_id, string $contentType = self::contentTypes['resumeCheck'][0]) + { + + // verify the required parameter 'check_id' is set + if ($check_id === null || (is_array($check_id) && count($check_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $check_id when calling resumeCheck' + ); + } + + + $resourcePath = '/checks/{check_id}/resume'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($check_id !== null) { + $resourcePath = str_replace( + '{' . 'check_id' . '}', + ObjectSerializer::toPathValue($check_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); + if ($apiKey !== null) { + $headers['Authorization'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation resumeReport + * + * Resume report + * + * @param string $report_id report_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeReport'] to see the possible values for this operation + * + * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function resumeReport($report_id, string $contentType = self::contentTypes['resumeReport'][0]) + { + $this->resumeReportWithHttpInfo($report_id, $contentType); + } + + /** + * Operation resumeReportWithHttpInfo + * + * Resume report + * + * @param string $report_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeReport'] to see the possible values for this operation + * + * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function resumeReportWithHttpInfo($report_id, string $contentType = self::contentTypes['resumeReport'][0]) + { + $request = $this->resumeReportRequest($report_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Onfido\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation resumeReportAsync + * + * Resume report + * + * @param string $report_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeReport'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function resumeReportAsync($report_id, string $contentType = self::contentTypes['resumeReport'][0]) + { + return $this->resumeReportAsyncWithHttpInfo($report_id, $contentType) ->then( function ($response) { return $response[0]; @@ -20231,20 +21685,20 @@ function ($response) { } /** - * Operation resumeCheckAsyncWithHttpInfo + * Operation resumeReportAsyncWithHttpInfo * - * Resume a Check + * Resume report * - * @param string $check_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeCheck'] to see the possible values for this operation + * @param string $report_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function resumeCheckAsyncWithHttpInfo($check_id, string $contentType = self::contentTypes['resumeCheck'][0]) + public function resumeReportAsyncWithHttpInfo($report_id, string $contentType = self::contentTypes['resumeReport'][0]) { $returnType = ''; - $request = $this->resumeCheckRequest($check_id, $contentType); + $request = $this->resumeReportRequest($report_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -20270,26 +21724,26 @@ function ($exception) { } /** - * Create request for operation 'resumeCheck' + * Create request for operation 'resumeReport' * - * @param string $check_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeCheck'] to see the possible values for this operation + * @param string $report_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeReport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function resumeCheckRequest($check_id, string $contentType = self::contentTypes['resumeCheck'][0]) + public function resumeReportRequest($report_id, string $contentType = self::contentTypes['resumeReport'][0]) { - // verify the required parameter 'check_id' is set - if ($check_id === null || (is_array($check_id) && count($check_id) === 0)) { + // verify the required parameter 'report_id' is set + if ($report_id === null || (is_array($report_id) && count($report_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $check_id when calling resumeCheck' + 'Missing the required parameter $report_id when calling resumeReport' ); } - $resourcePath = '/checks/{check_id}/resume'; + $resourcePath = '/reports/{report_id}/resume'; $formParams = []; $queryParams = []; $headerParams = []; @@ -20299,10 +21753,10 @@ public function resumeCheckRequest($check_id, string $contentType = self::conten // path params - if ($check_id !== null) { + if ($report_id !== null) { $resourcePath = str_replace( - '{' . 'check_id' . '}', - ObjectSerializer::toPathValue($check_id), + '{' . 'report_id' . '}', + ObjectSerializer::toPathValue($report_id), $resourcePath ); } @@ -20371,37 +21825,40 @@ public function resumeCheckRequest($check_id, string $contentType = self::conten } /** - * Operation resumeReport + * Operation updateApplicant * - * Resume report + * Update Applicant * - * @param string $report_id report_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeReport'] to see the possible values for this operation + * @param string $applicant_id applicant_id (required) + * @param \Onfido\Model\ApplicantUpdater $applicant_updater applicant_updater (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateApplicant'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return void + * @return \Onfido\Model\Applicant|\Onfido\Model\Error */ - public function resumeReport($report_id, string $contentType = self::contentTypes['resumeReport'][0]) + public function updateApplicant($applicant_id, $applicant_updater, string $contentType = self::contentTypes['updateApplicant'][0]) { - $this->resumeReportWithHttpInfo($report_id, $contentType); + list($response) = $this->updateApplicantWithHttpInfo($applicant_id, $applicant_updater, $contentType); + return $response; } /** - * Operation resumeReportWithHttpInfo + * Operation updateApplicantWithHttpInfo * - * Resume report + * Update Applicant * - * @param string $report_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeReport'] to see the possible values for this operation + * @param string $applicant_id (required) + * @param \Onfido\Model\ApplicantUpdater $applicant_updater (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateApplicant'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\Applicant|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function resumeReportWithHttpInfo($report_id, string $contentType = self::contentTypes['resumeReport'][0]) + public function updateApplicantWithHttpInfo($applicant_id, $applicant_updater, string $contentType = self::contentTypes['updateApplicant'][0]) { - $request = $this->resumeReportRequest($report_id, $contentType); + $request = $this->updateApplicantRequest($applicant_id, $applicant_updater, $contentType); try { $options = $this->createHttpClientOption(); @@ -20426,9 +21883,51 @@ public function resumeReportWithHttpInfo($report_id, string $contentType = self: $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\Onfido\Model\Applicant', + $request, + $response, + ); + default: + return $this->handleResponseWithDataType( + '\Onfido\Model\Error', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\Onfido\Model\Applicant', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Onfido\Model\Applicant', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -20445,19 +21944,20 @@ public function resumeReportWithHttpInfo($report_id, string $contentType = self: } /** - * Operation resumeReportAsync + * Operation updateApplicantAsync * - * Resume report + * Update Applicant * - * @param string $report_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeReport'] to see the possible values for this operation + * @param string $applicant_id (required) + * @param \Onfido\Model\ApplicantUpdater $applicant_updater (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateApplicant'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function resumeReportAsync($report_id, string $contentType = self::contentTypes['resumeReport'][0]) + public function updateApplicantAsync($applicant_id, $applicant_updater, string $contentType = self::contentTypes['updateApplicant'][0]) { - return $this->resumeReportAsyncWithHttpInfo($report_id, $contentType) + return $this->updateApplicantAsyncWithHttpInfo($applicant_id, $applicant_updater, $contentType) ->then( function ($response) { return $response[0]; @@ -20466,26 +21966,40 @@ function ($response) { } /** - * Operation resumeReportAsyncWithHttpInfo + * Operation updateApplicantAsyncWithHttpInfo * - * Resume report + * Update Applicant * - * @param string $report_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeReport'] to see the possible values for this operation + * @param string $applicant_id (required) + * @param \Onfido\Model\ApplicantUpdater $applicant_updater (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateApplicant'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function resumeReportAsyncWithHttpInfo($report_id, string $contentType = self::contentTypes['resumeReport'][0]) + public function updateApplicantAsyncWithHttpInfo($applicant_id, $applicant_updater, string $contentType = self::contentTypes['updateApplicant'][0]) { - $returnType = ''; - $request = $this->resumeReportRequest($report_id, $contentType); + $returnType = '\Onfido\Model\Applicant'; + $request = $this->updateApplicantRequest($applicant_id, $applicant_updater, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -20505,26 +22019,34 @@ function ($exception) { } /** - * Create request for operation 'resumeReport' + * Create request for operation 'updateApplicant' * - * @param string $report_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['resumeReport'] to see the possible values for this operation + * @param string $applicant_id (required) + * @param \Onfido\Model\ApplicantUpdater $applicant_updater (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateApplicant'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function resumeReportRequest($report_id, string $contentType = self::contentTypes['resumeReport'][0]) + public function updateApplicantRequest($applicant_id, $applicant_updater, string $contentType = self::contentTypes['updateApplicant'][0]) { - // verify the required parameter 'report_id' is set - if ($report_id === null || (is_array($report_id) && count($report_id) === 0)) { + // verify the required parameter 'applicant_id' is set + if ($applicant_id === null || (is_array($applicant_id) && count($applicant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $report_id when calling resumeReport' + 'Missing the required parameter $applicant_id when calling updateApplicant' ); } + // verify the required parameter 'applicant_updater' is set + if ($applicant_updater === null || (is_array($applicant_updater) && count($applicant_updater) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $applicant_updater when calling updateApplicant' + ); + } - $resourcePath = '/reports/{report_id}/resume'; + + $resourcePath = '/applicants/{applicant_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -20534,10 +22056,10 @@ public function resumeReportRequest($report_id, string $contentType = self::cont // path params - if ($report_id !== null) { + if ($applicant_id !== null) { $resourcePath = str_replace( - '{' . 'report_id' . '}', - ObjectSerializer::toPathValue($report_id), + '{' . 'applicant_id' . '}', + ObjectSerializer::toPathValue($applicant_id), $resourcePath ); } @@ -20550,7 +22072,14 @@ public function resumeReportRequest($report_id, string $contentType = self::cont ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($applicant_updater)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($applicant_updater)); + } else { + $httpBody = $applicant_updater; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -20598,7 +22127,7 @@ public function resumeReportRequest($report_id, string $contentType = self::cont $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -20606,40 +22135,42 @@ public function resumeReportRequest($report_id, string $contentType = self::cont } /** - * Operation updateApplicant + * Operation updateBiometricToken * - * Update Applicant + * Update biometric token * - * @param string $applicant_id applicant_id (required) - * @param \Onfido\Model\ApplicantUpdater $applicant_updater applicant_updater (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateApplicant'] to see the possible values for this operation + * @param string $user_id Customer user ID that owns the biometric token. (required) + * @param string $token_uuid Biometric token UUID. (required) + * @param \Onfido\Model\BiometricTokenUpdater $biometric_token_updater Biometric token update payload. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBiometricToken'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Onfido\Model\Applicant|\Onfido\Model\Error + * @return \Onfido\Model\UpdateBiometricToken200Response|\Onfido\Model\Error */ - public function updateApplicant($applicant_id, $applicant_updater, string $contentType = self::contentTypes['updateApplicant'][0]) + public function updateBiometricToken($user_id, $token_uuid, $biometric_token_updater, string $contentType = self::contentTypes['updateBiometricToken'][0]) { - list($response) = $this->updateApplicantWithHttpInfo($applicant_id, $applicant_updater, $contentType); + list($response) = $this->updateBiometricTokenWithHttpInfo($user_id, $token_uuid, $biometric_token_updater, $contentType); return $response; } /** - * Operation updateApplicantWithHttpInfo + * Operation updateBiometricTokenWithHttpInfo * - * Update Applicant + * Update biometric token * - * @param string $applicant_id (required) - * @param \Onfido\Model\ApplicantUpdater $applicant_updater (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateApplicant'] to see the possible values for this operation + * @param string $user_id Customer user ID that owns the biometric token. (required) + * @param string $token_uuid Biometric token UUID. (required) + * @param \Onfido\Model\BiometricTokenUpdater $biometric_token_updater Biometric token update payload. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBiometricToken'] to see the possible values for this operation * * @throws \Onfido\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Onfido\Model\Applicant|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \Onfido\Model\UpdateBiometricToken200Response|\Onfido\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateApplicantWithHttpInfo($applicant_id, $applicant_updater, string $contentType = self::contentTypes['updateApplicant'][0]) + public function updateBiometricTokenWithHttpInfo($user_id, $token_uuid, $biometric_token_updater, string $contentType = self::contentTypes['updateBiometricToken'][0]) { - $request = $this->updateApplicantRequest($applicant_id, $applicant_updater, $contentType); + $request = $this->updateBiometricTokenRequest($user_id, $token_uuid, $biometric_token_updater, $contentType); try { $options = $this->createHttpClientOption(); @@ -20667,7 +22198,7 @@ public function updateApplicantWithHttpInfo($applicant_id, $applicant_updater, s switch($statusCode) { case 200: return $this->handleResponseWithDataType( - '\Onfido\Model\Applicant', + '\Onfido\Model\UpdateBiometricToken200Response', $request, $response, ); @@ -20695,7 +22226,7 @@ public function updateApplicantWithHttpInfo($applicant_id, $applicant_updater, s } return $this->handleResponseWithDataType( - '\Onfido\Model\Applicant', + '\Onfido\Model\UpdateBiometricToken200Response', $request, $response, ); @@ -20704,7 +22235,7 @@ public function updateApplicantWithHttpInfo($applicant_id, $applicant_updater, s case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Onfido\Model\Applicant', + '\Onfido\Model\UpdateBiometricToken200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -20725,20 +22256,21 @@ public function updateApplicantWithHttpInfo($applicant_id, $applicant_updater, s } /** - * Operation updateApplicantAsync + * Operation updateBiometricTokenAsync * - * Update Applicant + * Update biometric token * - * @param string $applicant_id (required) - * @param \Onfido\Model\ApplicantUpdater $applicant_updater (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateApplicant'] to see the possible values for this operation + * @param string $user_id Customer user ID that owns the biometric token. (required) + * @param string $token_uuid Biometric token UUID. (required) + * @param \Onfido\Model\BiometricTokenUpdater $biometric_token_updater Biometric token update payload. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBiometricToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateApplicantAsync($applicant_id, $applicant_updater, string $contentType = self::contentTypes['updateApplicant'][0]) + public function updateBiometricTokenAsync($user_id, $token_uuid, $biometric_token_updater, string $contentType = self::contentTypes['updateBiometricToken'][0]) { - return $this->updateApplicantAsyncWithHttpInfo($applicant_id, $applicant_updater, $contentType) + return $this->updateBiometricTokenAsyncWithHttpInfo($user_id, $token_uuid, $biometric_token_updater, $contentType) ->then( function ($response) { return $response[0]; @@ -20747,21 +22279,22 @@ function ($response) { } /** - * Operation updateApplicantAsyncWithHttpInfo + * Operation updateBiometricTokenAsyncWithHttpInfo * - * Update Applicant + * Update biometric token * - * @param string $applicant_id (required) - * @param \Onfido\Model\ApplicantUpdater $applicant_updater (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateApplicant'] to see the possible values for this operation + * @param string $user_id Customer user ID that owns the biometric token. (required) + * @param string $token_uuid Biometric token UUID. (required) + * @param \Onfido\Model\BiometricTokenUpdater $biometric_token_updater Biometric token update payload. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBiometricToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateApplicantAsyncWithHttpInfo($applicant_id, $applicant_updater, string $contentType = self::contentTypes['updateApplicant'][0]) + public function updateBiometricTokenAsyncWithHttpInfo($user_id, $token_uuid, $biometric_token_updater, string $contentType = self::contentTypes['updateBiometricToken'][0]) { - $returnType = '\Onfido\Model\Applicant'; - $request = $this->updateApplicantRequest($applicant_id, $applicant_updater, $contentType); + $returnType = '\Onfido\Model\UpdateBiometricToken200Response'; + $request = $this->updateBiometricTokenRequest($user_id, $token_uuid, $biometric_token_updater, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -20800,34 +22333,42 @@ function ($exception) { } /** - * Create request for operation 'updateApplicant' + * Create request for operation 'updateBiometricToken' * - * @param string $applicant_id (required) - * @param \Onfido\Model\ApplicantUpdater $applicant_updater (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateApplicant'] to see the possible values for this operation + * @param string $user_id Customer user ID that owns the biometric token. (required) + * @param string $token_uuid Biometric token UUID. (required) + * @param \Onfido\Model\BiometricTokenUpdater $biometric_token_updater Biometric token update payload. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBiometricToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateApplicantRequest($applicant_id, $applicant_updater, string $contentType = self::contentTypes['updateApplicant'][0]) + public function updateBiometricTokenRequest($user_id, $token_uuid, $biometric_token_updater, string $contentType = self::contentTypes['updateBiometricToken'][0]) { - // verify the required parameter 'applicant_id' is set - if ($applicant_id === null || (is_array($applicant_id) && count($applicant_id) === 0)) { + // verify the required parameter 'user_id' is set + if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicant_id when calling updateApplicant' + 'Missing the required parameter $user_id when calling updateBiometricToken' ); } - // verify the required parameter 'applicant_updater' is set - if ($applicant_updater === null || (is_array($applicant_updater) && count($applicant_updater) === 0)) { + // verify the required parameter 'token_uuid' is set + if ($token_uuid === null || (is_array($token_uuid) && count($token_uuid) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $applicant_updater when calling updateApplicant' + 'Missing the required parameter $token_uuid when calling updateBiometricToken' ); } + // verify the required parameter 'biometric_token_updater' is set + if ($biometric_token_updater === null || (is_array($biometric_token_updater) && count($biometric_token_updater) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $biometric_token_updater when calling updateBiometricToken' + ); + } - $resourcePath = '/applicants/{applicant_id}'; + + $resourcePath = '/biometric_tokens/{user_id}/{token_uuid}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -20837,10 +22378,18 @@ public function updateApplicantRequest($applicant_id, $applicant_updater, string // path params - if ($applicant_id !== null) { + if ($user_id !== null) { $resourcePath = str_replace( - '{' . 'applicant_id' . '}', - ObjectSerializer::toPathValue($applicant_id), + '{' . 'user_id' . '}', + ObjectSerializer::toPathValue($user_id), + $resourcePath + ); + } + // path params + if ($token_uuid !== null) { + $resourcePath = str_replace( + '{' . 'token_uuid' . '}', + ObjectSerializer::toPathValue($token_uuid), $resourcePath ); } @@ -20853,12 +22402,12 @@ public function updateApplicantRequest($applicant_id, $applicant_updater, string ); // for model (json/xml) - if (isset($applicant_updater)) { + if (isset($biometric_token_updater)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($applicant_updater)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($biometric_token_updater)); } else { - $httpBody = $applicant_updater; + $httpBody = $biometric_token_updater; } } elseif (count($formParams) > 0) { if ($multipart) { diff --git a/lib/Configuration.php b/lib/Configuration.php index 905516c..e671fa1 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -115,7 +115,7 @@ class Configuration * * @var string */ - protected $userAgent = 'onfido-php/10.2.0'; + protected $userAgent = 'onfido-php/10.3.0'; /** * Debug switch (default set to false) @@ -465,7 +465,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' The version of the OpenAPI document: v3.6' . PHP_EOL; - $report .= ' SDK Package Version: 10.2.0' . PHP_EOL; + $report .= ' SDK Package Version: 10.3.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/BiometricToken.php b/lib/Model/BiometricToken.php new file mode 100644 index 0000000..b5e3325 --- /dev/null +++ b/lib/Model/BiometricToken.php @@ -0,0 +1,412 @@ + + */ +class BiometricToken implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Biometric_token'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'biometric_token' => '\Onfido\Model\BiometricToken' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'biometric_token' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'biometric_token' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'biometric_token' => 'biometric_token' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'biometric_token' => 'setBiometricToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'biometric_token' => 'getBiometricToken' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('biometric_token', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['biometric_token'] === null) { + $invalidProperties[] = "'biometric_token' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets biometric_token + * + * @return \Onfido\Model\BiometricToken + */ + public function getBiometricToken() + { + return $this->container['biometric_token']; + } + + /** + * Sets biometric_token + * + * @param \Onfido\Model\BiometricToken $biometric_token biometric_token + * + * @return self + */ + public function setBiometricToken($biometric_token) + { + if (is_null($biometric_token)) { + throw new \InvalidArgumentException('non-nullable biometric_token cannot be null'); + } + $this->container['biometric_token'] = $biometric_token; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/BiometricTokenData.php b/lib/Model/BiometricTokenData.php new file mode 100644 index 0000000..2472f81 --- /dev/null +++ b/lib/Model/BiometricTokenData.php @@ -0,0 +1,527 @@ + + */ +class BiometricTokenData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'biometric_token_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'inserted_at' => '\DateTime', + 'media_type' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'inserted_at' => 'date-time', + 'media_type' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'inserted_at' => false, + 'media_type' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'inserted_at' => 'inserted_at', + 'media_type' => 'media_type', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'inserted_at' => 'setInsertedAt', + 'media_type' => 'setMediaType', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'inserted_at' => 'getInsertedAt', + 'media_type' => 'getMediaType', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_AWAITING_INPUT = 'awaiting_input'; + public const STATUS_PROCESSING = 'processing'; + public const STATUS_ERROR = 'error'; + public const STATUS_ABANDONED = 'abandoned'; + public const STATUS_REVIEW = 'review'; + public const STATUS_DECLINED = 'declined'; + public const STATUS_APPROVED = 'approved'; + public const STATUS_UNKNOWN_DEFAULT_OPEN_API = 'unknown_default_open_api'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_AWAITING_INPUT, + self::STATUS_PROCESSING, + self::STATUS_ERROR, + self::STATUS_ABANDONED, + self::STATUS_REVIEW, + self::STATUS_DECLINED, + self::STATUS_APPROVED, + self::STATUS_UNKNOWN_DEFAULT_OPEN_API, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('inserted_at', $data ?? [], null); + $this->setIfExists('media_type', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['inserted_at'] === null) { + $invalidProperties[] = "'inserted_at' can't be null"; + } + if ($this->container['media_type'] === null) { + $invalidProperties[] = "'media_type' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets inserted_at + * + * @return \DateTime + */ + public function getInsertedAt() + { + return $this->container['inserted_at']; + } + + /** + * Sets inserted_at + * + * @param \DateTime $inserted_at Timestamp indicating when the biometric token was created. + * + * @return self + */ + public function setInsertedAt($inserted_at) + { + if (is_null($inserted_at)) { + throw new \InvalidArgumentException('non-nullable inserted_at cannot be null'); + } + $this->container['inserted_at'] = $inserted_at; + + return $this; + } + + /** + * Gets media_type + * + * @return string + */ + public function getMediaType() + { + return $this->container['media_type']; + } + + /** + * Sets media_type + * + * @param string $media_type Type of media associated with the biometric token. + * + * @return self + */ + public function setMediaType($media_type) + { + if (is_null($media_type)) { + throw new \InvalidArgumentException('non-nullable media_type cannot be null'); + } + $this->container['media_type'] = $media_type; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Current biometric token status. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + $status = self::STATUS_UNKNOWN_DEFAULT_OPEN_API; + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/BiometricTokenUpdater.php b/lib/Model/BiometricTokenUpdater.php new file mode 100644 index 0000000..100b818 --- /dev/null +++ b/lib/Model/BiometricTokenUpdater.php @@ -0,0 +1,442 @@ + + */ +class BiometricTokenUpdater implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'biometric_token_updater'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_APPROVED = 'approved'; + public const STATUS_DECLINED = 'declined'; + public const STATUS_UNKNOWN_DEFAULT_OPEN_API = 'unknown_default_open_api'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_APPROVED, + self::STATUS_DECLINED, + self::STATUS_UNKNOWN_DEFAULT_OPEN_API, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Desired biometric token status value. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + $status = self::STATUS_UNKNOWN_DEFAULT_OPEN_API; + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/BiometricTokensList.php b/lib/Model/BiometricTokensList.php new file mode 100644 index 0000000..7d2c2d0 --- /dev/null +++ b/lib/Model/BiometricTokensList.php @@ -0,0 +1,412 @@ + + */ +class BiometricTokensList implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Biometric_tokens_list'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'biometric_tokens' => '\Onfido\Model\BiometricToken[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'biometric_tokens' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'biometric_tokens' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'biometric_tokens' => 'biometric_tokens' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'biometric_tokens' => 'setBiometricTokens' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'biometric_tokens' => 'getBiometricTokens' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('biometric_tokens', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['biometric_tokens'] === null) { + $invalidProperties[] = "'biometric_tokens' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets biometric_tokens + * + * @return \Onfido\Model\BiometricToken[] + */ + public function getBiometricTokens() + { + return $this->container['biometric_tokens']; + } + + /** + * Sets biometric_tokens + * + * @param \Onfido\Model\BiometricToken[] $biometric_tokens biometric_tokens + * + * @return self + */ + public function setBiometricTokens($biometric_tokens) + { + if (is_null($biometric_tokens)) { + throw new \InvalidArgumentException('non-nullable biometric_tokens cannot be null'); + } + $this->container['biometric_tokens'] = $biometric_tokens; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/InvalidatedBiometricTokenSummary.php b/lib/Model/InvalidatedBiometricTokenSummary.php new file mode 100644 index 0000000..6cf7e04 --- /dev/null +++ b/lib/Model/InvalidatedBiometricTokenSummary.php @@ -0,0 +1,412 @@ + + */ +class InvalidatedBiometricTokenSummary implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Invalidated_biometric_token_summary'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'biometric_token' => '\Onfido\Model\InvalidatedBiometricTokenSummary' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'biometric_token' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'biometric_token' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'biometric_token' => 'biometric_token' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'biometric_token' => 'setBiometricToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'biometric_token' => 'getBiometricToken' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('biometric_token', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['biometric_token'] === null) { + $invalidProperties[] = "'biometric_token' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets biometric_token + * + * @return \Onfido\Model\InvalidatedBiometricTokenSummary + */ + public function getBiometricToken() + { + return $this->container['biometric_token']; + } + + /** + * Sets biometric_token + * + * @param \Onfido\Model\InvalidatedBiometricTokenSummary $biometric_token biometric_token + * + * @return self + */ + public function setBiometricToken($biometric_token) + { + if (is_null($biometric_token)) { + throw new \InvalidArgumentException('non-nullable biometric_token cannot be null'); + } + $this->container['biometric_token'] = $biometric_token; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/InvalidatedBiometricTokenSummaryDeletedItems.php b/lib/Model/InvalidatedBiometricTokenSummaryDeletedItems.php new file mode 100644 index 0000000..28dbe2a --- /dev/null +++ b/lib/Model/InvalidatedBiometricTokenSummaryDeletedItems.php @@ -0,0 +1,413 @@ + + */ +class InvalidatedBiometricTokenSummaryDeletedItems implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'invalidated_biometric_token_summary_deleted_items'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count Number of invalidated biometric tokens. + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/InvalidatedBiometricTokensSummary.php b/lib/Model/InvalidatedBiometricTokensSummary.php new file mode 100644 index 0000000..bbbc791 --- /dev/null +++ b/lib/Model/InvalidatedBiometricTokensSummary.php @@ -0,0 +1,412 @@ + + */ +class InvalidatedBiometricTokensSummary implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Invalidated_biometric_tokens_summary'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'biometric_tokens' => '\Onfido\Model\InvalidatedBiometricTokenSummary' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'biometric_tokens' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'biometric_tokens' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'biometric_tokens' => 'biometric_tokens' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'biometric_tokens' => 'setBiometricTokens' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'biometric_tokens' => 'getBiometricTokens' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('biometric_tokens', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['biometric_tokens'] === null) { + $invalidProperties[] = "'biometric_tokens' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets biometric_tokens + * + * @return \Onfido\Model\InvalidatedBiometricTokenSummary + */ + public function getBiometricTokens() + { + return $this->container['biometric_tokens']; + } + + /** + * Sets biometric_tokens + * + * @param \Onfido\Model\InvalidatedBiometricTokenSummary $biometric_tokens biometric_tokens + * + * @return self + */ + public function setBiometricTokens($biometric_tokens) + { + if (is_null($biometric_tokens)) { + throw new \InvalidArgumentException('non-nullable biometric_tokens cannot be null'); + } + $this->container['biometric_tokens'] = $biometric_tokens; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/UpdateBiometricToken200Response.php b/lib/Model/UpdateBiometricToken200Response.php new file mode 100644 index 0000000..d3c0f00 --- /dev/null +++ b/lib/Model/UpdateBiometricToken200Response.php @@ -0,0 +1,412 @@ + + */ +class UpdateBiometricToken200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'update_biometric_token_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'biometric_token' => '\Onfido\Model\BiometricToken' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'biometric_token' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'biometric_token' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'biometric_token' => 'biometric_token' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'biometric_token' => 'setBiometricToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'biometric_token' => 'getBiometricToken' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('biometric_token', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['biometric_token'] === null) { + $invalidProperties[] = "'biometric_token' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets biometric_token + * + * @return \Onfido\Model\BiometricToken + */ + public function getBiometricToken() + { + return $this->container['biometric_token']; + } + + /** + * Sets biometric_token + * + * @param \Onfido\Model\BiometricToken $biometric_token biometric_token + * + * @return self + */ + public function setBiometricToken($biometric_token) + { + if (is_null($biometric_token)) { + throw new \InvalidArgumentException('non-nullable biometric_token cannot be null'); + } + $this->container['biometric_token'] = $biometric_token; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Webhook.php b/lib/Model/Webhook.php index 1491ad4..902c453 100644 --- a/lib/Model/Webhook.php +++ b/lib/Model/Webhook.php @@ -67,6 +67,7 @@ class Webhook implements ModelInterface, ArrayAccess, \JsonSerializable 'oauth_server_client_secret' => 'string', 'oauth_server_scope' => 'string', 'id' => 'string', + 'name' => 'string', 'url' => 'string', 'token' => 'string', 'href' => 'string' @@ -90,6 +91,7 @@ class Webhook implements ModelInterface, ArrayAccess, \JsonSerializable 'oauth_server_client_secret' => null, 'oauth_server_scope' => null, 'id' => 'uuid', + 'name' => null, 'url' => null, 'token' => null, 'href' => null @@ -111,6 +113,7 @@ class Webhook implements ModelInterface, ArrayAccess, \JsonSerializable 'oauth_server_client_secret' => false, 'oauth_server_scope' => false, 'id' => false, + 'name' => false, 'url' => false, 'token' => false, 'href' => false @@ -212,6 +215,7 @@ public function isNullableSetToNull(string $property): bool 'oauth_server_client_secret' => 'oauth_server_client_secret', 'oauth_server_scope' => 'oauth_server_scope', 'id' => 'id', + 'name' => 'name', 'url' => 'url', 'token' => 'token', 'href' => 'href' @@ -233,6 +237,7 @@ public function isNullableSetToNull(string $property): bool 'oauth_server_client_secret' => 'setOauthServerClientSecret', 'oauth_server_scope' => 'setOauthServerScope', 'id' => 'setId', + 'name' => 'setName', 'url' => 'setUrl', 'token' => 'setToken', 'href' => 'setHref' @@ -254,6 +259,7 @@ public function isNullableSetToNull(string $property): bool 'oauth_server_client_secret' => 'getOauthServerClientSecret', 'oauth_server_scope' => 'getOauthServerScope', 'id' => 'getId', + 'name' => 'getName', 'url' => 'getUrl', 'token' => 'getToken', 'href' => 'getHref' @@ -326,6 +332,7 @@ public function __construct(?array $data = null) $this->setIfExists('oauth_server_client_secret', $data ?? [], null); $this->setIfExists('oauth_server_scope', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); $this->setIfExists('url', $data ?? [], null); $this->setIfExists('token', $data ?? [], null); $this->setIfExists('href', $data ?? [], null); @@ -646,6 +653,33 @@ public function setId($id) return $this; } + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the webhook. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** * Gets url * diff --git a/lib/Model/WebhookBuilder.php b/lib/Model/WebhookBuilder.php index 4301d30..94691a2 100644 --- a/lib/Model/WebhookBuilder.php +++ b/lib/Model/WebhookBuilder.php @@ -66,6 +66,7 @@ class WebhookBuilder implements ModelInterface, ArrayAccess, \JsonSerializable 'oauth_server_client_id' => 'string', 'oauth_server_client_secret' => 'string', 'oauth_server_scope' => 'string', + 'name' => 'string', 'url' => 'string' ]; @@ -86,6 +87,7 @@ class WebhookBuilder implements ModelInterface, ArrayAccess, \JsonSerializable 'oauth_server_client_id' => null, 'oauth_server_client_secret' => null, 'oauth_server_scope' => null, + 'name' => null, 'url' => null ]; @@ -104,6 +106,7 @@ class WebhookBuilder implements ModelInterface, ArrayAccess, \JsonSerializable 'oauth_server_client_id' => false, 'oauth_server_client_secret' => false, 'oauth_server_scope' => false, + 'name' => false, 'url' => false ]; @@ -202,6 +205,7 @@ public function isNullableSetToNull(string $property): bool 'oauth_server_client_id' => 'oauth_server_client_id', 'oauth_server_client_secret' => 'oauth_server_client_secret', 'oauth_server_scope' => 'oauth_server_scope', + 'name' => 'name', 'url' => 'url' ]; @@ -220,6 +224,7 @@ public function isNullableSetToNull(string $property): bool 'oauth_server_client_id' => 'setOauthServerClientId', 'oauth_server_client_secret' => 'setOauthServerClientSecret', 'oauth_server_scope' => 'setOauthServerScope', + 'name' => 'setName', 'url' => 'setUrl' ]; @@ -238,6 +243,7 @@ public function isNullableSetToNull(string $property): bool 'oauth_server_client_id' => 'getOauthServerClientId', 'oauth_server_client_secret' => 'getOauthServerClientSecret', 'oauth_server_scope' => 'getOauthServerScope', + 'name' => 'getName', 'url' => 'getUrl' ]; @@ -307,6 +313,7 @@ public function __construct(?array $data = null) $this->setIfExists('oauth_server_client_id', $data ?? [], null); $this->setIfExists('oauth_server_client_secret', $data ?? [], null); $this->setIfExists('oauth_server_scope', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); $this->setIfExists('url', $data ?? [], null); } @@ -598,6 +605,33 @@ public function setOauthServerScope($oauth_server_scope) return $this; } + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the webhook. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** * Gets url * diff --git a/lib/Model/WebhookCreate.php b/lib/Model/WebhookCreate.php index 23efd93..dc63923 100644 --- a/lib/Model/WebhookCreate.php +++ b/lib/Model/WebhookCreate.php @@ -57,6 +57,7 @@ class WebhookCreate implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'name' => 'string', 'url' => 'string' ]; @@ -68,6 +69,7 @@ class WebhookCreate implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'name' => null, 'url' => null ]; @@ -77,6 +79,7 @@ class WebhookCreate implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ + 'name' => false, 'url' => false ]; @@ -166,6 +169,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'name' => 'name', 'url' => 'url' ]; @@ -175,6 +179,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'name' => 'setName', 'url' => 'setUrl' ]; @@ -184,6 +189,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'name' => 'getName', 'url' => 'getUrl' ]; @@ -244,6 +250,7 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('name', $data ?? [], null); $this->setIfExists('url', $data ?? [], null); } @@ -292,6 +299,33 @@ public function valid() } + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the webhook. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** * Gets url * diff --git a/lib/Model/WebhookResponse.php b/lib/Model/WebhookResponse.php index 192623f..8d08ce2 100644 --- a/lib/Model/WebhookResponse.php +++ b/lib/Model/WebhookResponse.php @@ -58,6 +58,7 @@ class WebhookResponse implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'id' => 'string', + 'name' => 'string', 'url' => 'string', 'token' => 'string', 'href' => 'string' @@ -72,6 +73,7 @@ class WebhookResponse implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'id' => 'uuid', + 'name' => null, 'url' => null, 'token' => null, 'href' => null @@ -84,6 +86,7 @@ class WebhookResponse implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, + 'name' => false, 'url' => false, 'token' => false, 'href' => false @@ -176,6 +179,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'id' => 'id', + 'name' => 'name', 'url' => 'url', 'token' => 'token', 'href' => 'href' @@ -188,6 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'id' => 'setId', + 'name' => 'setName', 'url' => 'setUrl', 'token' => 'setToken', 'href' => 'setHref' @@ -200,6 +205,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'id' => 'getId', + 'name' => 'getName', 'url' => 'getUrl', 'token' => 'getToken', 'href' => 'getHref' @@ -263,6 +269,7 @@ public function getModelName() public function __construct(?array $data = null) { $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); $this->setIfExists('url', $data ?? [], null); $this->setIfExists('token', $data ?? [], null); $this->setIfExists('href', $data ?? [], null); @@ -340,6 +347,33 @@ public function setId($id) return $this; } + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the webhook. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** * Gets url * diff --git a/lib/Model/WebhookUpdate.php b/lib/Model/WebhookUpdate.php index 3298914..76422d1 100644 --- a/lib/Model/WebhookUpdate.php +++ b/lib/Model/WebhookUpdate.php @@ -57,6 +57,7 @@ class WebhookUpdate implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'name' => 'string', 'url' => 'string' ]; @@ -68,6 +69,7 @@ class WebhookUpdate implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'name' => null, 'url' => null ]; @@ -77,6 +79,7 @@ class WebhookUpdate implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ + 'name' => false, 'url' => false ]; @@ -166,6 +169,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'name' => 'name', 'url' => 'url' ]; @@ -175,6 +179,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'name' => 'setName', 'url' => 'setUrl' ]; @@ -184,6 +189,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'name' => 'getName', 'url' => 'getUrl' ]; @@ -244,6 +250,7 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('name', $data ?? [], null); $this->setIfExists('url', $data ?? [], null); } @@ -289,6 +296,33 @@ public function valid() } + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the webhook. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** * Gets url * diff --git a/lib/Model/WebhookUpdater.php b/lib/Model/WebhookUpdater.php index c419f67..2c135d0 100644 --- a/lib/Model/WebhookUpdater.php +++ b/lib/Model/WebhookUpdater.php @@ -66,6 +66,7 @@ class WebhookUpdater implements ModelInterface, ArrayAccess, \JsonSerializable 'oauth_server_client_id' => 'string', 'oauth_server_client_secret' => 'string', 'oauth_server_scope' => 'string', + 'name' => 'string', 'url' => 'string' ]; @@ -86,6 +87,7 @@ class WebhookUpdater implements ModelInterface, ArrayAccess, \JsonSerializable 'oauth_server_client_id' => null, 'oauth_server_client_secret' => null, 'oauth_server_scope' => null, + 'name' => null, 'url' => null ]; @@ -104,6 +106,7 @@ class WebhookUpdater implements ModelInterface, ArrayAccess, \JsonSerializable 'oauth_server_client_id' => false, 'oauth_server_client_secret' => false, 'oauth_server_scope' => false, + 'name' => false, 'url' => false ]; @@ -202,6 +205,7 @@ public function isNullableSetToNull(string $property): bool 'oauth_server_client_id' => 'oauth_server_client_id', 'oauth_server_client_secret' => 'oauth_server_client_secret', 'oauth_server_scope' => 'oauth_server_scope', + 'name' => 'name', 'url' => 'url' ]; @@ -220,6 +224,7 @@ public function isNullableSetToNull(string $property): bool 'oauth_server_client_id' => 'setOauthServerClientId', 'oauth_server_client_secret' => 'setOauthServerClientSecret', 'oauth_server_scope' => 'setOauthServerScope', + 'name' => 'setName', 'url' => 'setUrl' ]; @@ -238,6 +243,7 @@ public function isNullableSetToNull(string $property): bool 'oauth_server_client_id' => 'getOauthServerClientId', 'oauth_server_client_secret' => 'getOauthServerClientSecret', 'oauth_server_scope' => 'getOauthServerScope', + 'name' => 'getName', 'url' => 'getUrl' ]; @@ -307,6 +313,7 @@ public function __construct(?array $data = null) $this->setIfExists('oauth_server_client_id', $data ?? [], null); $this->setIfExists('oauth_server_client_secret', $data ?? [], null); $this->setIfExists('oauth_server_scope', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); $this->setIfExists('url', $data ?? [], null); } @@ -595,6 +602,33 @@ public function setOauthServerScope($oauth_server_scope) return $this; } + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the webhook. + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** * Gets url * From 4306913490a79bbfed3e42839099e88f8b834101 Mon Sep 17 00:00:00 2001 From: Davide Vacca Date: Fri, 3 Jul 2026 15:57:31 +0200 Subject: [PATCH 2/2] ci: run integration tests on scheduled builds Add 'schedule' to the event_name conditions for integration test steps so that the weekly Sunday cron also triggers full test execution. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/php.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 667060b..174b670 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -42,7 +42,8 @@ jobs: github.repository_owner == 'onfido' && (github.event_name == 'pull_request' || github.event_name == 'release' || - github.event_name == 'workflow_dispatch') }} + github.event_name == 'workflow_dispatch' || + github.event_name == 'schedule') }} run: | vendor/bin/phpunit env: @@ -57,7 +58,8 @@ jobs: github.repository_owner == 'onfido' && (github.event_name == 'pull_request' || github.event_name == 'release' || - github.event_name == 'workflow_dispatch') }} + github.event_name == 'workflow_dispatch' || + github.event_name == 'schedule') }} run: | vendor/bin/phpunit env: