diff --git a/.git_hooks/pre-commit b/.git_hooks/pre-commit new file mode 100755 index 00000000..4dfceeb5 --- /dev/null +++ b/.git_hooks/pre-commit @@ -0,0 +1,3 @@ +#!/bin/sh + +docker run --rm -v $(pwd):/code ghcr.io/php-cs-fixer/php-cs-fixer:${FIXER_VERSION:-3-php8.3} fix --config=/code/.php-cs-fixer.php /code/src \ No newline at end of file diff --git a/.github/workflows/coverage-diff.yml b/.github/workflows/coverage-diff.yml new file mode 100644 index 00000000..6c6662c9 --- /dev/null +++ b/.github/workflows/coverage-diff.yml @@ -0,0 +1,118 @@ +name: 'coverage-diff' +on: + pull_request: + +jobs: + coverage-diff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + clean: false + - uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 + with: + php-version: 8.2 + coverage: none + tools: composer:v2 + extensions: xdebug + - name: Install Dependencies + run: composer install -q --profile --ignore-platform-reqs --no-interaction --no-ansi --no-scripts --no-suggest --prefer-dist + - uses: KengoTODA/actions-setup-docker-compose@4677f0d86d41e623c9c6e11e1d910976da297bc0 + with: + version: '2.14.2' + - name: "Create Empty env File for Docker" + run: touch .env + - name: Clear previous coverage data + run: rm -f cov/xml/clover-pr.xml cov/xml/clover-base.xml cov/xml/clover.xml + - name: PHPUnit for PR + run: docker-compose run phpunit + - name: Create coverage report for PR + id: pr_coverage + run: | + php ./generate_coverage_report.php + COVERAGE_PR=$(jq -r '.total.statements.pct' cov/json/index.json) + echo "COVERAGE_PR=$COVERAGE_PR" >> $GITHUB_ENV + - name: Upload coverage report markdown + if: always() + uses: actions/upload-artifact@v4 + with: + name: coverage-report-md + path: cov/markdown/coverage_report.md + + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.base.ref }} + clean: false + + - uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 + with: + php-version: 8.2 + coverage: none + tools: composer:v2 + extensions: xdebug + - name: Install Dependencies + run: composer install -q --profile --ignore-platform-reqs --no-interaction --no-ansi --no-scripts --no-suggest --prefer-dist + - uses: KengoTODA/actions-setup-docker-compose@4677f0d86d41e623c9c6e11e1d910976da297bc0 + with: + version: '2.14.2' + - name: "Create Empty env File for Docker" + run: touch .env + - name: PHPUnit for Base + run: docker-compose run phpunit + - name: Create coverage report for Base + id: base_coverage + run: | + COVERAGE_BASE=0 + + if [ -f "./generate_coverage_report.php" ]; then + php ./generate_coverage_report.php + fi + + if [ -f "cov/json/index.json" ]; then + COVERAGE_BASE=$(jq -r '.total.statements.pct' cov/json/index.json) + fi + + echo "COVERAGE_BASE=$COVERAGE_BASE" >> $GITHUB_ENV + + - name: Compare coverage + id: compare_coverage + run: | + COVERAGE_DIFF=$(echo "$COVERAGE_PR - $COVERAGE_BASE" | awk '{printf "%.2f", $0}') + echo "Coverage PR: $COVERAGE_PR%" + echo "Coverage Base: $COVERAGE_BASE%" + echo "Coverage Diff: $COVERAGE_DIFF%" + + if (( $(echo "$COVERAGE_DIFF > 0" | awk '{print ($0 > 0)}') )); then + COVERAGE_MESSAGE=":green_circle: Coverage increased by $COVERAGE_DIFF%" + elif (( $(echo "$COVERAGE_DIFF < 0" | awk '{print ($0 < 0)}') )); then + COVERAGE_MESSAGE=":red_circle: Coverage decreased by ${COVERAGE_DIFF#-}%" + else + COVERAGE_MESSAGE=":yellow_circle: Coverage remained the same." + fi + + echo "COVERAGE_MESSAGE=$COVERAGE_MESSAGE" >> $GITHUB_ENV + + - name: Download coverage report markdown + uses: actions/download-artifact@v4 + with: + name: coverage-report-md + path: cov/markdown/ + + - name: Combine Coverage Message and Report + run: | + echo "${COVERAGE_MESSAGE}" > coverage_message.txt + cat cov/markdown/coverage_report.md >> coverage_message.txt + combined_message=$(cat coverage_message.txt) + echo "combined_message<> $GITHUB_ENV + echo "$combined_message" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + - name: Add comment with coverage report + uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 + with: + message: "${{ env.combined_message }}" + - name: Add coverage report to the job summary + run: | + { + echo "${{ env.combined_message }}" + } >> $GITHUB_STEP_SUMMARY \ No newline at end of file diff --git a/.github/workflows/coverage-report.yml b/.github/workflows/coverage-report.yml new file mode 100644 index 00000000..2ed93a63 --- /dev/null +++ b/.github/workflows/coverage-report.yml @@ -0,0 +1,42 @@ +name: 'coverage-report' +on: + push: + branches: + - main + +permissions: + contents: write +jobs: + coverage-report: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 + with: + php-version: 8.2 + coverage: none + tools: composer:v2 + extensions: xdebug + - name: Install Dependencies + run: composer install -q --profile --ignore-platform-reqs --no-interaction --no-ansi --no-scripts --no-suggest --prefer-dist + - uses: KengoTODA/actions-setup-docker-compose@4677f0d86d41e623c9c6e11e1d910976da297bc0 + with: + version: '2.14.2' + - name: "Create Empty env File for Docker" + run: touch .env + - name: PHPUnit + run: docker-compose run --user "$(id -u):$(id -g)" phpunit + - name: "Parse Coverage" + run: "php ./generate_coverage_report.php" + - name: Create Coverage Badges + uses: jaywcjlove/coverage-badges-cli@df58615045079f1c827de7867044bbab3ec22b43 + with: + source: cov/json/index.json + output: cov/html/coverage.svg + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@920cbb300dcd3f0568dbc42700c61e2fd9e6139c + with: + branch: gh-pages + folder: cov/html + clean-exclude: | + .nojekyll \ No newline at end of file diff --git a/.github/workflows/functional.yml b/.github/workflows/functional.yml index 433e9d5c..9dc31240 100644 --- a/.github/workflows/functional.yml +++ b/.github/workflows/functional.yml @@ -22,7 +22,7 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - name: Setup PHP - uses: shivammathur/setup-php@v2 + uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 with: php-version: "${{ matrix.php_version }}" coverage: none diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4b46db6b..0d84fd91 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,14 +17,14 @@ jobs: steps: - uses: actions/checkout@v4 - name: Setup PHP - uses: shivammathur/setup-php@v2 + uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 with: php-version: "${{ matrix.php_version }}" coverage: none tools: composer:v2 - name: Install Dependencies run: composer install -q --profile --ignore-platform-reqs --no-interaction --no-ansi --no-scripts --no-suggest --prefer-dist - - uses: php-actions/phpunit@v3 + - uses: php-actions/phpunit@aed47a6852905dbd05b7c1a47c526b38fcc4bc17 with: php_version: "${{ matrix.php_version }}" bootstrap: vendor/autoload.php diff --git a/.gitignore b/.gitignore index c54920c8..94d68667 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,7 @@ .vscode .env release/yarn-error.log -release/node_modules \ No newline at end of file +release/node_modules +.php-cs-fixer.cache +cov/**/*.* +!cov/**/.gitkeep \ No newline at end of file diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 00000000..59505d88 --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,21 @@ +setRules([ + '@PSR12' => true, + '@PhpCsFixer' => true, + 'array_indentation' => true, + 'trailing_comma_in_multiline' => ['elements' => ['arrays']], + 'no_whitespace_before_comma_in_array' => true, + 'whitespace_after_comma_in_array' => true, + 'array_syntax' => ['syntax' => 'short'], + 'binary_operator_spaces' => [ + 'default' => 'single_space', + 'operators' => ['=>' => null], + ], + 'multiline_whitespace_before_semicolons' => false, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->in(__DIR__) + ); \ No newline at end of file diff --git a/.swagger-codegen-ignore b/.swagger-codegen-ignore index 7d61e7c8..9bf2c9b9 100644 --- a/.swagger-codegen-ignore +++ b/.swagger-codegen-ignore @@ -3,4 +3,6 @@ src/phpunit.xml.dist src/.travis.yml src/.php_cs src/git_push.sh -src/test/** \ No newline at end of file +src/test/** +src/HeaderSelector.php +src/ObjectSerializer.php \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b994d5fe..4967cd03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,38 @@ +## [5.0.0-develop.1](https://github.com/fingerprintjs/fingerprint-pro-server-api-php-sdk/compare/v4.1.0...v5.0.0-develop.1) (2024-09-04) + + +### ⚠ BREAKING CHANGES + +* Renamed Error Response Model Names +`ErrorEvent403ResponseError` → `Common403ErrorResponse` +`ManyRequestsResponse` → `TooManyRequestsResponse` +* Webhook `tag` field is now optional +* API Methods now throws `SerializationException` +* API Methods returns tuple instead of models +* API Methods removed other than `getModel` +* Upgraded minimum php version to 8.1 +* Request logic is rewritten, Upgraded minimum php version to 8.1 + +### Features + +* add `remoteControl`, `velocity` and `developerTools` signals ([5bf9368](https://github.com/fingerprintjs/fingerprint-pro-server-api-php-sdk/commit/5bf9368fb1bb5abbfa72366fe6c66fe32352ad54)) +* add delete visitor data endpoint ([a00f325](https://github.com/fingerprintjs/fingerprint-pro-server-api-php-sdk/commit/a00f325706af38cc20e4c387db44dfa83c7a7a22)) +* add retry after policy to api exception ([64e0510](https://github.com/fingerprintjs/fingerprint-pro-server-api-php-sdk/commit/64e05100a2c20c8d1f8e5f9719ee5292c59761c2)) +* add support for validating webhook signatures inter-768 ([6a4cbd6](https://github.com/fingerprintjs/fingerprint-pro-server-api-php-sdk/commit/6a4cbd6e2a521a209806337d90ae8f7e291a534b)) +* add update event endpoint (PUT) ([cb21d0b](https://github.com/fingerprintjs/fingerprint-pro-server-api-php-sdk/commit/cb21d0b4c48b7b94f4e9a7de1ab74313fe339e5f)) +* change api to return tuple instead of serialized model ([62e4ad3](https://github.com/fingerprintjs/fingerprint-pro-server-api-php-sdk/commit/62e4ad3020425667f45e3beeb166b4095a437ab5)) +* introduce rawResponse for getVisits and getEvent methods ([9b01ba6](https://github.com/fingerprintjs/fingerprint-pro-server-api-php-sdk/commit/9b01ba65e7ac794c77afedc155823baef2c80b17)) +* introduce serialization exception ([bfea23a](https://github.com/fingerprintjs/fingerprint-pro-server-api-php-sdk/commit/bfea23a50b61152d4fc65d290c730d0e3fcb6123)) +* only generate models and docs from swagger codegen ([26e984f](https://github.com/fingerprintjs/fingerprint-pro-server-api-php-sdk/commit/26e984ffd01dc9f21af3dd4da75fcb7e4309961f)) +* remove raw response and introduce with http info ([ce2fedf](https://github.com/fingerprintjs/fingerprint-pro-server-api-php-sdk/commit/ce2fedfcd94f5f1459049ba49eff75e2d3b8620c)) +* rewrite request logic ([0016822](https://github.com/fingerprintjs/fingerprint-pro-server-api-php-sdk/commit/001682270fd4370484b25062550a65bd375b9372)) +* upgrade min php version to 8 ([5698871](https://github.com/fingerprintjs/fingerprint-pro-server-api-php-sdk/commit/5698871fa497ee4ad50b2941d39769b45f15dfc2)) + + +### Bug Fixes + +* serializaiton problem on sealed results ([29cb26c](https://github.com/fingerprintjs/fingerprint-pro-server-api-php-sdk/commit/29cb26c3f50bfa035ca750948bb92a2299f579bd)) + ## [4.1.0](https://github.com/fingerprintjs/fingerprint-pro-server-api-php-sdk/compare/v4.0.0...v4.1.0) (2024-03-26) diff --git a/README.md b/README.md index 0f198b1c..6996a129 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@

CI badge CI badge +Unit Test Coverage CI badge Latest Stable Version on Packagist PHP Version Require @@ -23,7 +24,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 3 - - Package version: 4.1.0 + - Package version: dev-5.0.0-1 - Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen ## Requirements @@ -84,6 +85,7 @@ const PAGINATION_KEY = "1683900801733.Ogvu1j"; // Import Fingerprint Pro Classes and Guzzle Http Client use Fingerprint\ServerAPI\Api\FingerprintApi; use Fingerprint\ServerAPI\Configuration; +use Fingerprint\ServerAPI\Model\EventUpdateRequest; use GuzzleHttp\Client; // Create a new Configuration instance with your Fingerprint Pro Server API Key and your Fingerprint Pro Server API Region. @@ -104,7 +106,7 @@ $client = new FingerprintApi( // Get an event with a given requestId try { // Fetch the event with a given requestId - $response = $client->getEvent(FPJS_REQUEST_ID); + list($model, $response) = $client->getEvent(FPJS_REQUEST_ID); echo "

" . $response->__toString() . "
"; } catch (Exception $e) { echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL; @@ -113,31 +115,56 @@ try { // Get a specific visitor's all visits try { // Fetch all visits with a given visitorId, with a page limit - $response = $client->getVisits(FPJS_VISITOR_ID, null, null, LIMIT); + list($model, $response) = $client->getVisits(FPJS_VISITOR_ID, null, null, LIMIT); echo "
" . $response->__toString() . "
"; } catch (Exception $e) { - echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FingerprintApi->getVisits: ', $e->getMessage(), PHP_EOL; } // Get a specific visitor's all visits with a linkedId try { // Fetch all visits with a given visitorId, with a page limit, skipping the first visit - $response = $client->getVisits(FPJS_VISITOR_ID, null, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY); + list($model, $response) = $client->getVisits(FPJS_VISITOR_ID, null, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY); echo "
" . $response->__toString() . "
"; } catch (Exception $e) { - echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FingerprintApi->getVisits: ', $e->getMessage(), PHP_EOL; } // Use all the parameters on getVisits try { // Fetch the visitor's all visits with a given requestId and linkedId with a page limit while skipping the first visit - $response = $client->getVisits(FPJS_VISITOR_ID, FPJS_REQUEST_ID, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY); + list($model, $response) = $client->getVisits(FPJS_VISITOR_ID, FPJS_REQUEST_ID, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY); echo "
" . $response->__toString() . "
"; } catch (Exception $e) { - echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FingerprintApi->getVisits: ', $e->getMessage(), PHP_EOL; +} + +// Update Event +try { + $body = new EventUpdateRequest([ + 'linked_id' => 'new linked id', + 'tag' => json_encode(['new_property' => 'new value']), + 'suspect' => true, + ]); + list($model, $response) = $client->updateEvent($body, FPJS_REQUEST_ID); + echo "
" . $response->__toString() . "
"; +} catch (Exception $e) { + echo 'Exception when calling FingerprintApi->updateEvent: ', $e->getMessage(), PHP_EOL; +} + +// Delete by visitor ID +try { + list($model, $response) = $client->deleteVisitorData(FPJS_VISITOR_ID); + echo "
" . $response->__toString() . "
"; +} catch (Exception $e) { + echo 'Exception when calling FingerprintApi->deleteVisitorData: ', $e->getMessage(), PHP_EOL; } ``` +> ⚠️ Warning It's not possible to update events older than 10 days. + +> ⚠️ If you are interested in using `deleteVisitorData` API, please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. + ## Sealed results This SDK provides utility methods for decoding [sealed results](https://dev.fingerprint.com/docs/sealed-client-results). @@ -174,13 +201,43 @@ All URIs are relative to your region's base URL. | Europe | https://eu.api.fpjs.io | | Asia | https://ap.api.fpjs.io | +## Webhook Signing + +This SDK provides utility method for verifying the HMAC signature of the incoming webhook request. +You can use below code to verify signature: + +```php +=5.5" + "php": "^7.2.5 || ^8.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.5-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\Promise\\": "src/" } @@ -242,20 +195,38 @@ "keywords": [ "promise" ], - "time": "2022-08-28T14:55:35+00:00" + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2024-07-18T10:29:17+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.5.0", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6" + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", "shasum": "" }, "require": { @@ -269,9 +240,9 @@ "psr/http-message-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.29 || ^9.5.23" + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -342,7 +313,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.5.0" + "source": "https://github.com/guzzle/psr7/tree/2.7.0" }, "funding": [ { @@ -358,100 +329,25 @@ "type": "tidelift" } ], - "time": "2023-04-17T16:11:26+00:00" - }, - { - "name": "phpoption/phpoption", - "version": "1.9.1", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/php-option.git", - "reference": "dd3a383e599f49777d8b628dadbb90cae435b87e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dd3a383e599f49777d8b628dadbb90cae435b87e", - "reference": "dd3a383e599f49777d8b628dadbb90cae435b87e", - "shasum": "" - }, - "require": { - "php": "^7.2.5 || ^8.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.32 || ^9.6.3 || ^10.0.12" - }, - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": true - }, - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpOption\\": "src/PhpOption/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh" - }, - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - } - ], - "description": "Option Type for PHP", - "keywords": [ - "language", - "option", - "php", - "type" - ], - "support": { - "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.9.1" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", - "type": "tidelift" - } - ], - "time": "2023-02-25T19:38:58+00:00" + "time": "2024-07-18T11:15:46+00:00" }, { "name": "psr/http-client", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", "shasum": "" }, "require": { "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -471,7 +367,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP clients", @@ -482,24 +378,27 @@ "psr", "psr-18" ], - "time": "2020-06-29T06:28:15+00:00" + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" }, { "name": "psr/http-factory", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", + "php": ">=7.1", "psr/http-message": "^1.0 || ^2.0" }, "type": "library", @@ -523,7 +422,7 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -535,22 +434,22 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2023-04-10T20:10:41+00:00" + "time": "2024-04-15T12:06:14+00:00" }, { "name": "psr/http-message", - "version": "1.1", + "version": "2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { @@ -559,7 +458,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -574,7 +473,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", @@ -588,9 +487,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/1.1" + "source": "https://github.com/php-fig/http-message/tree/2.0" }, - "time": "2023-04-04T09:50:52+00:00" + "time": "2023-04-04T09:54:51+00:00" }, { "name": "ralouphie/getallheaders", @@ -638,25 +537,25 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.2", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -684,580 +583,90 @@ ], "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", - "time": "2022-01-02T09:53:40+00:00" - }, + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + } + ], + "packages-dev": [ { - "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "name": "doctrine/deprecations", + "version": "1.1.3", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "url": "https://github.com/doctrine/deprecations.git", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", "shasum": "" }, "require": { - "php": ">=7.1" + "php": "^7.1 || ^8.0" }, - "provide": { - "ext-ctype": "*" + "require-dev": { + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" }, "suggest": { - "ext-ctype": "For best performance" + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "time": "2022-11-03T14:55:06+00:00" + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + }, + "time": "2024-01-30T19:34:25+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "name": "doctrine/instantiator", + "version": "1.5.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "url": "https://github.com/doctrine/instantiator.git", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2022-11-03T14:55:06+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.27.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2022-11-03T14:55:06+00:00" - }, - { - "name": "vlucas/phpdotenv", - "version": "v5.5.0", - "source": { - "type": "git", - "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", - "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", - "shasum": "" - }, - "require": { - "ext-pcre": "*", - "graham-campbell/result-type": "^1.0.2", - "php": "^7.1.3 || ^8.0", - "phpoption/phpoption": "^1.8", - "symfony/polyfill-ctype": "^1.23", - "symfony/polyfill-mbstring": "^1.23.1", - "symfony/polyfill-php80": "^1.23.1" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "ext-filter": "*", - "phpunit/phpunit": "^7.5.20 || ^8.5.30 || ^9.5.25" - }, - "suggest": { - "ext-filter": "Required to use the boolean validator." - }, - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": true - }, - "branch-alias": { - "dev-master": "5.5-dev" - } - }, - "autoload": { - "psr-4": { - "Dotenv\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Vance Lucas", - "email": "vance@vancelucas.com", - "homepage": "https://github.com/vlucas" - } - ], - "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", - "keywords": [ - "dotenv", - "env", - "environment" - ], - "support": { - "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.5.0" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", - "type": "tidelift" - } - ], - "time": "2022-10-16T01:01:54+00:00" - } - ], - "packages-dev": [ - { - "name": "composer/pcre", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" - ], - "time": "2022-01-21T20:24:37+00:00" - }, - { - "name": "composer/semver", - "version": "3.3.2", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "time": "2022-04-01T19:23:25+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/9e36aeed4616366d2b690bdce11f71e9178c579a", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a", - "shasum": "" - }, - "require": { - "composer/pcre": "^1", - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "time": "2022-02-24T20:20:32+00:00" - }, - { - "name": "doctrine/annotations", - "version": "1.14.3", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", - "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", - "shasum": "" - }, - "require": { - "doctrine/lexer": "^1 || ^2", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^9 || ^10", - "phpstan/phpstan": "~1.4.10 || ^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^4.4 || ^5.4 || ^6", - "vimeo/psalm": "^4.10" - }, - "suggest": { - "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "time": "2023-02-01T09:20:38+00:00" - }, - { - "name": "doctrine/deprecations", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/deprecations.git", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", - "shasum": "" - }, - "require": { - "php": "^7.1|^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9", - "phpunit/phpunit": "^7.5|^8.5|^9.5", - "psr/log": "^1|^2|^3" - }, - "suggest": { - "psr/log": "Allows logging deprecations via PSR-3 logger implementation" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", - "time": "2022-05-02T15:47:09+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^9 || ^11", @@ -1286,419 +695,191 @@ "homepage": "https://ocramius.github.io/" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2022-12-30T00:15:36+00:00" - }, - { - "name": "doctrine/lexer", - "version": "2.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", - "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", - "shasum": "" - }, - "require": { - "doctrine/deprecations": "^1.0", - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9 || ^10", - "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^4.11 || ^5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], - "time": "2022-12-14T08:49:07+00:00" - }, - { - "name": "friendsofphp/php-cs-fixer", - "version": "v2.19.3", - "source": { - "type": "git", - "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/75ac86f33fab4714ea5a39a396784d83ae3b5ed8", - "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8", - "shasum": "" - }, - "require": { - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.2 || ^2.0", - "doctrine/annotations": "^1.2", - "ext-json": "*", - "ext-tokenizer": "*", - "php": "^5.6 || ^7.0 || ^8.0", - "php-cs-fixer/diff": "^1.3", - "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0", - "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", - "symfony/filesystem": "^3.0 || ^4.0 || ^5.0", - "symfony/finder": "^3.0 || ^4.0 || ^5.0", - "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0", - "symfony/polyfill-php70": "^1.0", - "symfony/polyfill-php72": "^1.4", - "symfony/process": "^3.0 || ^4.0 || ^5.0", - "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" - }, - "require-dev": { - "justinrainbow/json-schema": "^5.0", - "keradus/cli-executor": "^1.4", - "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.4.2", - "php-cs-fixer/accessible-object": "^1.0", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy-phpunit": "^1.1 || ^2.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5", - "phpunitgoodpractices/polyfill": "^1.5", - "phpunitgoodpractices/traits": "^1.9.1", - "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", - "symfony/phpunit-bridge": "^5.2.1", - "symfony/yaml": "^3.0 || ^4.0 || ^5.0" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters.", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", - "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." - }, - "bin": [ - "php-cs-fixer" - ], - "type": "application", - "extra": { - "branch-alias": { - "dev-master": "2.19-dev" - } - }, - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - }, - "classmap": [ - "tests/Test/AbstractFixerTestCase.php", - "tests/Test/AbstractIntegrationCaseFactory.php", - "tests/Test/AbstractIntegrationTestCase.php", - "tests/Test/Assert/AssertTokensTrait.php", - "tests/Test/IntegrationCase.php", - "tests/Test/IntegrationCaseFactory.php", - "tests/Test/IntegrationCaseFactoryInterface.php", - "tests/Test/InternalIntegrationCaseFactory.php", - "tests/Test/IsIdenticalConstraint.php", - "tests/Test/TokensWithObservedTransformers.php", - "tests/TestCase.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" - } - ], - "description": "A tool to automatically fix PHP code style", - "time": "2021-11-15T17:17:55+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" - }, - "type": "library", - "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "time": "2022-03-03T13:19:32+00:00" - }, - { - "name": "phar-io/manifest", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + }, + "funding": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" }, { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" } ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2021-07-20T11:28:43+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { - "name": "phar-io/version", - "version": "3.2.1", + "name": "graham-campbell/result-type", + "version": "v1.1.3", "source": { "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "3ba905c11371512af9d9bdd27d99b782216b6945" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/3ba905c11371512af9d9bdd27d99b782216b6945", + "reference": "3ba905c11371512af9d9bdd27d99b782216b6945", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9.3" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" }, "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "GrahamCampbell\\ResultType\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "An Implementation Of The Result Type", + "keywords": [ + "Graham Campbell", + "GrahamCampbell", + "Result Type", + "Result-Type", + "result" + ], + "support": { + "issues": "https://github.com/GrahamCampbell/Result-Type/issues", + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.3" + }, + "funding": [ { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" + "url": "https://github.com/GrahamCampbell", + "type": "github" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", + "type": "tidelift" } ], - "description": "Library for handling version information and constraints", - "time": "2022-02-21T01:04:05+00:00" + "time": "2024-07-20T21:45:45+00:00" }, { - "name": "php-cs-fixer/diff", - "version": "v1.3.1", + "name": "myclabs/deep-copy", + "version": "1.12.0", "source": { "type": "git", - "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0 || ^8.0" + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", - "symfony/process": "^3.3" + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + }, + "funding": [ { - "name": "SpacePossum" + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" } ], - "description": "sebastian/diff v2 backport support for PHP5.6", - "homepage": "https://github.com/PHP-CS-Fixer", - "keywords": [ - "diff" - ], - "abandoned": true, - "time": "2020-10-14T08:39:05+00:00" + "time": "2024-06-12T14:39:25+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "7.0.15", + "name": "nikic/php-parser", + "version": "v5.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "819f92bba8b001d4363065928088de22f25a3a48" + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/819f92bba8b001d4363065928088de22f25a3a48", - "reference": "819f92bba8b001d4363065928088de22f25a3a48", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/683130c2ff8c2739f4822ff7ac5c873ec529abd1", + "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": ">=7.2", - "phpunit/php-file-iterator": "^2.0.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.1.3 || ^4.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^4.2.2", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1.3" + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" }, "require-dev": { - "phpunit/phpunit": "^8.2.2" - }, - "suggest": { - "ext-xdebug": "^2.7.2" + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" }, + "bin": [ + "bin/php-parse" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "7.0-dev" + "dev-master": "5.0-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1706,39 +887,41 @@ ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Nikita Popov" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "description": "A PHP parser written in PHP", "keywords": [ - "coverage", - "testing", - "xunit" + "parser", + "php" ], - "time": "2021-07-26T12:20:09+00:00" + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0" + }, + "time": "2024-07-01T20:03:41+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "2.0.5", + "name": "phar-io/manifest", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5" + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { @@ -1756,36 +939,51 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", - "role": "lead" + "role": "Developer" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } ], - "time": "2021-12-02T12:42:26+00:00" + "time": "2024-03-03T12:33:53+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", + "name": "phar-io/version", + "version": "3.2.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -1798,264 +996,314 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", - "role": "lead" + "role": "Developer" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" }, { - "name": "phpunit/php-timer", - "version": "2.1.3", + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662" + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", "shasum": "" }, "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-2.x": "2.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", "keywords": [ - "timer" + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" ], - "time": "2020-11-30T08:20:02+00:00" + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "4.0.4", + "name": "phpdocumentor/reflection-docblock", + "version": "5.4.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3" + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/a853a0e183b9db7eed023d7933a858fa1c8d25a3", - "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", + "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": "^7.3 || ^8.0" + "doctrine/deprecations": "^1.1", + "ext-filter": "*", + "php": "^7.4 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.7", + "phpstan/phpdoc-parser": "^1.7", + "webmozart/assert": "^1.9.1" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "mockery/mockery": "~1.3.5", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-webmozart-assert": "^1.2", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^5.13" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "5.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "abandoned": true, - "time": "2020-08-04T08:28:15+00:00" + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.1" + }, + "time": "2024-05-21T05:55:05+00:00" }, { - "name": "phpunit/phpunit", - "version": "8.5.33", + "name": "phpdocumentor/type-resolver", + "version": "1.8.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e" + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "153ae662783729388a584b4361f2545e4d841e3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e", - "reference": "7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", + "reference": "153ae662783729388a584b4361f2545e4d841e3c", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.0", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.2", - "phpunit/php-code-coverage": "^7.0.12", - "phpunit/php-file-iterator": "^2.0.4", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1.2", - "sebastian/comparator": "^3.0.5", - "sebastian/diff": "^3.0.2", - "sebastian/environment": "^4.2.3", - "sebastian/exporter": "^3.1.5", - "sebastian/global-state": "^3.0.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0.1", - "sebastian/type": "^1.1.3", - "sebastian/version": "^2.0.1" + "doctrine/deprecations": "^1.0", + "php": "^7.3 || ^8.0", + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^1.13" }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0.0" + "require-dev": { + "ext-tokenizer": "*", + "phpbench/phpbench": "^1.2", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" }, - "bin": [ - "phpunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "8.5-dev" + "dev-1.x": "1.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Mike van Riel", + "email": "me@mikevanriel.com" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2023-02-27T13:04:50+00:00" + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" + }, + "time": "2024-02-23T11:10:43+00:00" }, { - "name": "psr/cache", - "version": "1.0.1", + "name": "phpoption/phpoption", + "version": "1.9.3", "source": { "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/e3fac8b24f56113f7cb96af14958c0dd16330f54", + "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" }, "type": "library", "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.9-dev" } }, "autoload": { "psr-4": { - "Psr\\Cache\\": "src/" + "PhpOption\\": "src/PhpOption/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "Apache-2.0" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "https://github.com/schmittjoh" + }, + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" } ], - "description": "Common interface for caching libraries", + "description": "Option Type for PHP", "keywords": [ - "cache", - "psr", - "psr-6" + "language", + "option", + "php", + "type" + ], + "support": { + "issues": "https://github.com/schmittjoh/php-option/issues", + "source": "https://github.com/schmittjoh/php-option/tree/1.9.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", + "type": "tidelift" + } ], - "time": "2016-08-06T20:24:11+00:00" + "time": "2024-07-20T21:41:07+00:00" }, { - "name": "psr/container", - "version": "1.1.2", + "name": "phpspec/prophecy", + "version": "v1.19.0", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "url": "https://github.com/phpspec/prophecy.git", + "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/67a759e7d8746d501c41536ba40cd9c0a07d6a87", + "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87", "shasum": "" }, "require": { - "php": ">=7.4.0" + "doctrine/instantiator": "^1.2 || ^2.0", + "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.*", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0 || ^5.0 || ^6.0", + "sebastian/recursion-context": "^3.0 || ^4.0 || ^5.0 || ^6.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0 || ^7.0", + "phpstan/phpstan": "^1.9", + "phpunit/phpunit": "^8.0 || ^9.0 || ^10.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, "autoload": { "psr-4": { - "Psr\\Container\\": "src/" + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", @@ -2064,138 +1312,181 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" + "Double", + "Dummy", + "dev", + "fake", + "mock", + "spy", + "stub" ], - "time": "2021-11-05T16:50:12+00:00" + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.19.0" + }, + "time": "2024-02-29T11:52:51+00:00" }, { - "name": "psr/event-dispatcher", - "version": "1.0.0", + "name": "phpstan/phpdoc-parser", + "version": "1.29.1", "source": { "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fcaefacf2d5c417e928405b71b400d4ce10daaf4", + "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": "^7.2 || ^8.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } + "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" }, + "type": "library", "autoload": { "psr-4": { - "Psr\\EventDispatcher\\": "src/" + "PHPStan\\PhpDocParser\\": [ + "src/" + ] } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], - "time": "2019-01-08T18:20:26+00:00" + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.1" + }, + "time": "2024-05-31T08:52:43+00:00" }, { - "name": "psr/log", - "version": "1.1.4", + "name": "phpunit/php-code-coverage", + "version": "9.2.32", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { - "php": ">=5.3.0" + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.19.1 || ^5.1.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.6" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-main": "9.2.x-dev" } }, "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", "keywords": [ - "log", - "psr", - "psr-3" + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2021-05-03T11:20:27+00:00" + "time": "2024-08-22T04:23:01+00:00" }, { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.2", + "name": "phpunit/php-file-iterator", + "version": "3.0.6", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2210,39 +1501,56 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2020-11-30T08:15:22+00:00" + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" }, { - "name": "sebastian/comparator", - "version": "3.0.5", + "name": "phpunit/php-invoker", + "version": "3.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770" + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dc7ceb4a24aede938c7af2a9ed1de09609ca770", - "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", "shasum": "" }, "require": { - "php": ">=7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -2257,55 +1565,51 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", "keywords": [ - "comparator", - "compare", - "equality" + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2022-09-14T12:31:48+00:00" + "time": "2020-09-28T05:58:55+00:00" }, { - "name": "sebastian/diff", - "version": "3.0.3", + "name": "phpunit/php-text-template", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -2320,50 +1624,51 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" + "template" ], - "time": "2020-11-30T07:59:04+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" }, { - "name": "sebastian/environment", - "version": "4.2.4", + "name": "phpunit/php-timer", + "version": "5.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0" + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^7.5" - }, - "suggest": { - "ext-posix": "*" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -2378,47 +1683,91 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", "keywords": [ - "Xdebug", - "environment", - "hhvm" + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2020-11-30T07:53:42+00:00" + "time": "2020-10-26T13:16:10+00:00" }, { - "name": "sebastian/exporter", - "version": "3.1.5", + "name": "phpunit/phpunit", + "version": "9.3.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6" + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "05c76e25f90e40af2cf2b1b39e6d49c5e74aa84c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/73a9676f2833b9a7c36968f9d882589cd75511e6", - "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/05c76e25f90e40af2cf2b1b39e6d49c5e74aa84c", + "reference": "05c76e25f90e40af2cf2b1b39e6d49c5e74aa84c", "shasum": "" }, "require": { - "php": ">=7.0", - "sebastian/recursion-context": "^3.0" + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.1", + "phar-io/version": "^3.0.2", + "php": "^7.3 || ^8.0", + "phpspec/prophecy": "^1.11.1", + "phpunit/php-code-coverage": "^9.0", + "phpunit/php-file-iterator": "^3.0.4", + "phpunit/php-invoker": "^3.1", + "phpunit/php-text-template": "^2.0.2", + "phpunit/php-timer": "^5.0.1", + "sebastian/code-unit": "^1.0.5", + "sebastian/comparator": "^4.0.3", + "sebastian/diff": "^4.0.2", + "sebastian/environment": "^5.1.2", + "sebastian/exporter": "^4.0.2", + "sebastian/global-state": "^5.0", + "sebastian/object-enumerator": "^4.0.2", + "sebastian/resource-operations": "^3.0.2", + "sebastian/type": "^2.2.1", + "sebastian/version": "^3.0.1" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^8.5" + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" }, + "bin": [ + "phpunit" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "9.3-dev" } }, "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], "classmap": [ "src/" ] @@ -2430,63 +1779,57 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.3" + }, + "funding": [ { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "url": "https://phpunit.de/donate.html", + "type": "custom" }, { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2022-09-14T06:00:17+00:00" + "time": "2020-08-07T04:24:24+00:00" }, { - "name": "sebastian/global-state", - "version": "3.0.2", + "name": "sebastian/code-unit", + "version": "1.0.8", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "de036ec91d55d2a9e0db2ba975b512cdb1c23921" + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/de036ec91d55d2a9e0db2ba975b512cdb1c23921", - "reference": "de036ec91d55d2a9e0db2ba975b512cdb1c23921", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", "shasum": "" }, "require": { - "php": ">=7.2", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" + "php": ">=7.3" }, "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^8.0" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -2501,42 +1844,48 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2022-02-10T06:55:38+00:00" + "time": "2020-10-26T13:08:54+00:00" }, { - "name": "sebastian/object-enumerator", - "version": "3.0.4", + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", "shasum": "" }, "require": { - "php": ">=7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -2554,34 +1903,46 @@ "email": "sebastian@phpunit.de" } ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2020-11-30T07:40:27+00:00" + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" }, { - "name": "sebastian/object-reflector", - "version": "1.1.2", + "name": "sebastian/comparator", + "version": "4.0.8", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { - "php": ">=7.0" + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2597,36 +1958,64 @@ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" } ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2020-11-30T07:37:18+00:00" + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T12:41:17+00:00" }, { - "name": "sebastian/recursion-context", - "version": "3.0.1", + "name": "sebastian/complexity", + "version": "2.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", "shasum": "" }, "require": { - "php": ">=7.0" + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -2641,42 +2030,49 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + }, + "funding": [ { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2020-11-30T07:34:24+00:00" + "time": "2023-12-22T06:19:30+00:00" }, { - "name": "sebastian/resource-operations", - "version": "2.0.2", + "name": "sebastian/diff", + "version": "4.0.6", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3" + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2692,36 +2088,59 @@ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2020-11-30T07:30:19+00:00" + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:30:58+00:00" }, { - "name": "sebastian/type", - "version": "1.1.4", + "name": "sebastian/environment", + "version": "5.1.5", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4" + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0150cfbc4495ed2df3872fb31b26781e4e077eb4", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { - "php": ">=7.2" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^8.2" + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -2736,35 +2155,54 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "time": "2020-11-30T07:25:11+00:00" + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+00:00" }, { - "name": "sebastian/version", - "version": "2.0.1", + "name": "sebastian/exporter", + "version": "4.0.6", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2779,72 +2217,78 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:33:00+00:00" }, { - "name": "squizlabs/php_codesniffer", - "version": "2.9.2", + "name": "sebastian/global-state", + "version": "5.0.7", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", - "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", "shasum": "" }, "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.1.2" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" }, - "bin": [ - "scripts/phpcs", - "scripts/phpcbf" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "5.0-dev" } }, "autoload": { "classmap": [ - "CodeSniffer.php", - "CodeSniffer/CLI.php", - "CodeSniffer/Exception.php", - "CodeSniffer/File.php", - "CodeSniffer/Fixer.php", - "CodeSniffer/Report.php", - "CodeSniffer/Reporting.php", - "CodeSniffer/Sniff.php", - "CodeSniffer/Tokens.php", - "CodeSniffer/Reports/", - "CodeSniffer/Tokenizers/", - "CodeSniffer/DocGenerators/", - "CodeSniffer/Standards/AbstractPatternSniff.php", - "CodeSniffer/Standards/AbstractScopeSniff.php", - "CodeSniffer/Standards/AbstractVariableSniff.php", - "CodeSniffer/Standards/IncorrectPatternException.php", - "CodeSniffer/Standards/Generic/Sniffs/", - "CodeSniffer/Standards/MySource/Sniffs/", - "CodeSniffer/Standards/PEAR/Sniffs/", - "CodeSniffer/Standards/PSR1/Sniffs/", - "CodeSniffer/Standards/PSR2/Sniffs/", - "CodeSniffer/Standards/Squiz/Sniffs/", - "CodeSniffer/Standards/Zend/Sniffs/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2853,464 +2297,447 @@ ], "authors": [ { - "name": "Greg Sherwood", - "role": "lead" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", "keywords": [ - "phpcs", - "standards" + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2018-11-07T22:31:41+00:00" + "time": "2024-03-02T06:35:11+00:00" }, { - "name": "symfony/console", - "version": "v5.4.21", + "name": "sebastian/lines-of-code", + "version": "1.0.4", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "c77433ddc6cdc689caf48065d9ea22ca0853fbd9" + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c77433ddc6cdc689caf48065d9ea22ca0853fbd9", - "reference": "c77433ddc6cdc689caf48065d9ea22ca0853fbd9", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" - }, - "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0" + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" }, "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command line", - "console", - "terminal" + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2023-02-25T16:59:41+00:00" + "time": "2023-12-22T06:20:34+00:00" }, { - "name": "symfony/event-dispatcher", - "version": "v5.4.21", + "name": "sebastian/object-enumerator", + "version": "4.0.4", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "f0ae1383a8285dfc6752b8d8602790953118ff5a" + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f0ae1383a8285dfc6752b8d8602790953118ff5a", - "reference": "f0ae1383a8285dfc6752b8d8602790953118ff5a", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/event-dispatcher-contracts": "^2|^3", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "symfony/dependency-injection": "<4.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "homepage": "https://symfony.com", - "time": "2023-02-14T08:03:56+00:00" + "time": "2020-10-26T13:12:34+00:00" }, { - "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.2", + "name": "sebastian/object-reflector", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1" + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f98b54df6ad059855739db6fcbc2d36995283fe1", - "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/event-dispatcher": "^1" + "php": ">=7.3" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "dev-master": "2.0-dev" } }, "autoload": { - "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "Generic abstractions related to dispatching event", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2020-10-26T13:14:26+00:00" }, { - "name": "symfony/filesystem", - "version": "v5.4.21", + "name": "sebastian/recursion-context", + "version": "4.0.5", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "e75960b1bbfd2b8c9e483e0d74811d555ca3de9f" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/e75960b1bbfd2b8c9e483e0d74811d555ca3de9f", - "reference": "e75960b1bbfd2b8c9e483e0d74811d555ca3de9f", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", - "symfony/polyfill-php80": "^1.16" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "time": "2023-02-14T08:03:56+00:00" + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:07:39+00:00" }, { - "name": "symfony/finder", - "version": "v5.4.21", + "name": "sebastian/resource-operations", + "version": "3.0.4", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/078e9a5e1871fcfe6a5ce421b539344c21afef19", - "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" + }, + "funding": [ { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "time": "2023-02-16T09:33:00+00:00" + "time": "2024-03-14T16:00:52+00:00" }, { - "name": "symfony/options-resolver", - "version": "v5.4.21", + "name": "sebastian/type", + "version": "2.3.4", "source": { "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9", - "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2023-02-14T08:03:56+00:00" + "time": "2021-06-15T12:49:02+00:00" }, { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", + "name": "sebastian/version", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" + "php": ">=7.3" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "dev-master": "3.0-dev" } }, "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2020-09-28T06:39:44+00:00" }, { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "name": "symfony/polyfill-ctype", + "version": "v1.30.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-ctype": "*" + }, "suggest": { - "ext-intl": "For best performance" + "ext-ctype": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3321,11 +2748,8 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3333,99 +2757,66 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", + "description": "Symfony polyfill for ctype functions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "intl", - "normalizer", + "ctype", "polyfill", - "portable", - "shim" + "portable" ], - "time": "2022-11-03T14:55:06+00:00" - }, - { - "name": "symfony/polyfill-php70", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644", - "shasum": "" - }, - "require": { - "php": ">=7.1" + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" }, - "type": "metapackage", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "url": "https://github.com/fabpot", + "type": "github" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { - "name": "symfony/polyfill-php72", - "version": "v1.27.0", + "name": "symfony/polyfill-mbstring", + "version": "v1.30.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3436,7 +2827,7 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -3453,28 +2844,46 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", "keywords": [ "compatibility", + "mbstring", "polyfill", "portable", "shim" ], - "time": "2022-11-03T14:55:06+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-19T12:30:46+00:00" }, { - "name": "symfony/polyfill-php73", - "version": "v1.27.0", + "name": "symfony/polyfill-php80", + "version": "v1.30.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", "shasum": "" }, "require": { @@ -3482,9 +2891,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3495,7 +2901,7 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" + "Symfony\\Polyfill\\Php80\\": "" }, "classmap": [ "Resources/stubs" @@ -3506,6 +2912,10 @@ "MIT" ], "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -3515,7 +2925,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -3523,206 +2933,194 @@ "portable", "shim" ], - "time": "2022-11-03T14:55:06+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" }, { - "name": "symfony/process", - "version": "v5.4.21", + "name": "theseer/tokenizer", + "version": "1.2.3", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "d4ce417ebcb0b7d090b4c178ed6d3accc518e8bd" + "url": "https://github.com/theseer/tokenizer.git", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/d4ce417ebcb0b7d090b4c178ed6d3accc518e8bd", - "reference": "d4ce417ebcb0b7d090b4c178ed6d3accc518e8bd", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + }, + "funding": [ { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "url": "https://github.com/theseer", + "type": "github" } ], - "description": "Executes commands in sub-processes", - "homepage": "https://symfony.com", - "time": "2023-02-21T19:46:44+00:00" + "time": "2024-03-03T12:36:25+00:00" }, { - "name": "symfony/service-contracts", - "version": "v2.5.2", + "name": "vlucas/phpdotenv", + "version": "v5.6.1", "source": { "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/a59a13791077fe3d44f90e7133eb68e7d22eaff2", + "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" + "ext-pcre": "*", + "graham-campbell/result-type": "^1.1.3", + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9.3", + "symfony/polyfill-ctype": "^1.24", + "symfony/polyfill-mbstring": "^1.24", + "symfony/polyfill-php80": "^1.24" }, - "conflict": { - "ext-psr": "<1.1|>=2" + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-filter": "*", + "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" }, "suggest": { - "symfony/service-implementation": "" + "ext-filter": "Required to use the boolean validator." }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.5-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "branch-alias": { + "dev-master": "5.6-dev" } }, "autoload": { "psr-4": { - "Symfony\\Contracts\\Service\\": "" + "Dotenv\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Vance Lucas", + "email": "vance@vancelucas.com", + "homepage": "https://github.com/vlucas" } ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", + "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "time": "2022-05-30T19:17:29+00:00" - }, - { - "name": "symfony/stopwatch", - "version": "v5.4.21", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "f83692cd869a6f2391691d40a01e8acb89e76fee" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f83692cd869a6f2391691d40a01e8acb89e76fee", - "reference": "f83692cd869a6f2391691d40a01e8acb89e76fee", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/service-contracts": "^1|^2|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" + "dotenv", + "env", + "environment" ], - "authors": [ + "support": { + "issues": "https://github.com/vlucas/phpdotenv/issues", + "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.1" + }, + "funding": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "url": "https://github.com/GrahamCampbell", + "type": "github" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", + "type": "tidelift" } ], - "description": "Provides a way to profile code", - "homepage": "https://symfony.com", - "time": "2023-02-14T08:03:56+00:00" + "time": "2024-07-20T21:52:34+00:00" }, { - "name": "symfony/string", - "version": "v5.4.21", + "name": "webmozart/assert", + "version": "1.11.0", "source": { "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "edac10d167b78b1d90f46a80320d632de0bd9f2f" + "url": "https://github.com/webmozarts/assert.git", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/edac10d167b78b1d90f46a80320d632de0bd9f2f", - "reference": "edac10d167b78b1d90f46a80320d632de0bd9f2f", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" + "ext-ctype": "*", + "php": "^7.2 || ^8.0" }, "conflict": { - "symfony/translation-contracts": ">=3.0" + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" }, "require-dev": { - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0|^6.0" + "phpunit/phpunit": "^8.5.13" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, "autoload": { - "files": [ - "Resources/functions.php" - ], "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Webmozart\\Assert\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3730,65 +3128,21 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", + "description": "Assertions to validate method input/output with nice error messages.", "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "time": "2023-02-22T08:00:55+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } + "assert", + "check", + "validate" ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2021-07-28T10:34:58+00:00" + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.11.0" + }, + "time": "2022-06-03T18:03:27+00:00" } ], "aliases": [], @@ -3797,11 +3151,13 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.1", + "php": ">=8.1", "ext-curl": "*", "ext-json": "*", - "ext-mbstring": "*" + "ext-mbstring": "*", + "ext-zlib": "*", + "ext-openssl": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/config.json b/config.json index 6b9a6000..20883265 100644 --- a/config.json +++ b/config.json @@ -8,5 +8,5 @@ "gitUserId": "fingerprintjs", "gitRepoId": "fingerprint-pro-server-api-php-sdk", "description": "Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro.", - "artifactVersion": "4.1.0" + "artifactVersion": "dev-5.0.0-1" } diff --git a/contributing.md b/contributing.md index 00355047..826d7ea3 100644 --- a/contributing.md +++ b/contributing.md @@ -5,8 +5,8 @@ Most files in the project are autogenerated by [swagger-codegen](https://swagger.io/tools/swagger-codegen/) for php. - [template](./template) - folder contains redefined templates of `swagger-codegen`. Original templates you can find in [swagger-codegen repo](https://github.com/swagger-api/swagger-codegen/tree/751e59df060b1c3ecf54921e104f2086dfa9f820/modules/swagger-codegen/src/main/resources/php). -- [docs](./docs) - generated documentation for models and [API Client](./docs/Api/FingerprintApi.md). -- [src](./src) - API Client code is generated automatically. +- [docs](./docs) - generated documentation for models and [API Client](docs/Api/FingerprintApi.md). +- [src](./src) - API Client code and generated models. ## Code generation @@ -17,6 +17,25 @@ You can just run `sh ./scripts/generate.sh` script and it will do all the work. To download fresh OpenAPI schema run `sh ./scripts/sync.sh` +## Creating Coverage Report (Markdown and HTML) + +To generate a code coverage report, follow these steps: + +1. Run PHPUnit to generate a coverage report: + ```shell + docker-compose run phpunit + ``` + + - The Clover XML report will be saved in `cov/xml/clover.xml`. + - The HTML report will be saved in the `cov/html` directory. + +2. To convert the Clover XML report into a markdown report, run the generate_coverage_report.php script: + ```shell + docker-compose run php php generate_coverage_report.php + ``` + +The markdown report will be saved in the `cov/markdown/coverage_report.md` file. You can open this file to review the coverage details. + ### Testing the local source code of the SDK Use the `run_checks.php` file to make API requests using the local version of the SDK. @@ -27,10 +46,26 @@ Use the `run_checks.php` file to make API requests using the local version of th 4. Create an `.env` file in the root folder according to [.env.example](.env.example) with your API key and test variables. 5. Finally, run `php run_checks.php`. +### Testing the local source code of the SDK (Docker) + +As an alternative to running the SDK tests locally, you can use Docker: + +1. Ensure that Docker is installed and running on your machine. +2. Create an `.env` file in the root folder according to [.env.example](.env.example) with your API key and test variables. +3. Run the following command to install dependencies using Docker: + ```shell + docker-compose run composer install + ``` +4. Run the following command to execute the SDK tests using Docker: + ```shell + docker-compose run php php run_checks.php + ``` + ### Configuration -Project configuration is described in `config.json` file. To read about available parameters run the command below: +Project configuration is described in the `config.json` file. To read about available parameters run the command below: ```shell java -jar ./bin/swagger-codegen-cli.jar config-help -l php ``` + diff --git a/cov/.gitkeep b/cov/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/cov/html/.gitkeep b/cov/html/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/cov/json/.gitkeep b/cov/json/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/cov/markdown/.gitkeep b/cov/markdown/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/cov/xml/.gitkeep b/cov/xml/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docker-compose.yml b/docker-compose.yml index bef1d6f3..bfbd8270 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: composer: - image: composer:1.9.3 + image: composer:2.7 environment: - COMPOSER_CACHE_DIR=/app/.cache/composer volumes: @@ -14,10 +14,16 @@ services: env_file: - .env phpunit: - image: php:8.1-cli + build: './docker/php' volumes: - ./:/app working_dir: /app entrypoint: vendor/bin/phpunit env_file: - - .env \ No newline at end of file + - .env + lint: + image: ghcr.io/php-cs-fixer/php-cs-fixer:${FIXER_VERSION:-3-php8.3} + volumes: + - .:/code + - ./.php-cs-fixer.php:/code/.php-cs-fixer.php + command: fix --config=/code/.php-cs-fixer.php /code/src \ No newline at end of file diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile new file mode 100644 index 00000000..4059ee37 --- /dev/null +++ b/docker/php/Dockerfile @@ -0,0 +1,11 @@ +FROM php:8.2-cli + +# Install dependencies and Xdebug +RUN apt-get update && apt-get install -y \ + libicu-dev \ + && docker-php-ext-install intl \ + && pecl install xdebug \ + && docker-php-ext-enable xdebug + +# Configure Xdebug +COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini \ No newline at end of file diff --git a/docker/php/xdebug.ini b/docker/php/xdebug.ini new file mode 100644 index 00000000..1b32702a --- /dev/null +++ b/docker/php/xdebug.ini @@ -0,0 +1,6 @@ +zend_extension=xdebug.so +xdebug.mode=coverage +xdebug.start_with_request=yes +xdebug.discover_client_host=true +xdebug.client_host=host.docker.internal +xdebug.client_port=9003 \ No newline at end of file diff --git a/docs/Api/FingerprintApi.md b/docs/Api/FingerprintApi.md index e9b81abc..7f367e17 100644 --- a/docs/Api/FingerprintApi.md +++ b/docs/Api/FingerprintApi.md @@ -4,15 +4,78 @@ All URIs are relative to *https://api.fpjs.io* Method | HTTP request | Description ------------- | ------------- | ------------- -[**getEvent**](FingerprintApi.md#getEvent) | **GET** /events/{request_id} | Get event by requestId -[**getVisits**](FingerprintApi.md#getVisits) | **GET** /visitors/{visitor_id} | Get visits by visitorId +[**deleteVisitorData**](FingerprintApi.md#deleteVisitorData) | **DELETE** /visitors/{visitor_id} | Delete data by visitor ID +[**getEvent**](FingerprintApi.md#getEvent) | **GET** /events/{request_id} | Get event by request ID +[**getVisits**](FingerprintApi.md#getVisits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID +[**updateEvent**](FingerprintApi.md#updateEvent) | **PUT** /events/{request_id} | Update an event with a given request ID + +# **deleteVisitorData** +> deleteVisitorData($visitor_id) + +Delete data by visitor ID + +Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. All delete requests are queued: * Recent data (10 days or newer) belonging to the specified visitor will be deleted within 24 hours. * Data from older (11 days or more) identification events will be deleted after 90 days. If you are interested in using this API, please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. + +### Example +```php +deleteVisitorData($visitor_id); +} catch (Exception $e) { + echo 'Exception when calling FingerprintApi->deleteVisitorData: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **visitor_id** | **string**| The [visitor ID](https://dev.fingerprint.com/docs/js-agent#visitorid) you want to delete. | + +### Return type + +Array: +0. null, +1. \Psr\Http\Message\ResponseInterface + + +### Authorization + +[ApiKeyHeader](../../README.md#ApiKeyHeader), [ApiKeyQuery](../../README.md#ApiKeyQuery) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getEvent** -> \Fingerprint\ServerAPI\Model\EventResponse getEvent($request_id) +> [ \Fingerprint\ServerAPI\Model\EventResponse, \Psr\Http\Message\ResponseInterface ] getEvent($request_id) -Get event by requestId +Get event by request ID -This endpoint allows you to get a detailed analysis of an individual request. **Only for Enterprise customers:** Please note that the response includes mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`. +Get a detailed analysis of an individual identification event, including Smart Signals. Please note that the response includes mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`. ### Example ```php @@ -31,14 +94,14 @@ use GuzzleHttp\Client; $config = Configuration::getDefaultConfiguration(FPJS_API_SECRET, Configuration::REGION_EUROPE); $client = new FingerprintApi( new Client(), - $config +$config ); -$request_id = "request_id_example"; // string | The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. +$request_id = "request_id_example"; // string | The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each identification request. try { - $result = $client->getEvent($request_id); - echo "
" . $response->__toString() . "
"; + list($model, $httpResponse) = $client->getEvent($request_id); + echo "
" . $httpResponse->getBody()->getContents() . "
"; } catch (Exception $e) { echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL; } @@ -49,11 +112,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **request_id** | **string**| The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. | + **request_id** | **string**| The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each identification request. | ### Return type -[**\Fingerprint\ServerAPI\Model\EventResponse**](../Model/EventResponse.md) +Array: +0. [**\Fingerprint\ServerAPI\Model\EventResponse**](../Model/EventResponse.md) | null, +1. \Psr\Http\Message\ResponseInterface + ### Authorization @@ -67,11 +133,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **getVisits** -> \Fingerprint\ServerAPI\Model\Response getVisits($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before) +> [ \Fingerprint\ServerAPI\Model\Response, \Psr\Http\Message\ResponseInterface ] getVisits($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before) -Get visits by visitorId +Get visits by visitor ID -This endpoint allows you to get a history of visits for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. #### Headers * `Retry-After` — Present in case of `429 Too many requests`. Indicates how long you should wait before making a follow-up request. The value is non-negative decimal integer indicating the seconds to delay after the response is received. +Get a history of visits (identification events) for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. #### Headers * `Retry-After` — Present in case of `429 Too many requests`. Indicates how long you should wait before making a follow-up request. The value is non-negative decimal integer indicating the seconds to delay after the response is received. ### Example ```php @@ -90,10 +156,10 @@ use GuzzleHttp\Client; $config = Configuration::getDefaultConfiguration(FPJS_API_SECRET, Configuration::REGION_EUROPE); $client = new FingerprintApi( new Client(), - $config +$config ); -$visitor_id = "visitor_id_example"; // string | Unique identifier of the visitor issued by Fingerprint Pro. +$visitor_id = "visitor_id_example"; // string | Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. $request_id = "request_id_example"; // string | Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. $linked_id = "linked_id_example"; // string | Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. $limit = 56; // int | Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. @@ -101,8 +167,8 @@ $pagination_key = "pagination_key_example"; // string | Use `paginationKey` to g $before = 789; // int | ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. try { - $result = $client->getVisits($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before); - echo "
" . $response->__toString() . "
"; + list($model, $httpResponse) = $client->getVisits($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before); + echo "
" . $httpResponse->getBody()->getContents() . "
"; } catch (Exception $e) { echo 'Exception when calling FingerprintApi->getVisits: ', $e->getMessage(), PHP_EOL; } @@ -113,7 +179,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **visitor_id** | **string**| Unique identifier of the visitor issued by Fingerprint Pro. | + **visitor_id** | **string**| Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. | **request_id** | **string**| Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. | [optional] **linked_id** | **string**| Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. | [optional] **limit** | **int**| Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. | [optional] @@ -122,7 +188,10 @@ Name | Type | Description | Notes ### Return type -[**\Fingerprint\ServerAPI\Model\Response**](../Model/Response.md) +Array: +0. [**\Fingerprint\ServerAPI\Model\Response**](../Model/Response.md) | null, +1. \Psr\Http\Message\ResponseInterface + ### Authorization @@ -135,3 +204,66 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +# **updateEvent** +> updateEvent($body, $request_id) + +Update an event with a given request ID + +Change information in existing events specified by `requestId` or *flag suspicious events*. When an event is created, it is assigned `linkedId` and `tag` submitted through the JS agent parameters. This information might not be available on the client so the Server API allows for updating the attributes after the fact. **Warning** It's not possible to update events older than 10 days. + +### Example +```php +updateEvent($body, $request_id); +} catch (Exception $e) { + echo 'Exception when calling FingerprintApi->updateEvent: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Fingerprint\ServerAPI\Model\EventUpdateRequest**](../Model/EventUpdateRequest.md)| | + **request_id** | **string**| The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). | + +### Return type + +Array: +0. null, +1. \Psr\Http\Message\ResponseInterface + + +### Authorization + +[ApiKeyHeader](../../README.md#ApiKeyHeader), [ApiKeyQuery](../../README.md#ApiKeyQuery) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Model/ErrorEvent403ResponseError.md b/docs/Model/Common403ErrorResponse.md similarity index 50% rename from docs/Model/ErrorEvent403ResponseError.md rename to docs/Model/Common403ErrorResponse.md index 5345b43e..e3addf80 100644 --- a/docs/Model/ErrorEvent403ResponseError.md +++ b/docs/Model/Common403ErrorResponse.md @@ -1,9 +1,9 @@ -# ErrorEvent403ResponseError +# Common403ErrorResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **string** | Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - subscription not found for specified secret key * `SubscriptionNotActive` - subscription is not active * `WrongRegion` - server and subscription region differ | +**code** | **string** | Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - No Fingerprint application found for specified secret key * `SubscriptionNotActive` - Fingerprint application is not active * `WrongRegion` - server and application region differ * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application | **message** | **string** | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Confidence.md b/docs/Model/Confidence.md index 4dac7913..43d3b8ba 100644 --- a/docs/Model/Confidence.md +++ b/docs/Model/Confidence.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **score** | **float** | The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. | +**revision** | **string** | The revision name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeveloperToolsResult.md b/docs/Model/DeveloperToolsResult.md new file mode 100644 index 00000000..18009671 --- /dev/null +++ b/docs/Model/DeveloperToolsResult.md @@ -0,0 +1,9 @@ +# DeveloperToolsResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | **bool** | `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/ErrorEvent403Response.md b/docs/Model/ErrorCommon403Response.md similarity index 65% rename from docs/Model/ErrorEvent403Response.md rename to docs/Model/ErrorCommon403Response.md index b7ec39ad..77357404 100644 --- a/docs/Model/ErrorEvent403Response.md +++ b/docs/Model/ErrorCommon403Response.md @@ -1,9 +1,9 @@ -# ErrorEvent403Response +# ErrorCommon403Response ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**error** | [**\Fingerprint\ServerAPI\Model\ErrorEvent403ResponseError**](ErrorEvent403ResponseError.md) | | [optional] +**error** | [**\Fingerprint\ServerAPI\Model\Common403ErrorResponse**](Common403ErrorResponse.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorCommon429Response.md b/docs/Model/ErrorCommon429Response.md new file mode 100644 index 00000000..dd294594 --- /dev/null +++ b/docs/Model/ErrorCommon429Response.md @@ -0,0 +1,9 @@ +# ErrorCommon429Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**\Fingerprint\ServerAPI\Model\ErrorCommon429ResponseError**](ErrorCommon429ResponseError.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/ErrorCommon429ResponseError.md b/docs/Model/ErrorCommon429ResponseError.md new file mode 100644 index 00000000..d08585c8 --- /dev/null +++ b/docs/Model/ErrorCommon429ResponseError.md @@ -0,0 +1,10 @@ +# ErrorCommon429ResponseError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | Error code: * `TooManyRequests` - The request is throttled. | +**message** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/ErrorEvent404ResponseError.md b/docs/Model/ErrorEvent404ResponseError.md index 63aa21af..34bb77e6 100644 --- a/docs/Model/ErrorEvent404ResponseError.md +++ b/docs/Model/ErrorEvent404ResponseError.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **string** | Error code: * `RequestNotFound` - request not found for specified id | +**code** | **string** | Error code: * `RequestNotFound` - The specified request ID was not found. It never existed, expired, or it has been deleted. | **message** | **string** | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ErrorUpdateEvent400Response.md b/docs/Model/ErrorUpdateEvent400Response.md new file mode 100644 index 00000000..475e5550 --- /dev/null +++ b/docs/Model/ErrorUpdateEvent400Response.md @@ -0,0 +1,9 @@ +# ErrorUpdateEvent400Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**\Fingerprint\ServerAPI\Model\ErrorUpdateEvent400ResponseError**](ErrorUpdateEvent400ResponseError.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/ErrorUpdateEvent400ResponseError.md b/docs/Model/ErrorUpdateEvent400ResponseError.md new file mode 100644 index 00000000..ac9c40be --- /dev/null +++ b/docs/Model/ErrorUpdateEvent400ResponseError.md @@ -0,0 +1,10 @@ +# ErrorUpdateEvent400ResponseError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | Error code: * `RequestCannotBeParsed` - the JSON content of the request contains some errors that prevented us from parsing it (wrong type/surpassed limits) * `Failed` - the event is more than 10 days old and cannot be updated | +**message** | **string** | Details about the underlying issue with the input payload | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/ErrorUpdateEvent409Response.md b/docs/Model/ErrorUpdateEvent409Response.md new file mode 100644 index 00000000..7d42bd68 --- /dev/null +++ b/docs/Model/ErrorUpdateEvent409Response.md @@ -0,0 +1,9 @@ +# ErrorUpdateEvent409Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**\Fingerprint\ServerAPI\Model\ErrorUpdateEvent409ResponseError**](ErrorUpdateEvent409ResponseError.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/ErrorUpdateEvent409ResponseError.md b/docs/Model/ErrorUpdateEvent409ResponseError.md new file mode 100644 index 00000000..e5398089 --- /dev/null +++ b/docs/Model/ErrorUpdateEvent409ResponseError.md @@ -0,0 +1,10 @@ +# ErrorUpdateEvent409ResponseError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | Error code: * `StateNotReady` - The event specified with request id is not ready for updates yet. Try again. This error happens in rare cases when update API is called immediately after receiving the request id on the client. In case you need to send information right away, we recommend using the JS agent API instead. | +**message** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/ErrorVisitor400Response.md b/docs/Model/ErrorVisitor400Response.md new file mode 100644 index 00000000..bd6a48d9 --- /dev/null +++ b/docs/Model/ErrorVisitor400Response.md @@ -0,0 +1,9 @@ +# ErrorVisitor400Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**\Fingerprint\ServerAPI\Model\ErrorVisitor400ResponseError**](ErrorVisitor400ResponseError.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/ErrorVisitor400ResponseError.md b/docs/Model/ErrorVisitor400ResponseError.md new file mode 100644 index 00000000..656349f8 --- /dev/null +++ b/docs/Model/ErrorVisitor400ResponseError.md @@ -0,0 +1,10 @@ +# ErrorVisitor400ResponseError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | Error code: * `RequestCannotBeParsed` - The visitor ID parameter is missing or in the wrong format. | +**message** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/ErrorVisitor404Response.md b/docs/Model/ErrorVisitor404Response.md new file mode 100644 index 00000000..0cf67550 --- /dev/null +++ b/docs/Model/ErrorVisitor404Response.md @@ -0,0 +1,9 @@ +# ErrorVisitor404Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**\Fingerprint\ServerAPI\Model\ErrorVisitor404ResponseError**](ErrorVisitor404ResponseError.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/ErrorVisitor404ResponseError.md b/docs/Model/ErrorVisitor404ResponseError.md new file mode 100644 index 00000000..95638b31 --- /dev/null +++ b/docs/Model/ErrorVisitor404ResponseError.md @@ -0,0 +1,10 @@ +# ErrorVisitor404ResponseError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | Error code: * `VisitorNotFound` - The specified visitor ID was not found. It never existed or it may have already been deleted. | +**message** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/EventUpdateRequest.md b/docs/Model/EventUpdateRequest.md new file mode 100644 index 00000000..fd2bc2ec --- /dev/null +++ b/docs/Model/EventUpdateRequest.md @@ -0,0 +1,11 @@ +# EventUpdateRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**linked_id** | **string** | LinkedID value to assign to the existing event | [optional] +**tag** | **object** | Full `tag` value to be set to the existing event. Replaces any existing `tag` payload completely. | [optional] +**suspect** | **bool** | Suspect flag indicating observed suspicious or fraudulent event | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/FactoryResetResult.md b/docs/Model/FactoryResetResult.md index a34b21a3..90f74510 100644 --- a/docs/Model/FactoryResetResult.md +++ b/docs/Model/FactoryResetResult.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**time** | [**\DateTime**](\DateTime.md) | Time in UTC when the most recent factory reset of the Android or iOS device was done. If there is no sign of factory reset or the client is not a mobile device, the field will contain the epoch time (1 January 1970) in UTC. | -**timestamp** | **int** | Same value as it's in the `time` field but represented in timestamp format. | +**time** | [**\DateTime**](\DateTime.md) | Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. | +**timestamp** | **int** | This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductsResponse.md b/docs/Model/ProductsResponse.md index d7e1101b..8ac08ff8 100644 --- a/docs/Model/ProductsResponse.md +++ b/docs/Model/ProductsResponse.md @@ -26,6 +26,9 @@ Name | Type | Description | Notes **location_spoofing** | [**\Fingerprint\ServerAPI\Model\SignalResponseLocationSpoofing**](SignalResponseLocationSpoofing.md) | | [optional] **suspect_score** | [**\Fingerprint\ServerAPI\Model\SignalResponseSuspectScore**](SignalResponseSuspectScore.md) | | [optional] **raw_device_attributes** | [**\Fingerprint\ServerAPI\Model\SignalResponseRawDeviceAttributes**](SignalResponseRawDeviceAttributes.md) | | [optional] +**remote_control** | [**\Fingerprint\ServerAPI\Model\SignalResponseRemoteControl**](SignalResponseRemoteControl.md) | | [optional] +**velocity** | [**\Fingerprint\ServerAPI\Model\SignalResponseVelocity**](SignalResponseVelocity.md) | | [optional] +**developer_tools** | [**\Fingerprint\ServerAPI\Model\SignalResponseDeveloperTools**](SignalResponseDeveloperTools.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RemoteControlResult.md b/docs/Model/RemoteControlResult.md new file mode 100644 index 00000000..537bffce --- /dev/null +++ b/docs/Model/RemoteControlResult.md @@ -0,0 +1,9 @@ +# RemoteControlResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | **bool** | `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/SignalResponseDeveloperTools.md b/docs/Model/SignalResponseDeveloperTools.md new file mode 100644 index 00000000..c293e285 --- /dev/null +++ b/docs/Model/SignalResponseDeveloperTools.md @@ -0,0 +1,10 @@ +# SignalResponseDeveloperTools + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fingerprint\ServerAPI\Model\DeveloperToolsResult**](DeveloperToolsResult.md) | | [optional] +**error** | [**\Fingerprint\ServerAPI\Model\ProductError**](ProductError.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/SignalResponseIncognito.md b/docs/Model/SignalResponseIncognito.md index 5df868ed..53e226a2 100644 --- a/docs/Model/SignalResponseIncognito.md +++ b/docs/Model/SignalResponseIncognito.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**\Fingerprint\ServerAPI\Model\IncognitoResult**](IncognitoResult.md) | | [optional] -**error** | [**\Fingerprint\ServerAPI\Model\ProductError**](ProductError.md) | | [optional] +**error** | [**\Fingerprint\ServerAPI\Model\IdentificationError**](IdentificationError.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SignalResponseRawDeviceAttributes.md b/docs/Model/SignalResponseRawDeviceAttributes.md index c12d8772..479188d3 100644 --- a/docs/Model/SignalResponseRawDeviceAttributes.md +++ b/docs/Model/SignalResponseRawDeviceAttributes.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**\Fingerprint\ServerAPI\Model\RawDeviceAttributesResult**](RawDeviceAttributesResult.md) | | [optional] -**error** | [**\Fingerprint\ServerAPI\Model\ProductError**](ProductError.md) | | [optional] +**error** | [**\Fingerprint\ServerAPI\Model\IdentificationError**](IdentificationError.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SignalResponseRemoteControl.md b/docs/Model/SignalResponseRemoteControl.md new file mode 100644 index 00000000..c26787ac --- /dev/null +++ b/docs/Model/SignalResponseRemoteControl.md @@ -0,0 +1,10 @@ +# SignalResponseRemoteControl + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fingerprint\ServerAPI\Model\RemoteControlResult**](RemoteControlResult.md) | | [optional] +**error** | [**\Fingerprint\ServerAPI\Model\ProductError**](ProductError.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/SignalResponseTampering.md b/docs/Model/SignalResponseTampering.md index 380db57c..c9fdb5ae 100644 --- a/docs/Model/SignalResponseTampering.md +++ b/docs/Model/SignalResponseTampering.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**\Fingerprint\ServerAPI\Model\TamperingResult**](TamperingResult.md) | | [optional] -**error** | [**\Fingerprint\ServerAPI\Model\ProductError**](ProductError.md) | | [optional] +**error** | [**\Fingerprint\ServerAPI\Model\IdentificationError**](IdentificationError.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SignalResponseVelocity.md b/docs/Model/SignalResponseVelocity.md new file mode 100644 index 00000000..d86f7986 --- /dev/null +++ b/docs/Model/SignalResponseVelocity.md @@ -0,0 +1,10 @@ +# SignalResponseVelocity + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fingerprint\ServerAPI\Model\VelocityResult**](VelocityResult.md) | | [optional] +**error** | [**\Fingerprint\ServerAPI\Model\ProductError**](ProductError.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/ManyRequestsResponse.md b/docs/Model/TooManyRequestsResponse.md similarity index 92% rename from docs/Model/ManyRequestsResponse.md rename to docs/Model/TooManyRequestsResponse.md index 83cceb45..ad069ea0 100644 --- a/docs/Model/ManyRequestsResponse.md +++ b/docs/Model/TooManyRequestsResponse.md @@ -1,4 +1,4 @@ -# ManyRequestsResponse +# TooManyRequestsResponse ## Properties Name | Type | Description | Notes diff --git a/docs/Model/VelocityIntervalResult.md b/docs/Model/VelocityIntervalResult.md new file mode 100644 index 00000000..fc14a4ec --- /dev/null +++ b/docs/Model/VelocityIntervalResult.md @@ -0,0 +1,13 @@ +# VelocityIntervalResult +Is absent if the velocity data could not be generated for the visitor ID. + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_5m** | **int** | | +**_1h** | **int** | | +**_24h** | **int** | The `24h` interval of `distinctIp`, `distinctLinkedId`, and `distinctCountry` will be omitted if the number of `events`` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/VelocityIntervals.md b/docs/Model/VelocityIntervals.md new file mode 100644 index 00000000..a68bbe0c --- /dev/null +++ b/docs/Model/VelocityIntervals.md @@ -0,0 +1,9 @@ +# VelocityIntervals + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**intervals** | [**\Fingerprint\ServerAPI\Model\VelocityIntervalResult**](VelocityIntervalResult.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/VelocityResult.md b/docs/Model/VelocityResult.md new file mode 100644 index 00000000..0b45b8a3 --- /dev/null +++ b/docs/Model/VelocityResult.md @@ -0,0 +1,14 @@ +# VelocityResult +Sums key data points for a specific `visitorId` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows: - Number of identification events attributed to the visitor ID - Number of distinct IP addresses associated to the visitor ID. - Number of distinct countries associated with the visitor ID. - Number of distinct `linkedId`s associated with the visitor ID. The `24h` interval of `distinctIp`, `distinctLinkedId`, and `distinctCountry` will be omitted if the number of `events` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**distinct_ip** | [**\Fingerprint\ServerAPI\Model\VelocityIntervals**](VelocityIntervals.md) | | +**distinct_linked_id** | [**\Fingerprint\ServerAPI\Model\VelocityIntervals**](VelocityIntervals.md) | | +**distinct_country** | [**\Fingerprint\ServerAPI\Model\VelocityIntervals**](VelocityIntervals.md) | | +**events** | [**\Fingerprint\ServerAPI\Model\VelocityIntervals**](VelocityIntervals.md) | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/Visit.md b/docs/Model/Visit.md index 3c81e230..a2fe21c9 100644 --- a/docs/Model/Visit.md +++ b/docs/Model/Visit.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **timestamp** | **int** | Timestamp of the event with millisecond precision in Unix time. | **time** | [**\DateTime**](\DateTime.md) | Time expressed according to ISO 8601 in UTC format. | **url** | **string** | Page URL from which the identification request was sent. | -**tag** | **map[string,object]** | A customer-provided value or an object that was sent with identification request. | +**tag** | **map[string,object]** | A customer-provided value or an object that was sent with identification request. | [optional] **linked_id** | **string** | A customer-provided id that was sent with identification request. | [optional] **confidence** | [**\Fingerprint\ServerAPI\Model\Confidence**](Confidence.md) | | [optional] **visitor_found** | **bool** | Attribute represents if a visitor had been identified before. | diff --git a/docs/Model/VpnResultMethods.md b/docs/Model/VpnResultMethods.md index d70e5965..7762605c 100644 --- a/docs/Model/VpnResultMethods.md +++ b/docs/Model/VpnResultMethods.md @@ -3,9 +3,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**timezone_mismatch** | **bool** | User's browser timezone doesn't match the timezone from which the request was originally made. | +**timezone_mismatch** | **bool** | The browser timezone doesn't match the timezone inferred from the request IP address. | **public_vpn** | **bool** | Request IP address is owned and used by a public VPN service provider. | **auxiliary_mobile** | **bool** | This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. | +**os_mismatch** | **bool** | The browser runs on a different operating system than the operating system inferred from the request network signature. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WebhookVisit.md b/docs/Model/WebhookVisit.md index 00652490..83351586 100644 --- a/docs/Model/WebhookVisit.md +++ b/docs/Model/WebhookVisit.md @@ -26,6 +26,9 @@ Name | Type | Description | Notes **high_activity** | [**\Fingerprint\ServerAPI\Model\HighActivityResult**](HighActivityResult.md) | | [optional] **location_spoofing** | [**\Fingerprint\ServerAPI\Model\LocationSpoofingResult**](LocationSpoofingResult.md) | | [optional] **suspect_score** | [**\Fingerprint\ServerAPI\Model\SuspectScoreResult**](SuspectScoreResult.md) | | [optional] +**remote_control** | [**\Fingerprint\ServerAPI\Model\RemoteControlResult**](RemoteControlResult.md) | | [optional] +**velocity** | [**\Fingerprint\ServerAPI\Model\VelocityResult**](VelocityResult.md) | | [optional] +**developer_tools** | [**\Fingerprint\ServerAPI\Model\DeveloperToolsResult**](DeveloperToolsResult.md) | | [optional] **request_id** | **string** | Unique identifier of the user's identification request. | **browser_details** | [**\Fingerprint\ServerAPI\Model\BrowserDetails**](BrowserDetails.md) | | **ip** | **string** | | @@ -33,7 +36,7 @@ Name | Type | Description | Notes **timestamp** | **int** | Timestamp of the event with millisecond precision in Unix time. | **time** | [**\DateTime**](\DateTime.md) | Time expressed according to ISO 8601 in UTC format. | **url** | **string** | Page URL from which the identification request was sent. | -**tag** | **map[string,object]** | A customer-provided value or an object that was sent with identification request. | +**tag** | **map[string,object]** | A customer-provided value or an object that was sent with identification request. | [optional] **linked_id** | **string** | A customer-provided id that was sent with identification request. | [optional] **confidence** | [**\Fingerprint\ServerAPI\Model\Confidence**](Confidence.md) | | [optional] **visitor_found** | **bool** | Attribute represents if a visitor had been identified before. | diff --git a/docs/Webhook.md b/docs/Webhook.md new file mode 100644 index 00000000..004780dd --- /dev/null +++ b/docs/Webhook.md @@ -0,0 +1,16 @@ +# Webhook + +## **IsValidWebhookSignature** + +> Fingerprint\ServerAPI\Webhook\WebhookVerifier::IsValidWebhookSignature(string $header, string $data, string $secret): bool + +Verifies the HMAC signature extracted from the "fpjs-event-signature" header of the incoming request. This is a part of the webhook signing process, which is available only for enterprise customers. +If you wish to enable it, please [contact our support](https://fingerprint.com/support). + +### Required Parameters + +| Name | Type | Description | Notes | +|------------|------------|-----------------------------------------------------------|-------| +| **header** | **string** | Value of the `fpjs-event-signature` header. | | +| **data** | **string** | Body of the request from which above header was extracted. | | +| **secret** | **string** | Your generated secret used to sign the request. | | diff --git a/generate_coverage_report.php b/generate_coverage_report.php new file mode 100644 index 00000000..98ad057b --- /dev/null +++ b/generate_coverage_report.php @@ -0,0 +1,90 @@ + 0 ? ($statementsCovered / $statementsTotal) * 100 : 0; + +$functionsCovered = (int)$metrics["coveredmethods"]; +$functionsTotal = (int)$metrics["methods"]; +$functionsPct = $functionsTotal > 0 ? ($functionsCovered / $functionsTotal) * 100 : 0; + +// Function to return color based on percentage +function getCoverageStatus($percentage) { + if ($percentage >= 80) { + return ":green_circle:"; + } elseif ($percentage >= 50) { + return ":yellow_circle:"; + } else { + return ":red_circle:"; + } +} + +// Generate JSON report +$map = [ + "total" => [ + "statements" => ["pct" => number_format($statementsPct, 2)], + ] +]; +file_put_contents($outputPath . "index.json", json_encode($map)); + +// Generate Markdown report +$markdown = "# Code Coverage Report\n\n"; +$markdown .= "## Coverage Report\n\n"; +$markdown .= "| St. | Category | Percentage | Covered / Total |\n"; +$markdown .= "|-----|----------------|------------|-----------------|\n"; +$markdown .= sprintf( + "| %s | Statements | %.2f%% | %d / %d |\n", + getCoverageStatus($statementsPct), + $statementsPct, + $statementsCovered, + $statementsTotal +); +$markdown .= sprintf( + "| %s | Functions | %.2f%% | %d / %d |\n", + getCoverageStatus($functionsPct), + $functionsPct, + $functionsCovered, + $functionsTotal +); + +$markdown .= "\n
\n"; +$markdown .= "Files Coverage\n\n"; +$markdown .= "| St. | File | Methods | Statements | Total Coverage |\n"; +$markdown .= "|-----|------|---------|------------|----------------|\n"; + +foreach ($arr["project"]["file"] as $file) { + $filePath = 'src/' . explode('src/', $file["@attributes"]['name'])[1]; + $fileMetrics = $file["metrics"]["@attributes"]; + + $methodsPct = $fileMetrics["methods"] > 0 ? ($fileMetrics["coveredmethods"] / $fileMetrics["methods"]) * 100 : 0; + $statementsPct = $fileMetrics["statements"] > 0 ? ($fileMetrics["coveredstatements"] / $fileMetrics["statements"]) * 100 : 0; + + $fileElements = (int)$fileMetrics["elements"]; + $fileCoveredElements = (int)$fileMetrics["coveredelements"]; + $totalCoveragePct = $fileElements > 0 ? ($fileCoveredElements / $fileElements) * 100 : 0; + + $markdown .= sprintf( + "| %s | %s | %.2f%% | %.2f%% | %.2f%% |\n", + getCoverageStatus($totalCoveragePct), + $filePath, + $methodsPct, + $statementsPct, + $totalCoveragePct + ); +} + +$markdown .= "\n
\n"; + +file_put_contents($markdownPath . "coverage_report.md", $markdown); \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 61400802..5f9a36d1 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,20 +1,26 @@ + ./test - - - ./src/Api - ./src/Model - - - + + + ./src + + + + + + + + \ No newline at end of file diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index 792ce049..f6e6d701 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -36,14 +36,13 @@ paths: tags: - Fingerprint operationId: getEvent - summary: Get event by requestId + summary: Get event by request ID description: > - This endpoint allows you to get a detailed analysis of an individual - request. + Get a detailed analysis of an individual identification event, including + Smart Signals. - **Only for Enterprise customers:** Please note that the response - includes mobile signals (e.g. `rootApps`) even if the request originated - from a non-mobile platform. + Please note that the response includes mobile signals (e.g. `rootApps`) + even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. @@ -57,7 +56,7 @@ paths: description: >- The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of - each analysis request. + each identification request. required: true schema: type: string @@ -73,21 +72,80 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ErrorEvent403Response' + $ref: '#/components/schemas/ErrorCommon403Response' '404': description: Not found content: application/json: schema: $ref: '#/components/schemas/ErrorEvent404Response' + put: + tags: + - Fingerprint + operationId: updateEvent + summary: Update an event with a given request ID + description: > + Change information in existing events specified by `requestId` or *flag + suspicious events*. + + + When an event is created, it is assigned `linkedId` and `tag` submitted + through the JS agent parameters. This information might not be available + on the client so the Server API allows for updating the attributes after + the fact. + + + **Warning** It's not possible to update events older than 10 days. + parameters: + - name: request_id + in: path + description: >- + The unique event + [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventUpdateRequest' + responses: + '200': + description: OK + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorUpdateEvent400Response' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorCommon403Response' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorEvent404Response' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorUpdateEvent409Response' /visitors/{visitor_id}: get: tags: - Fingerprint operationId: getVisits - summary: Get visits by visitorId + summary: Get visits by visitor ID description: > - This endpoint allows you to get a history of visits for a specific + Get a history of visits (identification events) for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. @@ -102,7 +160,10 @@ paths: response is received. parameters: - name: visitor_id - description: Unique identifier of the visitor issued by Fingerprint Pro. + description: >- + Unique [visitor + identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) + issued by Fingerprint Pro. in: path required: true schema: @@ -210,8 +271,8 @@ paths: headers: Retry-After: description: >- - Indicates how long you should wait before attempting the next - request. + Indicates how many seconds you should wait before attempting the + next request. schema: type: integer format: int32 @@ -219,7 +280,70 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ManyRequestsResponse' + $ref: '#/components/schemas/TooManyRequestsResponse' + delete: + tags: + - Fingerprint + operationId: deleteVisitorData + summary: Delete data by visitor ID + description: > + Request deleting all data associated with the specified visitor ID. This + API is useful for compliance with privacy regulations. + + All delete requests are queued: + + + * Recent data (10 days or newer) belonging to the specified visitor will + be deleted within 24 hours. + + * Data from older (11 days or more) identification events will be + deleted after 90 days. + + + If you are interested in using this API, please [contact our support + team](https://fingerprint.com/support/) to enable it for you. Otherwise, + you will receive a 403. + parameters: + - name: visitor_id + in: path + description: >- + The [visitor + ID](https://dev.fingerprint.com/docs/js-agent#visitorid) you want to + delete. + required: true + schema: + type: string + responses: + '200': + description: OK. The visitor ID is scheduled for deletion. + '400': + description: >- + Bad request. The visitor ID parameter is missing or in the wrong + format. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorVisitor400Response' + '403': + description: Forbidden. Access to this API is denied. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorCommon403Response' + '404': + description: >- + Not found. The visitor ID cannot be found in this application's + data. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorVisitor404Response' + '429': + description: Too Many Requests. The request is throttled. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorCommon429Response' /webhook: trace: tags: @@ -346,6 +470,7 @@ paths: timezoneMismatch: false publicVPN: false auxiliaryMobile: false + osMismatch: false proxy: result: false tampering: @@ -388,6 +513,27 @@ paths: result: true suspectScore: result: 0 + remoteControl: + result: false + velocity: + distinctIp: + intervals: + 5m: 1 + 1h: 1 + 24h: 1 + distinctLinkedId: {} + distinctCountry: + intervals: + 5m: 1 + 1h: 2 + 24h: 2 + events: + intervals: + 5m: 1 + 1h: 5 + 24h: 5 + developerTools: + result: false responses: default: description: The server doesn't validate the answer. @@ -524,8 +670,8 @@ components: - time - timestamp - url - - tag - visitorFound + - tag lastTimestamp: description: > ⚠️ Deprecated paging attribute, please use `paginationKey` instead. @@ -547,28 +693,30 @@ components: description: >- Fields `lastTimestamp` and `paginationKey` added when `limit` or `before` parameter provided and there is more data to show - ErrorEvent403Response: + ErrorCommon403Response: type: object additionalProperties: false properties: error: type: object additionalProperties: false - title: ErrorEvent403ResponseError + title: Common403ErrorResponse properties: code: type: string description: | Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty - * `TokenNotFound` - subscription not found for specified secret key - * `SubscriptionNotActive` - subscription is not active - * `WrongRegion` - server and subscription region differ + * `TokenNotFound` - No Fingerprint application found for specified secret key + * `SubscriptionNotActive` - Fingerprint application is not active + * `WrongRegion` - server and application region differ + * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application enum: - TokenRequired - TokenNotFound - SubscriptionNotActive - WrongRegion + - FeatureNotEnabled example: TokenRequired message: type: string @@ -576,6 +724,27 @@ components: required: - code - message + ErrorCommon429Response: + type: object + additionalProperties: false + properties: + error: + type: object + additionalProperties: false + properties: + code: + type: string + description: | + Error code: * `TooManyRequests` - The request is throttled. + enum: + - TooManyRequests + example: TooManyRequests + message: + type: string + example: request throttled + required: + - code + - message ErrorEvent404Response: type: object additionalProperties: false @@ -589,7 +758,7 @@ components: type: string description: | Error code: - * `RequestNotFound` - request not found for specified id + * `RequestNotFound` - The specified request ID was not found. It never existed, expired, or it has been deleted. enum: - RequestNotFound example: RequestNotFound @@ -609,7 +778,7 @@ components: example: Forbidden (HTTP 403) required: - error - ManyRequestsResponse: + TooManyRequestsResponse: type: object additionalProperties: false properties: @@ -619,6 +788,51 @@ components: example: request throttled required: - error + ErrorVisitor404Response: + type: object + additionalProperties: false + properties: + error: + type: object + additionalProperties: false + title: ErrorVisitor404ResponseError + properties: + code: + type: string + description: > + Error code: * `VisitorNotFound` - The specified visitor ID was + not found. It never existed or it may have already been deleted. + enum: + - VisitorNotFound + example: VisitorNotFound + message: + type: string + example: visitor not found + required: + - code + - message + ErrorVisitor400Response: + type: object + additionalProperties: false + properties: + error: + type: object + additionalProperties: false + properties: + code: + type: string + description: > + Error code: * `RequestCannotBeParsed` - The visitor ID parameter + is missing or in the wrong format. + enum: + - RequestCannotBeParsed + example: RequestCannotBeParsed + message: + type: string + example: invalid visitor id + required: + - code + - message WebhookVisit: type: object properties: @@ -674,6 +888,12 @@ components: $ref: '#/components/schemas/LocationSpoofingResult' suspectScore: $ref: '#/components/schemas/SuspectScoreResult' + remoteControl: + $ref: '#/components/schemas/RemoteControlResult' + velocity: + $ref: '#/components/schemas/VelocityResult' + developerTools: + $ref: '#/components/schemas/DeveloperToolsResult' requestId: description: Unique identifier of the user's identification request. type: string @@ -778,7 +998,6 @@ components: - time - timestamp - url - - tag - visitorFound Visit: type: object @@ -889,7 +1108,6 @@ components: - time - timestamp - url - - tag - visitorFound title: Visit BrowserDetails: @@ -942,6 +1160,12 @@ components: format: float minimum: 0 maximum: 1 + revision: + description: >- + The revision name of the method used to calculate the Confidence + score. This field is only present for customers who opted in to an + alternative calculation method. + type: string required: - score title: Confidence @@ -1203,9 +1427,9 @@ components: - time - timestamp - url - - tag - visitorFound - visitorId + - tag error: $ref: '#/components/schemas/IdentificationError' botd: @@ -1234,7 +1458,7 @@ components: data: $ref: '#/components/schemas/IncognitoResult' error: - $ref: '#/components/schemas/ProductError' + $ref: '#/components/schemas/IdentificationError' rootApps: title: SignalResponseRootApps type: object @@ -1351,7 +1575,7 @@ components: data: $ref: '#/components/schemas/TamperingResult' error: - $ref: '#/components/schemas/ProductError' + $ref: '#/components/schemas/IdentificationError' highActivity: title: SignalResponseHighActivity type: object @@ -1386,6 +1610,33 @@ components: properties: data: $ref: '#/components/schemas/RawDeviceAttributesResult' + error: + $ref: '#/components/schemas/IdentificationError' + remoteControl: + title: SignalResponseRemoteControl + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/RemoteControlResult' + error: + $ref: '#/components/schemas/ProductError' + velocity: + title: SignalResponseVelocity + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/VelocityResult' + error: + $ref: '#/components/schemas/ProductError' + developerTools: + title: SignalResponseDeveloperTools + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/DeveloperToolsResult' error: $ref: '#/components/schemas/ProductError' EventResponse: @@ -1582,8 +1833,8 @@ components: timezoneMismatch: type: boolean description: >- - User's browser timezone doesn't match the timezone from which - the request was originally made. + The browser timezone doesn't match the timezone inferred from + the request IP address. example: false publicVPN: type: boolean @@ -1597,10 +1848,17 @@ components: This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. example: false + osMismatch: + type: boolean + description: >- + The browser runs on a different operating system than the + operating system inferred from the request network signature. + example: false required: - timezoneMismatch - publicVPN - auxiliaryMobile + - osMismatch required: - result - originTimezone @@ -1672,6 +1930,36 @@ components: example: 0 required: - result + VelocityResult: + type: object + description: > + Sums key data points for a specific `visitorId` at three distinct time + intervals: 5 minutes, 1 hour, and 24 hours as follows: + + - Number of identification events attributed to the visitor ID - Number + of distinct IP addresses associated to the visitor ID. - Number of + distinct countries associated with the visitor ID. - Number of distinct + `linkedId`s associated with the visitor ID. + + The `24h` interval of `distinctIp`, `distinctLinkedId`, and + `distinctCountry` will be omitted if the number of `events` for the + visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher + than 20.000. + additionalProperties: false + properties: + distinctIp: + $ref: '#/components/schemas/VelocityIntervals' + distinctLinkedId: + $ref: '#/components/schemas/VelocityIntervals' + distinctCountry: + $ref: '#/components/schemas/VelocityIntervals' + events: + $ref: '#/components/schemas/VelocityIntervals' + required: + - distinctIp + - distinctLinkedId + - distinctCountry + - events RawDeviceAttributesResult: type: object description: > @@ -1709,19 +1997,27 @@ components: additionalProperties: false properties: time: - title: Time description: > - Time in UTC when the most recent factory reset of the Android or iOS - device was done. If there is no sign of factory reset or the client - is not a mobile device, the field will contain the epoch time (1 - January 1970) in UTC. + Indicates the time (in UTC) of the most recent factory reset that + happened on the **mobile device**. + + When a factory reset cannot be detected on the mobile device or when + the request is initiated from a browser, this field will correspond + to the *epoch* time (i.e 1 Jan 1970 UTC). + + See [Factory Reset + Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) + to learn more about this Smart Signal. type: string format: date-time example: '2022-06-09T22:58:36Z' timestamp: - description: >- - Same value as it's in the `time` field but represented in timestamp - format. + description: > + This field is just another representation of the value in the `time` + field. + + The time of the most recent factory reset that happened on the + **mobile device** is expressed as Unix epoch time. type: integer format: int64 example: 1654815517198 @@ -1877,3 +2173,126 @@ components: required: - code - message + RemoteControlResult: + type: object + additionalProperties: false + properties: + result: + type: boolean + description: > + `true` if the request came from a machine being remotely controlled + (e.g. TeamViewer), `false` otherwise. + example: false + required: + - result + DeveloperToolsResult: + type: object + additionalProperties: false + properties: + result: + type: boolean + description: > + `true` if the browser is Chrome with DevTools open or Firefox with + Developer Tools open, `false` otherwise. + example: false + required: + - result + EventUpdateRequest: + type: object + properties: + linkedId: + type: string + description: LinkedID value to assign to the existing event + tag: + type: object + description: >- + Full `tag` value to be set to the existing event. Replaces any + existing `tag` payload completely. + suspect: + type: boolean + description: Suspect flag indicating observed suspicious or fraudulent event + ErrorUpdateEvent400Response: + type: object + additionalProperties: false + properties: + error: + type: object + additionalProperties: false + title: ErrorUpdateEvent400ResponseError + properties: + code: + type: string + description: > + Error code: * `RequestCannotBeParsed` - the JSON content of the + request contains some errors that prevented us from parsing it + (wrong type/surpassed limits) * `Failed` - the event is more + than 10 days old and cannot be updated + enum: + - RequestCannotBeParsed + - Failed + example: RequestCannotBeParsed + message: + type: string + description: Details about the underlying issue with the input payload + example: suspect flag must be a boolean + required: + - code + - message + ErrorUpdateEvent409Response: + type: object + additionalProperties: false + properties: + error: + type: object + additionalProperties: false + title: ErrorUpdateEvent409ResponseError + properties: + code: + type: string + description: > + Error code: * `StateNotReady` - The event specified with request + id is not ready for updates yet. Try again. + + This error happens in rare cases when update API is called + immediately after receiving the request id on the client. In + case you need to send information right away, we recommend using + the JS agent API instead. + enum: + - StateNotReady + example: StateNotReady + message: + type: string + example: resource is not mutable yet, try again + required: + - code + - message + VelocityIntervals: + type: object + additionalProperties: false + properties: + intervals: + $ref: '#/components/schemas/VelocityIntervalResult' + VelocityIntervalResult: + type: object + description: > + Is absent if the velocity data could not be generated for the visitor + ID. + additionalProperties: false + properties: + 5m: + type: integer + example: 1 + 1h: + type: integer + example: 1 + 24h: + type: integer + description: > + The `24h` interval of `distinctIp`, `distinctLinkedId`, and + `distinctCountry` will be omitted if the number of `events`` for the + visitor ID in the last 24 hours (`events.intervals.['24h']`) is + higher than 20.000. + example: 1 + required: + - 5m + - 1h diff --git a/run_checks.php b/run_checks.php index 6244d346..4cb7e7c2 100644 --- a/run_checks.php +++ b/run_checks.php @@ -1,7 +1,5 @@ getVisits($visitor_id); - fwrite(STDOUT, sprintf("Got visits: %s \n", $result)); + list($result, $response) = $client->getVisits($visitor_id); + if($result->getVisitorId() !== $visitor_id) { + throw new Exception('Argument visitorId is not equal to deserialized getVisitorId'); + } + fwrite(STDOUT, sprintf("Got visits: %s \n", $response->getBody()->getContents())); } catch (Exception $e) { fwrite(STDERR, sprintf("Exception when calling FingerprintApi->getVisits: %s\n", $e->getMessage())); exit(1); } try { - $result = $client->getEvent($request_id); - fwrite(STDOUT, sprintf("Got event: %s \n", $result)); + /** @var $result \Fingerprint\ServerAPI\Model\EventResponse */ + list($result, $response) = $client->getEvent($request_id); + if($result->getProducts()->getIdentification()->getData()->getRequestId() !== $request_id) { + throw new Exception('Argument requestId is not equal to deserialized getRequestId'); + } + fwrite(STDOUT, sprintf("\n\nGot event: %s \n", $response->getBody()->getContents())); } catch (Exception $e) { - fwrite(STDERR, sprintf("Exception when calling FingerprintApi->getVisits: %s\n", $e->getMessage())); + fwrite(STDERR, sprintf("\n\nException when calling FingerprintApi->getVisits: %s\n", $e->getMessage())); + exit(1); +} + +$eventPromise = $client->getEventAsync($request_id); +$eventPromise->then(function ($tuple) use($request_id) { + list($result, $response) = $tuple; + if($result->getProducts()->getIdentification()->getData()->getRequestId() !== $request_id) { + throw new Exception('Argument requestId is not equal to deserialized getRequestId'); + } + fwrite(STDOUT, sprintf("\n\nGot async event: %s \n", $response->getBody()->getContents())); +}, function($exception) { + fwrite(STDERR, sprintf("\n\nException when calling FingerprintApi->getVisits: %s\n", $exception->getMessage())); + exit(1); +})->wait(); + +$visitsPromise = $client->getVisitsAsync($visitor_id); +$visitsPromise->then(function($tuple) use($visitor_id) { + list($result, $response) = $tuple; + if($result->getVisitorId() !== $visitor_id) { + throw new Exception('Argument visitorId is not equal to deserialized getVisitorId'); + } + fwrite(STDOUT, sprintf("\n\nGot async visits: %s \n", $response->getBody()->getContents())); +}, function ($exception) { + fwrite(STDERR, sprintf("\n\nException when calling FingerprintApi->getVisits: %s\n", $exception->getMessage())); + exit(1); +})->wait(); + +$webhookSecret = "secret"; +$webhookData = "data"; +$webhookHeader = "v1=1b2c16b75bd2a870c114153ccda5bcfca63314bc722fa160d690de133ccbb9db"; +$isValidWebhookSign = WebhookVerifier::IsValidWebhookSignature($webhookHeader, $webhookData, $webhookSecret); +if($isValidWebhookSign) { + fwrite(STDOUT, sprintf("\n\nVerified webhook signature\n")); +} else { + fwrite(STDERR, sprintf("\n\nWebhook signature verification failed\n")); exit(1); } // Enable the deprecated ArrayAccess return type warning again if needed error_reporting(error_reporting() | E_DEPRECATED); -fwrite(STDOUT, "Checks passed\n"); +fwrite(STDOUT, "\n\nChecks passed\n"); exit(0); diff --git a/scripts/generate.sh b/scripts/generate.sh index 2d88692a..90e9d983 100755 --- a/scripts/generate.sh +++ b/scripts/generate.sh @@ -40,6 +40,10 @@ rm -f ./src/Model/* java -jar ./bin/swagger-codegen-cli.jar generate -t ./template -l php -i ./res/fingerprint-server-api.yaml -o ./ -c config.json +if [ -z "$GITHUB_ACTIONS" ]; then + docker-compose run --rm lint +fi + # fix invalid code generated for structure with additionalProperties ( # Model file fix @@ -50,6 +54,18 @@ java -jar ./bin/swagger-codegen-cli.jar generate -t ./template -l php -i ./res/f fi ) +# fix invalid code generated for SignalResponseRawDeviceAttributes +( + # Model file fix + if [ "$platform" = "Darwin" ]; then + sed -i '' 's/public function setData(?RawDeviceAttributesResult $data): self/public function setData(?array $data): self/' ./src/Model/SignalResponseRawDeviceAttributes.php + sed -i '' 's/public function getData(): ?RawDeviceAttributesResult/public function getData(): array/' ./src/Model/SignalResponseRawDeviceAttributes.php + else + sed -i 's/public function setData(?RawDeviceAttributesResult $data): self/public function setData(?array $data): self/' ./src/Model/SignalResponseRawDeviceAttributes.php + sed -i 's/public function getData(): ?RawDeviceAttributesResult/public function getData(): array/' ./src/Model/SignalResponseRawDeviceAttributes.php + fi +) + ( # Readme file fix replacement=$(printf 'The rawAttributes object follows this general shape: `{ value: any } | { error: { name: string; message: string; } }`\n') @@ -65,5 +81,5 @@ java -jar ./bin/swagger-codegen-cli.jar generate -t ./template -l php -i ./res/f mv -f src/README.md ./README.md mv -f src/composer.json composer.json -find ./docs -type f ! -name "DecryptionKey.md" ! -name "Sealed.md" -exec rm {} + +find ./docs -type f ! -name "DecryptionKey.md" ! -name "Sealed.md" ! -name "Webhook.md" -exec rm {} + mv -f src/docs/* ./docs diff --git a/scripts/sync.sh b/scripts/sync.sh old mode 100644 new mode 100755 index 781ed46e..ae3378c4 --- a/scripts/sync.sh +++ b/scripts/sync.sh @@ -3,18 +3,45 @@ curl -o ./res/fingerprint-server-api.yaml https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/schemas/fingerprint-server-api-compact.yaml examplesList=( + 'get_visits_200_limit_1.json' 'get_visits_200_limit_500.json' + 'get_visits_403_error.json' + 'get_visits_429_too_many_requests_error.json' + 'webhook.json' 'get_event_200.json' 'get_event_200_all_errors.json' 'get_event_200_extra_fields.json' + 'get_event_403_error.json' + 'get_event_404_error.json' + 'get_event_200_botd_failed_error.json' + 'get_event_200_botd_too_many_requests_error.json' + 'get_event_200_identification_failed_error.json' + 'get_event_200_identification_too_many_requests_error.json' + 'update_event_400_error.json' + 'update_event_403_error.json' + 'update_event_404_error.json' + 'update_event_409_error.json' +) + +sharedExamplesList=( + '400_error_empty_visitor_id.json' + '400_error_incorrect_visitor_id.json' + '403_error_feature_not_enabled.json' + '403_error_token_not_found.json' + '403_error_token_required.json' + '403_error_wrong_region.json' + '404_error_visitor_not_found.json' + '429_error_too_many_requests.json' ) for example in ${examplesList[*]}; do curl -o ./test/mocks/"$example" https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/examples/"$example" done -# PHP function names are case insensitive, so we can just ignore wrong DataCenter value from INTER-481 bug. -# this command looks between IpInfoResult and IpBlockListResult strings and deletes the line with "dataCenter:" and next one if found +for example in ${sharedExamplesList[*]}; do + curl -o ./test/mocks/"$example" https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/examples/shared/"$example" +done + sed -i '' '/IpInfoResult:/,/IpBlockListResult:/ { /dataCenter:/ { N; d; }; }' ./res/fingerprint-server-api.yaml ./scripts/generate.sh diff --git a/sealed_results_example.php b/sealed_results_example.php index 7a8189b7..7db66137 100644 --- a/sealed_results_example.php +++ b/sealed_results_example.php @@ -6,6 +6,9 @@ require_once(__DIR__ . '/vendor/autoload.php'); +$dotenv = Dotenv\Dotenv::createImmutable(__DIR__); +$dotenv->safeLoad(); + $sealed_result = base64_decode($_ENV['BASE64_SEALED_RESULT'] ?? getenv('BASE64_SEALED_RESULT') ?? ""); $sealed_key = base64_decode($_ENV['BASE64_KEY'] ?? getenv('BASE64_KEY') ?? ""); diff --git a/src/Api/FingerprintApi.php b/src/Api/FingerprintApi.php index ea36b13f..444ed1d9 100644 --- a/src/Api/FingerprintApi.php +++ b/src/Api/FingerprintApi.php @@ -1,16 +1,17 @@ client = $client ?: new Client(); $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); + } + + public function getConfig(): Configuration + { + return $this->config; } /** - * @return Configuration + * Operation deleteVisitorData. + * + * Delete data by visitor ID + * + * @param string $visitor_id The [visitor ID](https://dev.fingerprint.com/docs/js-agent#visitorid) you want to delete. (required) + * + * @return array{ null, \Psr\Http\Message\ResponseInterface } + * + * @throws \InvalidArgumentException + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException */ - public function getConfig() + public function deleteVisitorData(string $visitor_id): array { - return $this->config; + $returnType = ''; + $request = $this->deleteVisitorDataRequest($visitor_id); + + try { + $options = $this->createHttpClientOption(); + + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $apiException = new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode() + ); + $apiException->setResponseObject($e->getResponse()); + + throw $apiException; + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + $apiException = new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode + ); + $apiException->setResponseObject($response); + + throw $apiException; + } + + return [null, $response]; + } catch (ApiException $e) { + /** @var ResponseInterface $response */ + $response = $e->getResponseObject(); + + switch ($e->getCode()) { + case 400: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorVisitor400Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 403: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorCommon403Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 404: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorVisitor404Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 429: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorCommon429Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + } + + if (429 === $e->getCode()) { + $e->setRetryAfter(1); + if ($response->hasHeader('retry-after')) { + $e->setRetryAfter((int) $response->getHeader('retry-after')[0]); + } + } + + throw $e; + } } /** - * Operation getEvent + * Operation deleteVisitorDataAsync. * - * Get event by requestId + * Delete data by visitor ID * - * @param string $request_id The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. (required) + * @param string $visitor_id The [visitor ID](https://dev.fingerprint.com/docs/js-agent#visitorid) you want to delete. (required) * - * @throws \Fingerprint\ServerAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Fingerprint\ServerAPI\Model\EventResponse + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException */ - public function getEvent($request_id) + public function deleteVisitorDataAsync(string $visitor_id): PromiseInterface { - list($response) = $this->getEventWithHttpInfo($request_id); - return $response; + $returnType = ''; + $request = $this->deleteVisitorDataRequest($visitor_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($request) { + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + $apiException = new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode + ); + $apiException->setResponseObject($response); + + throw $apiException; + } + + return [null, $response]; + }, + function ($e) { + /** @var ResponseInterface $response */ + $response = $e->getResponseObject(); + + switch ($e->getCode()) { + case 400: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorVisitor400Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 403: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorCommon403Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 404: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorVisitor404Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 429: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorCommon429Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + } + + if (429 === $e->getCode()) { + $e->setRetryAfter(1); + if ($response->hasHeader('retry-after')) { + $e->setRetryAfter((int) $response->getHeader('retry-after')[0]); + } + } + + throw $e; + } + ); } /** - * Operation getEventWithHttpInfo + * Operation getEvent. * - * Get event by requestId + * Get event by request ID * - * @param string $request_id The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. (required) + * @param string $request_id The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each identification request. (required) + * + * @return array{ null|\Fingerprint\ServerAPI\Model\EventResponse, \Psr\Http\Message\ResponseInterface } * - * @throws \Fingerprint\ServerAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Fingerprint\ServerAPI\Model\EventResponse, HTTP status code, HTTP response headers (array of strings) + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException */ - public function getEventWithHttpInfo($request_id) + public function getEvent(string $request_id): array { $returnType = '\Fingerprint\ServerAPI\Model\EventResponse'; $request = $this->getEventRequest($request_id); try { $options = $this->createHttpClientOption(); + try { $response = $this->client->send($request, $options); } catch (RequestException $e) { - throw new ApiException( + $apiException = new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getCode() ); + $apiException->setResponseObject($e->getResponse()); + + throw $apiException; } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( + $apiException = new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $request->getUri() ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $statusCode ); - } + $apiException->setResponseObject($response); - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if (!in_array($returnType, ['string','integer','bool'])) { - $content = json_decode($content); - } + throw $apiException; } - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + $serialized = ObjectSerializer::deserialize($response, $returnType); + return [$serialized, $response]; } catch (ApiException $e) { + /** @var ResponseInterface $response */ + $response = $e->getResponseObject(); + switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Fingerprint\ServerAPI\Model\EventResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\EventResponse'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + break; + case 403: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Fingerprint\ServerAPI\Model\ErrorEvent403Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorCommon403Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + break; + case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Fingerprint\ServerAPI\Model\ErrorEvent404Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorEvent404Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + break; } - throw $e; - } - } - /** - * Operation getEventAsync - * - * Get event by requestId - * - * @param string $request_id The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getEventAsync($request_id) - { - return $this->getEventAsyncWithHttpInfo($request_id) - ->then( - function ($response) { - return $response[0]; + if (429 === $e->getCode()) { + $e->setRetryAfter(1); + if ($response->hasHeader('retry-after')) { + $e->setRetryAfter((int) $response->getHeader('retry-after')[0]); } - ); + } + + throw $e; + } } /** - * Operation getEventAsyncWithHttpInfo + * Operation getEventAsync. * - * Get event by requestId + * Get event by request ID * - * @param string $request_id The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. (required) + * @param string $request_id The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each identification request. (required) * * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException */ - public function getEventAsyncWithHttpInfo($request_id) + public function getEventAsync(string $request_id): PromiseInterface { $returnType = '\Fingerprint\ServerAPI\Model\EventResponse'; $request = $this->getEventRequest($request_id); @@ -234,462 +363,716 @@ public function getEventAsyncWithHttpInfo($request_id) return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } + function ($response) use ($returnType, $request) { + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + $apiException = new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode + ); + $apiException->setResponseObject($response); + + throw $apiException; } - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + $serialized = ObjectSerializer::deserialize($response, $returnType); + + return [$serialized, $response]; }, - 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(), - $response->getBody() - ); + function ($e) { + /** @var ResponseInterface $response */ + $response = $e->getResponseObject(); + + switch ($e->getCode()) { + case 200: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\EventResponse'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 403: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorCommon403Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 404: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorEvent404Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + } + + if (429 === $e->getCode()) { + $e->setRetryAfter(1); + if ($response->hasHeader('retry-after')) { + $e->setRetryAfter((int) $response->getHeader('retry-after')[0]); + } + } + + throw $e; } ); } /** - * Create request for operation 'getEvent' + * Operation getVisits. + * + * Get visits by visitor ID * - * @param string $request_id The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. (required) + * @param string $visitor_id Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. (required) + * @param string $request_id Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. (optional) + * @param string $linked_id Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. (optional) + * @param int $limit Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. (optional) + * @param string $pagination_key Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned. (optional) + * @param int $before ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. (optional) + * + * @return array{ null|\Fingerprint\ServerAPI\Model\Response, \Psr\Http\Message\ResponseInterface } * * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException */ - protected function getEventRequest($request_id) + public function getVisits(string $visitor_id, ?string $request_id = null, ?string $linked_id = null, ?int $limit = null, ?string $pagination_key = null, ?int $before = null): array { - // verify the required parameter 'request_id' is set - if ($request_id === null || (is_array($request_id) && count($request_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $request_id when calling getEvent' - ); - } + $returnType = '\Fingerprint\ServerAPI\Model\Response'; + $request = $this->getVisitsRequest($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before); - $resourcePath = '/events/{request_id}'; - $formParams = []; - $queryParams = ['ii' => $this->integration_info]; - $headerParams = []; - $httpBody = ''; - $multipart = false; + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $apiException = new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode() + ); + $apiException->setResponseObject($e->getResponse()); - // path params - if ($request_id !== null) { - $resourcePath = str_replace( - '{' . 'request_id' . '}', - ObjectSerializer::toPathValue($request_id), - $resourcePath - ); - } + throw $apiException; + } - // body params - $_tempBody = null; + $statusCode = $response->getStatusCode(); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + if ($statusCode < 200 || $statusCode > 299) { + $apiException = new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode + ); + $apiException->setResponseObject($response); - // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + throw $apiException; } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + $serialized = ObjectSerializer::deserialize($response, $returnType); - } else { - // for HTTP post (form) - $httpBody = http_build_query($formParams); - } - } + return [$serialized, $response]; + } catch (ApiException $e) { + /** @var ResponseInterface $response */ + $response = $e->getResponseObject(); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('Auth-API-Key'); - if ($apiKey !== null) { - $headers['Auth-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('api_key'); - if ($apiKey !== null) { - $queryParams['api_key'] = $apiKey; - } + switch ($e->getCode()) { + case 200: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } + break; - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + case 403: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorVisits403'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); - $query = http_build_query($queryParams); - return new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); + break; + + case 429: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\TooManyRequestsResponse'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + } + + if (429 === $e->getCode()) { + $e->setRetryAfter(1); + if ($response->hasHeader('retry-after')) { + $e->setRetryAfter((int) $response->getHeader('retry-after')[0]); + } + } + + throw $e; + } } /** - * Operation getVisits + * Operation getVisitsAsync. * - * Get visits by visitorId + * Get visits by visitor ID * - * @param string $visitor_id Unique identifier of the visitor issued by Fingerprint Pro. (required) - * @param string $request_id Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. (optional) - * @param string $linked_id Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. (optional) - * @param int $limit Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. (optional) - * @param string $pagination_key Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned. (optional) - * @param int $before ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. (optional) + * @param string $visitor_id Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. (required) + * @param string $request_id Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. (optional) + * @param string $linked_id Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. (optional) + * @param int $limit Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. (optional) + * @param string $pagination_key Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned. (optional) + * @param int $before ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. (optional) * - * @throws \Fingerprint\ServerAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Fingerprint\ServerAPI\Model\Response + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException */ - public function getVisits($visitor_id, $request_id = null, $linked_id = null, $limit = null, $pagination_key = null, $before = null) + public function getVisitsAsync(string $visitor_id, ?string $request_id = null, ?string $linked_id = null, ?int $limit = null, ?string $pagination_key = null, ?int $before = null): PromiseInterface { - list($response) = $this->getVisitsWithHttpInfo($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before); - return $response; + $returnType = '\Fingerprint\ServerAPI\Model\Response'; + $request = $this->getVisitsRequest($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType, $request) { + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + $apiException = new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode + ); + $apiException->setResponseObject($response); + + throw $apiException; + } + + $serialized = ObjectSerializer::deserialize($response, $returnType); + + return [$serialized, $response]; + }, + function ($e) { + /** @var ResponseInterface $response */ + $response = $e->getResponseObject(); + + switch ($e->getCode()) { + case 200: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 403: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorVisits403'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 429: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\TooManyRequestsResponse'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + } + + if (429 === $e->getCode()) { + $e->setRetryAfter(1); + if ($response->hasHeader('retry-after')) { + $e->setRetryAfter((int) $response->getHeader('retry-after')[0]); + } + } + + throw $e; + } + ); } /** - * Operation getVisitsWithHttpInfo + * Operation updateEvent. * - * Get visits by visitorId + * Update an event with a given request ID * - * @param string $visitor_id Unique identifier of the visitor issued by Fingerprint Pro. (required) - * @param string $request_id Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. (optional) - * @param string $linked_id Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. (optional) - * @param int $limit Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. (optional) - * @param string $pagination_key Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned. (optional) - * @param int $before ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. (optional) + * @param EventUpdateRequest $body (required) + * @param string $request_id The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). (required) + * + * @return array{ null, \Psr\Http\Message\ResponseInterface } * - * @throws \Fingerprint\ServerAPI\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Fingerprint\ServerAPI\Model\Response, HTTP status code, HTTP response headers (array of strings) + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException */ - public function getVisitsWithHttpInfo($visitor_id, $request_id = null, $linked_id = null, $limit = null, $pagination_key = null, $before = null) + public function updateEvent(EventUpdateRequest $body, string $request_id): array { - $returnType = '\Fingerprint\ServerAPI\Model\Response'; - $request = $this->getVisitsRequest($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before); + $returnType = ''; + $request = $this->updateEventRequest($body, $request_id); try { $options = $this->createHttpClientOption(); + try { $response = $this->client->send($request, $options); } catch (RequestException $e) { - throw new ApiException( + $apiException = new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getCode() ); + $apiException->setResponseObject($e->getResponse()); + + throw $apiException; } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( + $apiException = new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $request->getUri() ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $statusCode ); - } + $apiException->setResponseObject($response); - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if (!in_array($returnType, ['string','integer','bool'])) { - $content = json_decode($content); - } + throw $apiException; } - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return [null, $response]; } catch (ApiException $e) { + /** @var ResponseInterface $response */ + $response = $e->getResponseObject(); + switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Fingerprint\ServerAPI\Model\Response', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + case 400: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorUpdateEvent400Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + break; + case 403: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Fingerprint\ServerAPI\Model\ErrorVisits403', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorCommon403Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + break; - case 429: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Fingerprint\ServerAPI\Model\ManyRequestsResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); + + case 404: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorEvent404Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 409: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorUpdateEvent409Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + break; } + + if (429 === $e->getCode()) { + $e->setRetryAfter(1); + if ($response->hasHeader('retry-after')) { + $e->setRetryAfter((int) $response->getHeader('retry-after')[0]); + } + } + throw $e; } } /** - * Operation getVisitsAsync + * Operation updateEventAsync. * - * Get visits by visitorId + * Update an event with a given request ID * - * @param string $visitor_id Unique identifier of the visitor issued by Fingerprint Pro. (required) - * @param string $request_id Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. (optional) - * @param string $linked_id Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. (optional) - * @param int $limit Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. (optional) - * @param string $pagination_key Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned. (optional) - * @param int $before ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. (optional) + * @param EventUpdateRequest $body (required) + * @param string $request_id The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). (required) * * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException */ - public function getVisitsAsync($visitor_id, $request_id = null, $linked_id = null, $limit = null, $pagination_key = null, $before = null) + public function updateEventAsync(EventUpdateRequest $body, string $request_id): PromiseInterface { - return $this->getVisitsAsyncWithHttpInfo($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before) + $returnType = ''; + $request = $this->updateEventRequest($body, $request_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) ->then( - function ($response) { - return $response[0]; + function ($response) use ($request) { + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + $apiException = new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode + ); + $apiException->setResponseObject($response); + + throw $apiException; + } + + return [null, $response]; + }, + function ($e) { + /** @var ResponseInterface $response */ + $response = $e->getResponseObject(); + + switch ($e->getCode()) { + case 400: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorUpdateEvent400Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 403: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorCommon403Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 404: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorEvent404Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 409: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorUpdateEvent409Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + } + + if (429 === $e->getCode()) { + $e->setRetryAfter(1); + if ($response->hasHeader('retry-after')) { + $e->setRetryAfter((int) $response->getHeader('retry-after')[0]); + } + } + + throw $e; } ); } /** - * Operation getVisitsAsyncWithHttpInfo - * - * Get visits by visitorId - * - * @param string $visitor_id Unique identifier of the visitor issued by Fingerprint Pro. (required) - * @param string $request_id Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. (optional) - * @param string $linked_id Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. (optional) - * @param int $limit Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. (optional) - * @param string $pagination_key Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned. (optional) - * @param int $before ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. (optional) + * Create request for operation 'deleteVisitorData'. * * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException */ - public function getVisitsAsyncWithHttpInfo($visitor_id, $request_id = null, $linked_id = null, $limit = null, $pagination_key = null, $before = null) + protected function deleteVisitorDataRequest(string $visitor_id): Request { - $returnType = '\Fingerprint\ServerAPI\Model\Response'; - $request = $this->getVisitsRequest($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before); + // verify the required parameter 'visitor_id' is set + if (null === $visitor_id || (is_array($visitor_id) && 0 === count($visitor_id))) { + throw new \InvalidArgumentException( + 'Missing the required parameter $visitor_id when calling deleteVisitorData' + ); + } - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } + $resourcePath = '/visitors/{visitor_id}'; + $headers = []; + $queryParams = ['ii' => $this->integration_info]; + $headerParams = []; + $httpBody = ''; - 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(), - $response->getBody() - ); - } + // path params + if (null !== $visitor_id) { + $resourcePath = str_replace( + '{visitor_id}', + ObjectSerializer::toPathValue($visitor_id), + $resourcePath ); + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Auth-API-Key'); + if (null !== $apiKey) { + $headers['Auth-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_key'); + if (null !== $apiKey) { + $queryParams['api_key'] = $apiKey; + } + + $defaultHeaders = [ + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + ]; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = http_build_query($queryParams); + + return new Request( + 'DELETE', + $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''), + $headers, + $httpBody + ); } /** - * Create request for operation 'getVisits' + * Create request for operation 'getEvent'. * - * @param string $visitor_id Unique identifier of the visitor issued by Fingerprint Pro. (required) - * @param string $request_id Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. (optional) - * @param string $linked_id Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. (optional) - * @param int $limit Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. (optional) - * @param string $pagination_key Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned. (optional) - * @param int $before ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. (optional) + * @throws \InvalidArgumentException + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException + */ + protected function getEventRequest(string $request_id): Request + { + // verify the required parameter 'request_id' is set + if (null === $request_id || (is_array($request_id) && 0 === count($request_id))) { + throw new \InvalidArgumentException( + 'Missing the required parameter $request_id when calling getEvent' + ); + } + + $resourcePath = '/events/{request_id}'; + $headers = []; + $queryParams = ['ii' => $this->integration_info]; + $headerParams = []; + $httpBody = ''; + + // path params + if (null !== $request_id) { + $resourcePath = str_replace( + '{request_id}', + ObjectSerializer::toPathValue($request_id), + $resourcePath + ); + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Auth-API-Key'); + if (null !== $apiKey) { + $headers['Auth-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_key'); + if (null !== $apiKey) { + $queryParams['api_key'] = $apiKey; + } + + $defaultHeaders = [ + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + ]; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = http_build_query($queryParams); + + return new Request( + 'GET', + $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create request for operation 'getVisits'. * * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException */ - protected function getVisitsRequest($visitor_id, $request_id = null, $linked_id = null, $limit = null, $pagination_key = null, $before = null) + protected function getVisitsRequest(string $visitor_id, ?string $request_id = null, ?string $linked_id = null, ?int $limit = null, ?string $pagination_key = null, ?int $before = null): Request { // verify the required parameter 'visitor_id' is set - if ($visitor_id === null || (is_array($visitor_id) && count($visitor_id) === 0)) { + if (null === $visitor_id || (is_array($visitor_id) && 0 === count($visitor_id))) { throw new \InvalidArgumentException( 'Missing the required parameter $visitor_id when calling getVisits' ); } $resourcePath = '/visitors/{visitor_id}'; - $formParams = []; + $headers = []; $queryParams = ['ii' => $this->integration_info]; $headerParams = []; $httpBody = ''; - $multipart = false; // query params - if ($request_id !== null) { + if (null !== $request_id) { $queryParams['request_id'] = ObjectSerializer::toQueryValue($request_id, null); } // query params - if ($linked_id !== null) { + if (null !== $linked_id) { $queryParams['linked_id'] = ObjectSerializer::toQueryValue($linked_id, null); } // query params - if ($limit !== null) { + if (null !== $limit) { $queryParams['limit'] = ObjectSerializer::toQueryValue($limit, 'int32'); } // query params - if ($pagination_key !== null) { + if (null !== $pagination_key) { $queryParams['paginationKey'] = ObjectSerializer::toQueryValue($pagination_key, null); } // query params - if ($before !== null) { + if (null !== $before) { $queryParams['before'] = ObjectSerializer::toQueryValue($before, 'int64'); } // path params - if ($visitor_id !== null) { + if (null !== $visitor_id) { $resourcePath = str_replace( - '{' . 'visitor_id' . '}', + '{visitor_id}', ObjectSerializer::toPathValue($visitor_id), $resourcePath ); } - // body params - $_tempBody = null; + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Auth-API-Key'); + if (null !== $apiKey) { + $headers['Auth-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_key'); + if (null !== $apiKey) { + $queryParams['api_key'] = $apiKey; + } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + $defaultHeaders = [ + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + ]; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = http_build_query($queryParams); + + return new Request( + 'GET', + $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create request for operation 'updateEvent'. + * + * @throws \InvalidArgumentException + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException + */ + protected function updateEventRequest(EventUpdateRequest $body, string $request_id): Request + { + // verify the required parameter 'body' is set + if (null === $body || (is_array($body) && 0 === count($body))) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling updateEvent' ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + } + // verify the required parameter 'request_id' is set + if (null === $request_id || (is_array($request_id) && 0 === count($request_id))) { + throw new \InvalidArgumentException( + 'Missing the required parameter $request_id when calling updateEvent' ); } + $resourcePath = '/events/{request_id}'; + $headers = []; + $queryParams = ['ii' => $this->integration_info]; + $headerParams = []; + $httpBody = ''; + + // path params + if (null !== $request_id) { + $resourcePath = str_replace( + '{request_id}', + ObjectSerializer::toPathValue($request_id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present - $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = http_build_query($formParams); - } + $httpBody = json_encode($_tempBody); } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('Auth-API-Key'); - if ($apiKey !== null) { + if (null !== $apiKey) { $headers['Auth-API-Key'] = $apiKey; } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('api_key'); - if ($apiKey !== null) { + if (null !== $apiKey) { $queryParams['api_key'] = $apiKey; } - $defaultHeaders = []; + $defaultHeaders = [ + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + ]; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } @@ -701,27 +1084,27 @@ protected function getVisitsRequest($visitor_id, $request_id = null, $linked_id ); $query = http_build_query($queryParams); + return new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + 'PUT', + $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''), $headers, $httpBody ); } /** - * Create http client option + * Create http client option. * * @throws \RuntimeException on file opening failure - * @return array of http client options */ - protected function createHttpClientOption() + protected function createHttpClientOption(): array { $options = []; if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException('Failed to open the debug file: '.$this->config->getDebugFile()); } } diff --git a/src/ApiException.php b/src/ApiException.php index a2d352c3..1905ffe8 100644 --- a/src/ApiException.php +++ b/src/ApiException.php @@ -1,16 +1,17 @@ responseObject = $obj; + } - /** - * Constructor - * - * @param string $message Error message - * @param int $code HTTP status code - * @param string[]|null $responseHeaders HTTP response header - * @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string - */ - public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) + public function getResponseObject(): ResponseInterface { - parent::__construct($message, $code); - $this->responseHeaders = $responseHeaders; - $this->responseBody = $responseBody; + return $this->responseObject; } - /** - * Gets the HTTP response header - * - * @return string[]|null HTTP response header - */ - public function getResponseHeaders() + public function getErrorDetails(): ModelInterface { - return $this->responseHeaders; + return $this->errorDetails; } - /** - * Gets the HTTP body of the server response either as Json or string - * - * @return mixed HTTP body of the server response either as \stdClass or string - */ - public function getResponseBody() + public function setErrorDetails(ModelInterface $errorDetails): void { - return $this->responseBody; + $this->errorDetails = $errorDetails; } - /** - * Sets the deseralized response object (during deserialization) - * - * @param mixed $obj Deserialized response object - * - * @return void - */ - public function setResponseObject($obj) + public function getRetryAfter(): ?int { - $this->responseObject = $obj; + return $this->retryAfter; } - /** - * Gets the deseralized response object (during deserialization) - * - * @return mixed the deserialized response object - */ - public function getResponseObject() + public function setRetryAfter(?int $retryAfter): void { - return $this->responseObject; + $this->retryAfter = $retryAfter; } } diff --git a/src/Configuration.php b/src/Configuration.php index 65a67717..7d7ce356 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -1,16 +1,17 @@ tempFolderPath = sys_get_temp_dir(); } /** - * Sets API key + * Sets API key. * * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * @param string $key API key or token + * @param string $key API key or token * * @return $this */ - public function setApiKey($apiKeyIdentifier, $key) + public function setApiKey(string $apiKeyIdentifier, string $key): self { $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; } /** - * Gets API key + * Gets API key. * * @param string $apiKeyIdentifier API key identifier (authentication scheme) * - * @return string API key or token + * @return null|string API key or token */ - public function getApiKey($apiKeyIdentifier) + public function getApiKey(string $apiKeyIdentifier): ?string { return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; } /** - * Sets the prefix for API key (e.g. Bearer) + * Sets the prefix for API key (e.g. Bearer). * * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * @param string $prefix API key prefix, e.g. Bearer + * @param string $prefix API key prefix, e.g. Bearer * * @return $this */ - public function setApiKeyPrefix($apiKeyIdentifier, $prefix) + public function setApiKeyPrefix(string $apiKeyIdentifier, string $prefix): self { $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; } /** - * Gets API key prefix + * Gets API key prefix. * * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * - * @return string */ - public function getApiKeyPrefix($apiKeyIdentifier) + public function getApiKeyPrefix(string $apiKeyIdentifier): ?string { return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; } /** - * Sets the access token for OAuth + * Sets the access token for OAuth. * * @param string $accessToken Token for OAuth * * @return $this */ - public function setAccessToken($accessToken) + public function setAccessToken(string $accessToken): self { $this->accessToken = $accessToken; + return $this; } /** - * Gets the access token for OAuth + * Gets the access token for OAuth. * * @return string Access token for OAuth */ - public function getAccessToken() + public function getAccessToken(): string { return $this->accessToken; } /** - * Sets the username for HTTP basic authentication + * Sets the username for HTTP basic authentication. * * @param string $username Username for HTTP basic authentication * * @return $this */ - public function setUsername($username) + public function setUsername(string $username): self { $this->username = $username; + return $this; } /** - * Gets the username for HTTP basic authentication + * Gets the username for HTTP basic authentication. * * @return string Username for HTTP basic authentication */ - public function getUsername() + public function getUsername(): string { return $this->username; } /** - * Sets the password for HTTP basic authentication + * Sets the password for HTTP basic authentication. * * @param string $password Password for HTTP basic authentication * * @return $this */ - public function setPassword($password) + public function setPassword(string $password): self { $this->password = $password; + return $this; } /** - * Gets the password for HTTP basic authentication + * Gets the password for HTTP basic authentication. * * @return string Password for HTTP basic authentication */ - public function getPassword() + public function getPassword(): string { return $this->password; } /** - * Sets the host + * Sets the host. * * @param string $host Host * * @return $this */ - public function setHost($host) + public function setHost(string $host): self { $this->host = $host; + return $this; } /** - * Gets the host + * Gets the host. * * @return string Host */ - public function getHost() + public function getHost(): string { return $this->host; } /** - * @param $region * @return $this */ - public function setRegion($region = self::REGION_GLOBAL) + public function setRegion(?string $region = self::REGION_GLOBAL): self { switch (trim(strtolower($region))) { case self::REGION_ASIA: - case "as": - case "asia": + case 'as': + case 'asia': $this->setHost(self::REGION_ASIA); + break; + case self::REGION_EUROPE: - case "eu": - case "europe": + case 'eu': + case 'europe': $this->setHost(self::REGION_EUROPE); + break; + default: case self::REGION_GLOBAL: - case "global": + case 'global': $this->setHost(self::REGION_GLOBAL); + break; } @@ -293,112 +284,109 @@ public function setRegion($region = self::REGION_GLOBAL) } /** - * Sets the user agent of the api client + * Sets the user agent of the api client. * * @param string $userAgent the user agent of the api client * * @return $this + * * @throws \InvalidArgumentException */ - public function setUserAgent($userAgent) + public function setUserAgent(string $userAgent): self { if (!is_string($userAgent)) { throw new \InvalidArgumentException('User-agent must be a string.'); } $this->userAgent = $userAgent; + return $this; } /** - * Gets the user agent of the api client + * Gets the user agent of the api client. * * @return string user agent */ - public function getUserAgent() + public function getUserAgent(): string { return $this->userAgent; } /** - * Sets debug flag + * Sets debug flag. * * @param bool $debug Debug flag * * @return $this */ - public function setDebug($debug) + public function setDebug(bool $debug): self { $this->debug = $debug; + return $this; } /** - * Gets the debug flag - * - * @return bool + * Gets the debug flag. */ - public function getDebug() + public function getDebug(): bool { return $this->debug; } /** - * Sets the debug file + * Sets the debug file. * * @param string $debugFile Debug file * * @return $this */ - public function setDebugFile($debugFile) + public function setDebugFile(string $debugFile): self { $this->debugFile = $debugFile; + return $this; } /** - * Gets the debug file - * - * @return string + * Gets the debug file. */ - public function getDebugFile() + public function getDebugFile(): string { return $this->debugFile; } /** - * Sets the temp folder path + * Sets the temp folder path. * * @param string $tempFolderPath Temp folder path * * @return $this */ - public function setTempFolderPath($tempFolderPath) + public function setTempFolderPath(string $tempFolderPath): self { $this->tempFolderPath = $tempFolderPath; + return $this; } /** - * Gets the temp folder path + * Gets the temp folder path. * * @return string Temp folder path */ - public function getTempFolderPath() + public function getTempFolderPath(): string { return $this->tempFolderPath; } /** - * Gets the default configuration instance, with apiKey and host params - * - * @param $api_key - * @param $region - * @return Configuration + * Gets the default configuration instance, with apiKey and host params. */ - public static function getDefaultConfiguration($api_key = null, $region = self::REGION_GLOBAL) + public static function getDefaultConfiguration(?string $api_key = null, ?string $region = self::REGION_GLOBAL): self { - if (self::$defaultConfiguration === null) { + if (null === self::$defaultConfiguration) { self::$defaultConfiguration = new Configuration(); } @@ -409,56 +397,54 @@ public static function getDefaultConfiguration($api_key = null, $region = self:: } /** - * Sets the detault configuration instance + * Sets the detault configuration instance. * * @param Configuration $config An instance of the Configuration Object - * - * @return void */ - public static function setDefaultConfiguration(Configuration $config) + public static function setDefaultConfiguration(Configuration $config): void { self::$defaultConfiguration = $config; } /** - * Gets the essential information for debugging + * Gets the essential information for debugging. * * @return string The report for debugging */ - public static function toDebugReport() + public static function toDebugReport(): string { - $report = 'PHP SDK (Fingerprint\ServerAPI) Debug Report:' . PHP_EOL; - $report .= ' OS: ' . php_uname() . PHP_EOL; - $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' OpenAPI Spec Version: 3' . PHP_EOL; - $report .= ' SDK Package Version: 4.1.0' . PHP_EOL; - $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; + $report = 'PHP SDK (Fingerprint\ServerAPI) Debug Report:'.PHP_EOL; + $report .= ' OS: '.php_uname().PHP_EOL; + $report .= ' PHP Version: '.PHP_VERSION.PHP_EOL; + $report .= ' OpenAPI Spec Version: 3'.PHP_EOL; + $report .= ' SDK Package Version: dev-5.0.0-1'.PHP_EOL; + $report .= ' Temp Folder Path: '.self::getDefaultConfiguration()->getTempFolderPath().PHP_EOL; return $report; } /** - * Get API key (with prefix if set) + * Get API key (with prefix if set). * * @param string $apiKeyIdentifier name of apikey * - * @return string API key with the prefix + * @return null|string API key with the prefix */ - public function getApiKeyWithPrefix($apiKeyIdentifier) + public function getApiKeyWithPrefix(string $apiKeyIdentifier): ?string { $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); $apiKey = $this->getApiKey($apiKeyIdentifier); - if ($apiKey === null) { + if (null === $apiKey) { return null; } - if ($prefix === null) { + if (null === $prefix) { $keyWithPrefix = $apiKey; } else { - $keyWithPrefix = $prefix . ' ' . $apiKey; + $keyWithPrefix = $prefix.' '.$apiKey; } return $keyWithPrefix; } -} \ No newline at end of file +} diff --git a/src/HeaderSelector.php b/src/HeaderSelector.php deleted file mode 100644 index 04b45bc7..00000000 --- a/src/HeaderSelector.php +++ /dev/null @@ -1,109 +0,0 @@ -selectAcceptHeader($accept); - if ($accept !== null) { - $headers['Accept'] = $accept; - } - - $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); - return $headers; - } - - /** - * @param string[] $accept - * @return array - */ - public function selectHeadersForMultipart($accept) - { - $headers = $this->selectHeaders($accept, []); - - unset($headers['Content-Type']); - return $headers; - } - - /** - * Return the header 'Accept' based on an array of Accept provided - * - * @param string[] $accept Array of header - * - * @return string Accept (e.g. application/json) - */ - private function selectAcceptHeader($accept) - { - if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { - return null; - } elseif (preg_grep("/application\/json/i", $accept)) { - return 'application/json'; - } else { - return implode(',', $accept); - } - } - - /** - * Return the content type based on an array of content-type provided - * - * @param string[] $contentType Array fo content-type - * - * @return string Content-Type (e.g. application/json) - */ - private function selectContentTypeHeader($contentType) - { - if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { - return 'application/json'; - } elseif (preg_grep("/application\/json/i", $contentType)) { - return 'application/json'; - } else { - return implode(',', $contentType); - } - } -} - diff --git a/src/Model/ASN.php b/src/Model/ASN.php index c455a809..6e544e45 100644 --- a/src/Model/ASN.php +++ b/src/Model/ASN.php @@ -1,17 +1,16 @@ 'string', -'network' => 'string', -'name' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'asn' => null, -'network' => null, -'name' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'ASN'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'asn' => 'string', + 'network' => 'string', + 'name' => 'string']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'asn' => null, + 'network' => null, + 'name' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'asn' => 'asn', -'network' => 'network', -'name' => 'name' ]; + 'network' => 'network', + 'name' => 'name']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'asn' => 'setAsn', -'network' => 'setNetwork', -'name' => 'setName' ]; + 'network' => 'setNetwork', + 'name' => 'setName']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'asn' => 'getAsn', -'network' => 'getNetwork', -'name' => 'getName' ]; + 'network' => 'getNetwork', + 'name' => 'getName']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] */ - public static function attributeMap() + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['asn'] = isset($data['asn']) ? $data['asn'] : null; + $this->container['network'] = isset($data['network']) ? $data['network'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['asn'] = isset($data['asn']) ? $data['asn'] : null; - $this->container['network'] = isset($data['network']) ? $data['network'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -189,49 +185,47 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['asn'] === null) { + if (null === $this->container['asn']) { $invalidProperties[] = "'asn' can't be null"; } - if ($this->container['network'] === null) { + if (null === $this->container['network']) { $invalidProperties[] = "'network' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets asn - * - * @return string + * Gets asn. */ - public function getAsn() + public function getAsn(): string { return $this->container['asn']; } /** - * Sets asn + * Sets asn. * * @param string $asn asn * * @return $this */ - public function setAsn($asn) + public function setAsn(string $asn): self { $this->container['asn'] = $asn; @@ -239,23 +233,21 @@ public function setAsn($asn) } /** - * Gets network - * - * @return string + * Gets network. */ - public function getNetwork() + public function getNetwork(): string { return $this->container['network']; } /** - * Sets network + * Sets network. * * @param string $network network * * @return $this */ - public function setNetwork($network) + public function setNetwork(string $network): self { $this->container['network'] = $network; @@ -263,37 +255,35 @@ public function setNetwork($network) } /** - * Gets name + * Gets name. * - * @return string + * @return ?string */ - public function getName() + public function getName(): ?string { return $this->container['name']; } /** - * Sets name + * Sets name. * - * @param string $name name + * @param ?string $name name * * @return $this */ - public function setName($name) + public function setName(?string $name): self { $this->container['name'] = $name; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -301,12 +291,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -314,13 +301,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -332,30 +316,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/BotdDetectionResult.php b/src/Model/BotdDetectionResult.php index 01f6e0d4..27120931 100644 --- a/src/Model/BotdDetectionResult.php +++ b/src/Model/BotdDetectionResult.php @@ -1,17 +1,16 @@ 'string', -'type' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null, -'type' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'BotdDetectionResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'string', + 'type' => 'string']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null, + 'type' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'result' => 'result', -'type' => 'type' ]; + 'type' => 'type']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'result' => 'setResult', -'type' => 'setType' ]; + 'type' => 'setType']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'result' => 'getResult', -'type' => 'getType' ]; + 'type' => 'getType']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - const RESULT_NOT_DETECTED = 'notDetected'; -const RESULT_GOOD = 'good'; -const RESULT_BAD = 'bad'; + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Gets allowable values of the enum - * - * @return string[] + * Array of attributes to setter functions (for deserialization of responses). */ - public function getResultAllowableValues() + public static function setters(): array { - return [ - self::RESULT_NOT_DETECTED, -self::RESULT_GOOD, -self::RESULT_BAD, ]; + return self::$setters; } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to getter functions (for serialization of requests). */ - protected $container = []; + public static function getters(): array + { + return self::$getters; + } /** - * Constructor + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Gets allowable values of the enum. * - * @param mixed[] $data Associated array of property values - * initializing the model + * @return string[] */ - public function __construct(array $data = null) + public function getResultAllowableValues(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; - $this->container['type'] = isset($data['type']) ? $data['type'] : null; + return [ + self::RESULT_NOT_DETECTED, + self::RESULT_GOOD, + self::RESULT_BAD, ]; } /** @@ -199,11 +198,11 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } $allowedValues = $this->getResultAllowableValues(); @@ -219,34 +218,31 @@ public function listInvalidProperties() /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return string + * Gets result. */ - public function getResult() + public function getResult(): string { return $this->container['result']; } /** - * Sets result + * Sets result. * * @param string $result Bot detection result: * `notDetected` - the visitor is not a bot * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on * * @return $this */ - public function setResult($result) + public function setResult(string $result): self { $allowedValues = $this->getResultAllowableValues(); if (!in_array($result, $allowedValues, true)) { @@ -263,37 +259,35 @@ public function setResult($result) } /** - * Gets type + * Gets type. * - * @return string + * @return ?string */ - public function getType() + public function getType(): ?string { return $this->container['type']; } /** - * Sets type + * Sets type. * - * @param string $type type + * @param ?string $type type * * @return $this */ - public function setType($type) + public function setType(?string $type): self { $this->container['type'] = $type; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -301,12 +295,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -314,13 +305,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -332,30 +320,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/BotdResult.php b/src/Model/BotdResult.php index 5d2c2b94..178a37d2 100644 --- a/src/Model/BotdResult.php +++ b/src/Model/BotdResult.php @@ -1,17 +1,16 @@ 'string', -'time' => '\DateTime', -'url' => 'string', -'user_agent' => 'string', -'request_id' => 'string', -'linked_id' => 'string', -'bot' => '\Fingerprint\ServerAPI\Model\BotdDetectionResult' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'ip' => 'ipv4', -'time' => 'date-time', -'url' => null, -'user_agent' => null, -'request_id' => null, -'linked_id' => null, -'bot' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'BotdResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'ip' => 'string', + 'time' => '\DateTime', + 'url' => 'string', + 'user_agent' => 'string', + 'request_id' => 'string', + 'linked_id' => 'string', + 'bot' => '\Fingerprint\ServerAPI\Model\BotdDetectionResult']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'ip' => 'ipv4', + 'time' => 'date-time', + 'url' => null, + 'user_agent' => null, + 'request_id' => null, + 'linked_id' => null, + 'bot' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'ip' => 'ip', -'time' => 'time', -'url' => 'url', -'user_agent' => 'userAgent', -'request_id' => 'requestId', -'linked_id' => 'linkedId', -'bot' => 'bot' ]; + 'time' => 'time', + 'url' => 'url', + 'user_agent' => 'userAgent', + 'request_id' => 'requestId', + 'linked_id' => 'linkedId', + 'bot' => 'bot']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'ip' => 'setIp', -'time' => 'setTime', -'url' => 'setUrl', -'user_agent' => 'setUserAgent', -'request_id' => 'setRequestId', -'linked_id' => 'setLinkedId', -'bot' => 'setBot' ]; + 'time' => 'setTime', + 'url' => 'setUrl', + 'user_agent' => 'setUserAgent', + 'request_id' => 'setRequestId', + 'linked_id' => 'setLinkedId', + 'bot' => 'setBot']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'ip' => 'getIp', -'time' => 'getTime', -'url' => 'getUrl', -'user_agent' => 'getUserAgent', -'request_id' => 'getRequestId', -'linked_id' => 'getLinkedId', -'bot' => 'getBot' ]; + 'time' => 'getTime', + 'url' => 'getUrl', + 'user_agent' => 'getUserAgent', + 'request_id' => 'getRequestId', + 'linked_id' => 'getLinkedId', + 'bot' => 'getBot']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; + $this->container['time'] = isset($data['time']) ? $data['time'] : null; + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + $this->container['user_agent'] = isset($data['user_agent']) ? $data['user_agent'] : null; + $this->container['request_id'] = isset($data['request_id']) ? $data['request_id'] : null; + $this->container['linked_id'] = isset($data['linked_id']) ? $data['linked_id'] : null; + $this->container['bot'] = isset($data['bot']) ? $data['bot'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; - $this->container['time'] = isset($data['time']) ? $data['time'] : null; - $this->container['url'] = isset($data['url']) ? $data['url'] : null; - $this->container['user_agent'] = isset($data['user_agent']) ? $data['user_agent'] : null; - $this->container['request_id'] = isset($data['request_id']) ? $data['request_id'] : null; - $this->container['linked_id'] = isset($data['linked_id']) ? $data['linked_id'] : null; - $this->container['bot'] = isset($data['bot']) ? $data['bot'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -214,61 +211,59 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['ip'] === null) { + if (null === $this->container['ip']) { $invalidProperties[] = "'ip' can't be null"; } - if ($this->container['time'] === null) { + if (null === $this->container['time']) { $invalidProperties[] = "'time' can't be null"; } - if ($this->container['url'] === null) { + if (null === $this->container['url']) { $invalidProperties[] = "'url' can't be null"; } - if ($this->container['user_agent'] === null) { + if (null === $this->container['user_agent']) { $invalidProperties[] = "'user_agent' can't be null"; } - if ($this->container['request_id'] === null) { + if (null === $this->container['request_id']) { $invalidProperties[] = "'request_id' can't be null"; } - if ($this->container['bot'] === null) { + if (null === $this->container['bot']) { $invalidProperties[] = "'bot' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets ip - * - * @return string + * Gets ip. */ - public function getIp() + public function getIp(): string { return $this->container['ip']; } /** - * Sets ip + * Sets ip. * - * @param string $ip IP address of the requesting browser or bot. + * @param string $ip IP address of the requesting browser or bot * * @return $this */ - public function setIp($ip) + public function setIp(string $ip): self { $this->container['ip'] = $ip; @@ -276,23 +271,21 @@ public function setIp($ip) } /** - * Gets time - * - * @return \DateTime + * Gets time. */ - public function getTime() + public function getTime(): \DateTime { return $this->container['time']; } /** - * Sets time + * Sets time. * * @param \DateTime $time Time in UTC when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible * * @return $this */ - public function setTime($time) + public function setTime(\DateTime $time): self { $this->container['time'] = $time; @@ -300,23 +293,21 @@ public function setTime($time) } /** - * Gets url - * - * @return string + * Gets url. */ - public function getUrl() + public function getUrl(): string { return $this->container['url']; } /** - * Sets url + * Sets url. * - * @param string $url Page URL from which identification request was sent. + * @param string $url page URL from which identification request was sent * * @return $this */ - public function setUrl($url) + public function setUrl(string $url): self { $this->container['url'] = $url; @@ -324,23 +315,21 @@ public function setUrl($url) } /** - * Gets user_agent - * - * @return string + * Gets user_agent. */ - public function getUserAgent() + public function getUserAgent(): string { return $this->container['user_agent']; } /** - * Sets user_agent + * Sets user_agent. * * @param string $user_agent user_agent * * @return $this */ - public function setUserAgent($user_agent) + public function setUserAgent(string $user_agent): self { $this->container['user_agent'] = $user_agent; @@ -348,23 +337,21 @@ public function setUserAgent($user_agent) } /** - * Gets request_id - * - * @return string + * Gets request_id. */ - public function getRequestId() + public function getRequestId(): string { return $this->container['request_id']; } /** - * Sets request_id + * Sets request_id. * * @param string $request_id request_id * * @return $this */ - public function setRequestId($request_id) + public function setRequestId(string $request_id): self { $this->container['request_id'] = $request_id; @@ -372,23 +359,23 @@ public function setRequestId($request_id) } /** - * Gets linked_id + * Gets linked_id. * - * @return string + * @return ?string */ - public function getLinkedId() + public function getLinkedId(): ?string { return $this->container['linked_id']; } /** - * Sets linked_id + * Sets linked_id. * - * @param string $linked_id linked_id + * @param ?string $linked_id linked_id * * @return $this */ - public function setLinkedId($linked_id) + public function setLinkedId(?string $linked_id): self { $this->container['linked_id'] = $linked_id; @@ -396,37 +383,33 @@ public function setLinkedId($linked_id) } /** - * Gets bot - * - * @return \Fingerprint\ServerAPI\Model\BotdDetectionResult + * Gets bot. */ - public function getBot() + public function getBot(): BotdDetectionResult { return $this->container['bot']; } /** - * Sets bot + * Sets bot. * - * @param \Fingerprint\ServerAPI\Model\BotdDetectionResult $bot bot + * @param BotdDetectionResult $bot bot * * @return $this */ - public function setBot($bot) + public function setBot(BotdDetectionResult $bot): self { $this->container['bot'] = $bot; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -434,12 +417,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -447,13 +427,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -465,30 +442,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/BrowserDetails.php b/src/Model/BrowserDetails.php index f92c3853..d04d9bc8 100644 --- a/src/Model/BrowserDetails.php +++ b/src/Model/BrowserDetails.php @@ -1,17 +1,16 @@ 'string', -'browser_major_version' => 'string', -'browser_full_version' => 'string', -'os' => 'string', -'os_version' => 'string', -'device' => 'string', -'user_agent' => 'string', -'bot_probability' => 'int' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'browser_name' => null, -'browser_major_version' => null, -'browser_full_version' => null, -'os' => null, -'os_version' => null, -'device' => null, -'user_agent' => null, -'bot_probability' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'BrowserDetails'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'browser_name' => 'string', + 'browser_major_version' => 'string', + 'browser_full_version' => 'string', + 'os' => 'string', + 'os_version' => 'string', + 'device' => 'string', + 'user_agent' => 'string', + 'bot_probability' => 'int']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'browser_name' => null, + 'browser_major_version' => null, + 'browser_full_version' => null, + 'os' => null, + 'os_version' => null, + 'device' => null, + 'user_agent' => null, + 'bot_probability' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'browser_name' => 'browserName', -'browser_major_version' => 'browserMajorVersion', -'browser_full_version' => 'browserFullVersion', -'os' => 'os', -'os_version' => 'osVersion', -'device' => 'device', -'user_agent' => 'userAgent', -'bot_probability' => 'botProbability' ]; + 'browser_major_version' => 'browserMajorVersion', + 'browser_full_version' => 'browserFullVersion', + 'os' => 'os', + 'os_version' => 'osVersion', + 'device' => 'device', + 'user_agent' => 'userAgent', + 'bot_probability' => 'botProbability']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'browser_name' => 'setBrowserName', -'browser_major_version' => 'setBrowserMajorVersion', -'browser_full_version' => 'setBrowserFullVersion', -'os' => 'setOs', -'os_version' => 'setOsVersion', -'device' => 'setDevice', -'user_agent' => 'setUserAgent', -'bot_probability' => 'setBotProbability' ]; + 'browser_major_version' => 'setBrowserMajorVersion', + 'browser_full_version' => 'setBrowserFullVersion', + 'os' => 'setOs', + 'os_version' => 'setOsVersion', + 'device' => 'setDevice', + 'user_agent' => 'setUserAgent', + 'bot_probability' => 'setBotProbability']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'browser_name' => 'getBrowserName', -'browser_major_version' => 'getBrowserMajorVersion', -'browser_full_version' => 'getBrowserFullVersion', -'os' => 'getOs', -'os_version' => 'getOsVersion', -'device' => 'getDevice', -'user_agent' => 'getUserAgent', -'bot_probability' => 'getBotProbability' ]; + 'browser_major_version' => 'getBrowserMajorVersion', + 'browser_full_version' => 'getBrowserFullVersion', + 'os' => 'getOs', + 'os_version' => 'getOsVersion', + 'device' => 'getDevice', + 'user_agent' => 'getUserAgent', + 'bot_probability' => 'getBotProbability']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] */ - public static function attributeMap() + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['browser_name'] = isset($data['browser_name']) ? $data['browser_name'] : null; + $this->container['browser_major_version'] = isset($data['browser_major_version']) ? $data['browser_major_version'] : null; + $this->container['browser_full_version'] = isset($data['browser_full_version']) ? $data['browser_full_version'] : null; + $this->container['os'] = isset($data['os']) ? $data['os'] : null; + $this->container['os_version'] = isset($data['os_version']) ? $data['os_version'] : null; + $this->container['device'] = isset($data['device']) ? $data['device'] : null; + $this->container['user_agent'] = isset($data['user_agent']) ? $data['user_agent'] : null; + $this->container['bot_probability'] = isset($data['bot_probability']) ? $data['bot_probability'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; } - + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to getter functions (for serialization of requests). */ - protected $container = []; + public static function getters(): array + { + return self::$getters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * The original name of the model. */ - public function __construct(array $data = null) + public function getModelName(): string { - $this->container['browser_name'] = isset($data['browser_name']) ? $data['browser_name'] : null; - $this->container['browser_major_version'] = isset($data['browser_major_version']) ? $data['browser_major_version'] : null; - $this->container['browser_full_version'] = isset($data['browser_full_version']) ? $data['browser_full_version'] : null; - $this->container['os'] = isset($data['os']) ? $data['os'] : null; - $this->container['os_version'] = isset($data['os_version']) ? $data['os_version'] : null; - $this->container['device'] = isset($data['device']) ? $data['device'] : null; - $this->container['user_agent'] = isset($data['user_agent']) ? $data['user_agent'] : null; - $this->container['bot_probability'] = isset($data['bot_probability']) ? $data['bot_probability'] : null; + return self::$swaggerModelName; } /** @@ -219,64 +215,62 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['browser_name'] === null) { + if (null === $this->container['browser_name']) { $invalidProperties[] = "'browser_name' can't be null"; } - if ($this->container['browser_major_version'] === null) { + if (null === $this->container['browser_major_version']) { $invalidProperties[] = "'browser_major_version' can't be null"; } - if ($this->container['browser_full_version'] === null) { + if (null === $this->container['browser_full_version']) { $invalidProperties[] = "'browser_full_version' can't be null"; } - if ($this->container['os'] === null) { + if (null === $this->container['os']) { $invalidProperties[] = "'os' can't be null"; } - if ($this->container['os_version'] === null) { + if (null === $this->container['os_version']) { $invalidProperties[] = "'os_version' can't be null"; } - if ($this->container['device'] === null) { + if (null === $this->container['device']) { $invalidProperties[] = "'device' can't be null"; } - if ($this->container['user_agent'] === null) { + if (null === $this->container['user_agent']) { $invalidProperties[] = "'user_agent' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets browser_name - * - * @return string + * Gets browser_name. */ - public function getBrowserName() + public function getBrowserName(): string { return $this->container['browser_name']; } /** - * Sets browser_name + * Sets browser_name. * * @param string $browser_name browser_name * * @return $this */ - public function setBrowserName($browser_name) + public function setBrowserName(string $browser_name): self { $this->container['browser_name'] = $browser_name; @@ -284,23 +278,21 @@ public function setBrowserName($browser_name) } /** - * Gets browser_major_version - * - * @return string + * Gets browser_major_version. */ - public function getBrowserMajorVersion() + public function getBrowserMajorVersion(): string { return $this->container['browser_major_version']; } /** - * Sets browser_major_version + * Sets browser_major_version. * * @param string $browser_major_version browser_major_version * * @return $this */ - public function setBrowserMajorVersion($browser_major_version) + public function setBrowserMajorVersion(string $browser_major_version): self { $this->container['browser_major_version'] = $browser_major_version; @@ -308,23 +300,21 @@ public function setBrowserMajorVersion($browser_major_version) } /** - * Gets browser_full_version - * - * @return string + * Gets browser_full_version. */ - public function getBrowserFullVersion() + public function getBrowserFullVersion(): string { return $this->container['browser_full_version']; } /** - * Sets browser_full_version + * Sets browser_full_version. * * @param string $browser_full_version browser_full_version * * @return $this */ - public function setBrowserFullVersion($browser_full_version) + public function setBrowserFullVersion(string $browser_full_version): self { $this->container['browser_full_version'] = $browser_full_version; @@ -332,23 +322,21 @@ public function setBrowserFullVersion($browser_full_version) } /** - * Gets os - * - * @return string + * Gets os. */ - public function getOs() + public function getOs(): string { return $this->container['os']; } /** - * Sets os + * Sets os. * * @param string $os os * * @return $this */ - public function setOs($os) + public function setOs(string $os): self { $this->container['os'] = $os; @@ -356,23 +344,21 @@ public function setOs($os) } /** - * Gets os_version - * - * @return string + * Gets os_version. */ - public function getOsVersion() + public function getOsVersion(): string { return $this->container['os_version']; } /** - * Sets os_version + * Sets os_version. * * @param string $os_version os_version * * @return $this */ - public function setOsVersion($os_version) + public function setOsVersion(string $os_version): self { $this->container['os_version'] = $os_version; @@ -380,23 +366,21 @@ public function setOsVersion($os_version) } /** - * Gets device - * - * @return string + * Gets device. */ - public function getDevice() + public function getDevice(): string { return $this->container['device']; } /** - * Sets device + * Sets device. * * @param string $device device * * @return $this */ - public function setDevice($device) + public function setDevice(string $device): self { $this->container['device'] = $device; @@ -404,23 +388,21 @@ public function setDevice($device) } /** - * Gets user_agent - * - * @return string + * Gets user_agent. */ - public function getUserAgent() + public function getUserAgent(): string { return $this->container['user_agent']; } /** - * Sets user_agent + * Sets user_agent. * * @param string $user_agent user_agent * * @return $this */ - public function setUserAgent($user_agent) + public function setUserAgent(string $user_agent): self { $this->container['user_agent'] = $user_agent; @@ -428,37 +410,35 @@ public function setUserAgent($user_agent) } /** - * Gets bot_probability + * Gets bot_probability. * - * @return int + * @return ?int */ - public function getBotProbability() + public function getBotProbability(): ?int { return $this->container['bot_probability']; } /** - * Sets bot_probability + * Sets bot_probability. * - * @param int $bot_probability bot_probability + * @param ?int $bot_probability bot_probability * * @return $this */ - public function setBotProbability($bot_probability) + public function setBotProbability(?int $bot_probability): self { $this->container['bot_probability'] = $bot_probability; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -466,12 +446,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -479,13 +456,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -497,30 +471,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/ClonedAppResult.php b/src/Model/ClonedAppResult.php index 506d0e11..61fd7c2d 100644 --- a/src/Model/ClonedAppResult.php +++ b/src/Model/ClonedAppResult.php @@ -1,17 +1,16 @@ 'bool' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'ClonedAppResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'bool']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'result' => 'result' ]; + protected static array $attributeMap = [ + 'result' => 'result']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'result' => 'setResult' ]; + protected static array $setters = [ + 'result' => 'setResult']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'result' => 'getResult' ]; + protected static array $getters = [ + 'result' => 'getResult']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,60 +173,56 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return bool + * Gets result. */ - public function getResult() + public function getResult(): bool { return $this->container['result']; } /** - * Sets result + * Sets result. * * @param bool $result Android specific cloned application detection. There are 2 values: • `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). • `false` - No signs of cloned application detected or the client is not Android. * * @return $this */ - public function setResult($result) + public function setResult(bool $result): self { $this->container['result'] = $result; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -238,12 +230,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -251,13 +240,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -269,30 +255,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/ErrorEvent403ResponseError.php b/src/Model/Common403ErrorResponse.php similarity index 58% rename from src/Model/ErrorEvent403ResponseError.php rename to src/Model/Common403ErrorResponse.php index deba9368..f8e5fd06 100644 --- a/src/Model/ErrorEvent403ResponseError.php +++ b/src/Model/Common403ErrorResponse.php @@ -1,17 +1,16 @@ 'string', -'message' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'code' => null, -'message' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'Common403ErrorResponse'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'code' => 'string', + 'message' => 'string']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'code' => null, + 'message' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'code' => 'code', -'message' => 'message' ]; + 'message' => 'message']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'code' => 'setCode', -'message' => 'setMessage' ]; + 'message' => 'setMessage']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'code' => 'getCode', -'message' => 'getMessage' ]; + 'message' => 'getMessage']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; } - const CODE_TOKEN_REQUIRED = 'TokenRequired'; -const CODE_TOKEN_NOT_FOUND = 'TokenNotFound'; -const CODE_SUBSCRIPTION_NOT_ACTIVE = 'SubscriptionNotActive'; -const CODE_WRONG_REGION = 'WrongRegion'; + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } /** - * Gets allowable values of the enum - * - * @return string[] + * Array of attributes to getter functions (for serialization of requests). */ - public function getCodeAllowableValues() + public static function getters(): array { - return [ - self::CODE_TOKEN_REQUIRED, -self::CODE_TOKEN_NOT_FOUND, -self::CODE_SUBSCRIPTION_NOT_ACTIVE, -self::CODE_WRONG_REGION, ]; + return self::$getters; } /** - * Associative array for storing property values - * - * @var mixed[] + * The original name of the model. */ - protected $container = []; + public function getModelName(): string + { + return self::$swaggerModelName; + } /** - * Constructor + * Gets allowable values of the enum. * - * @param mixed[] $data Associated array of property values - * initializing the model + * @return string[] */ - public function __construct(array $data = null) + public function getCodeAllowableValues(): array { - $this->container['code'] = isset($data['code']) ? $data['code'] : null; - $this->container['message'] = isset($data['message']) ? $data['message'] : null; + return [ + self::CODE_TOKEN_REQUIRED, + self::CODE_TOKEN_NOT_FOUND, + self::CODE_SUBSCRIPTION_NOT_ACTIVE, + self::CODE_WRONG_REGION, + self::CODE_FEATURE_NOT_ENABLED, ]; } /** @@ -200,11 +200,11 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['code'] === null) { + if (null === $this->container['code']) { $invalidProperties[] = "'code' can't be null"; } $allowedValues = $this->getCodeAllowableValues(); @@ -215,42 +215,40 @@ public function listInvalidProperties() ); } - if ($this->container['message'] === null) { + if (null === $this->container['message']) { $invalidProperties[] = "'message' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets code - * - * @return string + * Gets code. */ - public function getCode() + public function getCode(): string { return $this->container['code']; } /** - * Sets code + * Sets code. * - * @param string $code Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - subscription not found for specified secret key * `SubscriptionNotActive` - subscription is not active * `WrongRegion` - server and subscription region differ + * @param string $code Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - No Fingerprint application found for specified secret key * `SubscriptionNotActive` - Fingerprint application is not active * `WrongRegion` - server and application region differ * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application * * @return $this */ - public function setCode($code) + public function setCode(string $code): self { $allowedValues = $this->getCodeAllowableValues(); if (!in_array($code, $allowedValues, true)) { @@ -267,37 +265,33 @@ public function setCode($code) } /** - * Gets message - * - * @return string + * Gets message. */ - public function getMessage() + public function getMessage(): string { return $this->container['message']; } /** - * Sets message + * Sets message. * * @param string $message message * * @return $this */ - public function setMessage($message) + public function setMessage(string $message): self { $this->container['message'] = $message; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -305,12 +299,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -318,13 +309,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -336,30 +324,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/Confidence.php b/src/Model/Confidence.php index 8d429199..9aeb20db 100644 --- a/src/Model/Confidence.php +++ b/src/Model/Confidence.php @@ -1,17 +1,16 @@ 'float' ]; - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'score' => 'float' ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'Confidence'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'score' => 'float', + 'revision' => 'string']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'score' => 'float', + 'revision' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'score' => 'score' ]; + protected static array $attributeMap = [ + 'score' => 'score', + 'revision' => 'revision']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'score' => 'setScore' ]; + protected static array $setters = [ + 'score' => 'setScore', + 'revision' => 'setRevision']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'score' => 'getScore' ]; + protected static array $getters = [ + 'score' => 'getScore', + 'revision' => 'getRevision']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['score'] = isset($data['score']) ? $data['score'] : null; + $this->container['revision'] = isset($data['revision']) ? $data['revision'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['score'] = isset($data['score']) ? $data['score'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,60 +179,80 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['score'] === null) { + if (null === $this->container['score']) { $invalidProperties[] = "'score' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets score - * - * @return float + * Gets score. */ - public function getScore() + public function getScore(): float { return $this->container['score']; } /** - * Sets score + * Sets score. * - * @param float $score The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. + * @param float $score the confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification * * @return $this */ - public function setScore($score) + public function setScore(float $score): self { $this->container['score'] = $score; return $this; } + /** - * Returns true if offset exists. False otherwise. + * Gets revision. + * + * @return ?string + */ + public function getRevision(): ?string + { + return $this->container['revision']; + } + + /** + * Sets revision. * - * @param integer $offset Offset + * @param ?string $revision The revision name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. * - * @return boolean + * @return $this + */ + public function setRevision(?string $revision): self + { + $this->container['revision'] = $revision; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -238,12 +260,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -251,13 +270,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -269,30 +285,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/DataCenter.php b/src/Model/DataCenter.php index 2a0fa7ac..1b8c9294 100644 --- a/src/Model/DataCenter.php +++ b/src/Model/DataCenter.php @@ -1,17 +1,16 @@ 'bool', -'name' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null, -'name' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'DataCenter'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'bool', + 'name' => 'string']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null, + 'name' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'result' => 'result', -'name' => 'name' ]; + 'name' => 'name']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'result' => 'setResult', -'name' => 'setName' ]; + 'name' => 'setName']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'result' => 'getResult', -'name' => 'getName' ]; + 'name' => 'getName']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,46 +179,44 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return bool + * Gets result. */ - public function getResult() + public function getResult(): bool { return $this->container['result']; } /** - * Sets result + * Sets result. * * @param bool $result result * * @return $this */ - public function setResult($result) + public function setResult(bool $result): self { $this->container['result'] = $result; @@ -230,37 +224,35 @@ public function setResult($result) } /** - * Gets name + * Gets name. * - * @return string + * @return ?string */ - public function getName() + public function getName(): ?string { return $this->container['name']; } /** - * Sets name + * Sets name. * - * @param string $name name + * @param ?string $name name * * @return $this */ - public function setName($name) + public function setName(?string $name): self { $this->container['name'] = $name; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -268,12 +260,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -281,13 +270,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -299,30 +285,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/DeprecatedIPLocation.php b/src/Model/DeprecatedIPLocation.php index fffaad63..9739584c 100644 --- a/src/Model/DeprecatedIPLocation.php +++ b/src/Model/DeprecatedIPLocation.php @@ -1,17 +1,16 @@ 'int', -'latitude' => 'double', -'longitude' => 'double', -'postal_code' => 'string', -'timezone' => 'string', -'city' => '\Fingerprint\ServerAPI\Model\DeprecatedIPLocationCity', -'country' => '\Fingerprint\ServerAPI\Model\Location', -'continent' => '\Fingerprint\ServerAPI\Model\Location', -'subdivisions' => '\Fingerprint\ServerAPI\Model\Subdivision[]' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'accuracy_radius' => null, -'latitude' => 'double', -'longitude' => 'double', -'postal_code' => null, -'timezone' => 'timezone', -'city' => null, -'country' => null, -'continent' => null, -'subdivisions' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'DeprecatedIPLocation'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'accuracy_radius' => 'int', + 'latitude' => 'double', + 'longitude' => 'double', + 'postal_code' => 'string', + 'timezone' => 'string', + 'city' => '\Fingerprint\ServerAPI\Model\DeprecatedIPLocationCity', + 'country' => '\Fingerprint\ServerAPI\Model\Location', + 'continent' => '\Fingerprint\ServerAPI\Model\Location', + 'subdivisions' => '\Fingerprint\ServerAPI\Model\Subdivision[]']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'accuracy_radius' => null, + 'latitude' => 'double', + 'longitude' => 'double', + 'postal_code' => null, + 'timezone' => 'timezone', + 'city' => null, + 'country' => null, + 'continent' => null, + 'subdivisions' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'accuracy_radius' => 'accuracyRadius', -'latitude' => 'latitude', -'longitude' => 'longitude', -'postal_code' => 'postalCode', -'timezone' => 'timezone', -'city' => 'city', -'country' => 'country', -'continent' => 'continent', -'subdivisions' => 'subdivisions' ]; + 'latitude' => 'latitude', + 'longitude' => 'longitude', + 'postal_code' => 'postalCode', + 'timezone' => 'timezone', + 'city' => 'city', + 'country' => 'country', + 'continent' => 'continent', + 'subdivisions' => 'subdivisions']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'accuracy_radius' => 'setAccuracyRadius', -'latitude' => 'setLatitude', -'longitude' => 'setLongitude', -'postal_code' => 'setPostalCode', -'timezone' => 'setTimezone', -'city' => 'setCity', -'country' => 'setCountry', -'continent' => 'setContinent', -'subdivisions' => 'setSubdivisions' ]; + 'latitude' => 'setLatitude', + 'longitude' => 'setLongitude', + 'postal_code' => 'setPostalCode', + 'timezone' => 'setTimezone', + 'city' => 'setCity', + 'country' => 'setCountry', + 'continent' => 'setContinent', + 'subdivisions' => 'setSubdivisions']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'accuracy_radius' => 'getAccuracyRadius', -'latitude' => 'getLatitude', -'longitude' => 'getLongitude', -'postal_code' => 'getPostalCode', -'timezone' => 'getTimezone', -'city' => 'getCity', -'country' => 'getCountry', -'continent' => 'getContinent', -'subdivisions' => 'getSubdivisions' ]; + 'latitude' => 'getLatitude', + 'longitude' => 'getLongitude', + 'postal_code' => 'getPostalCode', + 'timezone' => 'getTimezone', + 'city' => 'getCity', + 'country' => 'getCountry', + 'continent' => 'getContinent', + 'subdivisions' => 'getSubdivisions']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] */ - public static function attributeMap() + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['accuracy_radius'] = isset($data['accuracy_radius']) ? $data['accuracy_radius'] : null; + $this->container['latitude'] = isset($data['latitude']) ? $data['latitude'] : null; + $this->container['longitude'] = isset($data['longitude']) ? $data['longitude'] : null; + $this->container['postal_code'] = isset($data['postal_code']) ? $data['postal_code'] : null; + $this->container['timezone'] = isset($data['timezone']) ? $data['timezone'] : null; + $this->container['city'] = isset($data['city']) ? $data['city'] : null; + $this->container['country'] = isset($data['country']) ? $data['country'] : null; + $this->container['continent'] = isset($data['continent']) ? $data['continent'] : null; + $this->container['subdivisions'] = isset($data['subdivisions']) ? $data['subdivisions'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['accuracy_radius'] = isset($data['accuracy_radius']) ? $data['accuracy_radius'] : null; - $this->container['latitude'] = isset($data['latitude']) ? $data['latitude'] : null; - $this->container['longitude'] = isset($data['longitude']) ? $data['longitude'] : null; - $this->container['postal_code'] = isset($data['postal_code']) ? $data['postal_code'] : null; - $this->container['timezone'] = isset($data['timezone']) ? $data['timezone'] : null; - $this->container['city'] = isset($data['city']) ? $data['city'] : null; - $this->container['country'] = isset($data['country']) ? $data['country'] : null; - $this->container['continent'] = isset($data['continent']) ? $data['continent'] : null; - $this->container['subdivisions'] = isset($data['subdivisions']) ? $data['subdivisions'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -226,43 +223,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets accuracy_radius + * Gets accuracy_radius. * - * @return int + * @return ?int */ - public function getAccuracyRadius() + public function getAccuracyRadius(): ?int { return $this->container['accuracy_radius']; } /** - * Sets accuracy_radius + * Sets accuracy_radius. * - * @param int $accuracy_radius The IP address is likely to be within this radius (in km) of the specified location. + * @param ?int $accuracy_radius the IP address is likely to be within this radius (in km) of the specified location * * @return $this */ - public function setAccuracyRadius($accuracy_radius) + public function setAccuracyRadius(?int $accuracy_radius): self { $this->container['accuracy_radius'] = $accuracy_radius; @@ -270,23 +264,23 @@ public function setAccuracyRadius($accuracy_radius) } /** - * Gets latitude + * Gets latitude. * - * @return double + * @return ?double */ - public function getLatitude() + public function getLatitude(): ?float { return $this->container['latitude']; } /** - * Sets latitude + * Sets latitude. * - * @param double $latitude latitude + * @param ?double $latitude latitude * * @return $this */ - public function setLatitude($latitude) + public function setLatitude(?float $latitude): self { $this->container['latitude'] = $latitude; @@ -294,23 +288,23 @@ public function setLatitude($latitude) } /** - * Gets longitude + * Gets longitude. * - * @return double + * @return ?double */ - public function getLongitude() + public function getLongitude(): ?float { return $this->container['longitude']; } /** - * Sets longitude + * Sets longitude. * - * @param double $longitude longitude + * @param ?double $longitude longitude * * @return $this */ - public function setLongitude($longitude) + public function setLongitude(?float $longitude): self { $this->container['longitude'] = $longitude; @@ -318,23 +312,23 @@ public function setLongitude($longitude) } /** - * Gets postal_code + * Gets postal_code. * - * @return string + * @return ?string */ - public function getPostalCode() + public function getPostalCode(): ?string { return $this->container['postal_code']; } /** - * Sets postal_code + * Sets postal_code. * - * @param string $postal_code postal_code + * @param ?string $postal_code postal_code * * @return $this */ - public function setPostalCode($postal_code) + public function setPostalCode(?string $postal_code): self { $this->container['postal_code'] = $postal_code; @@ -342,23 +336,23 @@ public function setPostalCode($postal_code) } /** - * Gets timezone + * Gets timezone. * - * @return string + * @return ?string */ - public function getTimezone() + public function getTimezone(): ?string { return $this->container['timezone']; } /** - * Sets timezone + * Sets timezone. * - * @param string $timezone timezone + * @param ?string $timezone timezone * * @return $this */ - public function setTimezone($timezone) + public function setTimezone(?string $timezone): self { $this->container['timezone'] = $timezone; @@ -366,23 +360,23 @@ public function setTimezone($timezone) } /** - * Gets city + * Gets city. * - * @return \Fingerprint\ServerAPI\Model\DeprecatedIPLocationCity + * @return ?\Fingerprint\ServerAPI\Model\DeprecatedIPLocationCity */ - public function getCity() + public function getCity(): ?DeprecatedIPLocationCity { return $this->container['city']; } /** - * Sets city + * Sets city. * - * @param \Fingerprint\ServerAPI\Model\DeprecatedIPLocationCity $city city + * @param ?\Fingerprint\ServerAPI\Model\DeprecatedIPLocationCity $city city * * @return $this */ - public function setCity($city) + public function setCity(?DeprecatedIPLocationCity $city): self { $this->container['city'] = $city; @@ -390,23 +384,23 @@ public function setCity($city) } /** - * Gets country + * Gets country. * - * @return \Fingerprint\ServerAPI\Model\Location + * @return ?\Fingerprint\ServerAPI\Model\Location */ - public function getCountry() + public function getCountry(): ?Location { return $this->container['country']; } /** - * Sets country + * Sets country. * - * @param \Fingerprint\ServerAPI\Model\Location $country country + * @param ?\Fingerprint\ServerAPI\Model\Location $country country * * @return $this */ - public function setCountry($country) + public function setCountry(?Location $country): self { $this->container['country'] = $country; @@ -414,23 +408,23 @@ public function setCountry($country) } /** - * Gets continent + * Gets continent. * - * @return \Fingerprint\ServerAPI\Model\Location + * @return ?\Fingerprint\ServerAPI\Model\Location */ - public function getContinent() + public function getContinent(): ?Location { return $this->container['continent']; } /** - * Sets continent + * Sets continent. * - * @param \Fingerprint\ServerAPI\Model\Location $continent continent + * @param ?\Fingerprint\ServerAPI\Model\Location $continent continent * * @return $this */ - public function setContinent($continent) + public function setContinent(?Location $continent): self { $this->container['continent'] = $continent; @@ -438,37 +432,35 @@ public function setContinent($continent) } /** - * Gets subdivisions + * Gets subdivisions. * - * @return \Fingerprint\ServerAPI\Model\Subdivision[] + * @return ?\Fingerprint\ServerAPI\Model\Subdivision[] */ - public function getSubdivisions() + public function getSubdivisions(): ?array { return $this->container['subdivisions']; } /** - * Sets subdivisions + * Sets subdivisions. * - * @param \Fingerprint\ServerAPI\Model\Subdivision[] $subdivisions subdivisions + * @param ?\Fingerprint\ServerAPI\Model\Subdivision[] $subdivisions subdivisions * * @return $this */ - public function setSubdivisions($subdivisions) + public function setSubdivisions(?array $subdivisions): self { $this->container['subdivisions'] = $subdivisions; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -476,12 +468,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -489,13 +478,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -507,30 +493,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/DeprecatedIPLocationCity.php b/src/Model/DeprecatedIPLocationCity.php index d297b2e8..fdffb4e1 100644 --- a/src/Model/DeprecatedIPLocationCity.php +++ b/src/Model/DeprecatedIPLocationCity.php @@ -1,17 +1,16 @@ 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'name' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'DeprecatedIPLocationCity'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'name' => 'string']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'name' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'name' => 'name' ]; + protected static array $attributeMap = [ + 'name' => 'name']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'name' => 'setName' ]; + protected static array $setters = [ + 'name' => 'setName']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'name' => 'getName' ]; + protected static array $getters = [ + 'name' => 'getName']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['name'] = isset($data['name']) ? $data['name'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,57 +173,52 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets name + * Gets name. * - * @return string + * @return ?string */ - public function getName() + public function getName(): ?string { return $this->container['name']; } /** - * Sets name + * Sets name. * - * @param string $name name + * @param ?string $name name * * @return $this */ - public function setName($name) + public function setName(?string $name): self { $this->container['name'] = $name; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -235,12 +226,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -248,13 +236,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -266,30 +251,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/DeveloperToolsResult.php b/src/Model/DeveloperToolsResult.php new file mode 100644 index 00000000..2047bf72 --- /dev/null +++ b/src/Model/DeveloperToolsResult.php @@ -0,0 +1,264 @@ + 'bool']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'result' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'result' => 'result']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'result' => 'setResult']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'result' => 'getResult']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['result'] = isset($data['result']) ? $data['result'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['result']) { + $invalidProperties[] = "'result' 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(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets result. + */ + public function getResult(): bool + { + return $this->container['result']; + } + + /** + * Sets result. + * + * @param bool $result `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise + * + * @return $this + */ + public function setResult(bool $result): self + { + $this->container['result'] = $result; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/EmulatorResult.php b/src/Model/EmulatorResult.php index b0a76d67..0a4398fd 100644 --- a/src/Model/EmulatorResult.php +++ b/src/Model/EmulatorResult.php @@ -1,17 +1,16 @@ 'bool' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'EmulatorResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'bool']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'result' => 'result' ]; + protected static array $attributeMap = [ + 'result' => 'result']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'result' => 'setResult' ]; + protected static array $setters = [ + 'result' => 'setResult']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'result' => 'getResult' ]; + protected static array $getters = [ + 'result' => 'getResult']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,60 +173,56 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return bool + * Gets result. */ - public function getResult() + public function getResult(): bool { return $this->container['result']; } /** - * Sets result + * Sets result. * * @param bool $result Android specific emulator detection. There are 2 values: • `true` - Emulated environment detected (e.g. launch inside of AVD) • `false` - No signs of emulated environment detected or the client is not Android. * * @return $this */ - public function setResult($result) + public function setResult(bool $result): self { $this->container['result'] = $result; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -238,12 +230,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -251,13 +240,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -269,30 +255,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/ErrorEvent403Response.php b/src/Model/ErrorCommon403Response.php similarity index 53% rename from src/Model/ErrorEvent403Response.php rename to src/Model/ErrorCommon403Response.php index 8f71b507..1afa5e6e 100644 --- a/src/Model/ErrorEvent403Response.php +++ b/src/Model/ErrorCommon403Response.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\ErrorEvent403ResponseError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'ErrorCommon403Response'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'error' => '\Fingerprint\ServerAPI\Model\Common403ErrorResponse']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'error' => 'error' ]; + protected static array $attributeMap = [ + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'error' => 'setError' ]; + protected static array $setters = [ + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'error' => 'getError' ]; + protected static array $getters = [ + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,57 +173,52 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ErrorEvent403ResponseError + * @return ?\Fingerprint\ServerAPI\Model\Common403ErrorResponse */ - public function getError() + public function getError(): ?Common403ErrorResponse { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ErrorEvent403ResponseError $error error + * @param ?\Fingerprint\ServerAPI\Model\Common403ErrorResponse $error error * * @return $this */ - public function setError($error) + public function setError(?Common403ErrorResponse $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -235,12 +226,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -248,13 +236,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -266,30 +251,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/ErrorCommon429Response.php b/src/Model/ErrorCommon429Response.php new file mode 100644 index 00000000..d2dc070d --- /dev/null +++ b/src/Model/ErrorCommon429Response.php @@ -0,0 +1,260 @@ + '\Fingerprint\ServerAPI\Model\ErrorCommon429ResponseError']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'error' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'error' => 'error']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'error' => 'setError']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'error' => 'getError']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets error. + * + * @return ?\Fingerprint\ServerAPI\Model\ErrorCommon429ResponseError + */ + public function getError(): ?ErrorCommon429ResponseError + { + return $this->container['error']; + } + + /** + * Sets error. + * + * @param ?\Fingerprint\ServerAPI\Model\ErrorCommon429ResponseError $error error + * + * @return $this + */ + public function setError(?ErrorCommon429ResponseError $error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorCommon429ResponseError.php b/src/Model/ErrorCommon429ResponseError.php new file mode 100644 index 00000000..f214c931 --- /dev/null +++ b/src/Model/ErrorCommon429ResponseError.php @@ -0,0 +1,325 @@ + 'string', + 'message' => 'string']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'code' => null, + 'message' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'message' => 'message']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Gets allowable values of the enum. + * + * @return string[] + */ + public function getCodeAllowableValues(): array + { + return [ + self::CODE_TOO_MANY_REQUESTS, ]; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['code']) { + $invalidProperties[] = "'code' can't be null"; + } + $allowedValues = $this->getCodeAllowableValues(); + if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if (null === $this->container['message']) { + $invalidProperties[] = "'message' 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(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets code. + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code. + * + * @param string $code error code: * `TooManyRequests` - The request is throttled + * + * @return $this + */ + public function setCode(string $code): self + { + $allowedValues = $this->getCodeAllowableValues(); + if (!in_array($code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message. + */ + public function getMessage(): string + { + return $this->container['message']; + } + + /** + * Sets message. + * + * @param string $message message + * + * @return $this + */ + public function setMessage(string $message): self + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorEvent404Response.php b/src/Model/ErrorEvent404Response.php index c7803054..b03ce283 100644 --- a/src/Model/ErrorEvent404Response.php +++ b/src/Model/ErrorEvent404Response.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\ErrorEvent404ResponseError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'ErrorEvent404Response'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'error' => '\Fingerprint\ServerAPI\Model\ErrorEvent404ResponseError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'error' => 'error' ]; + protected static array $attributeMap = [ + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'error' => 'setError' ]; + protected static array $setters = [ + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'error' => 'getError' ]; + protected static array $getters = [ + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,57 +173,52 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ErrorEvent404ResponseError + * @return ?\Fingerprint\ServerAPI\Model\ErrorEvent404ResponseError */ - public function getError() + public function getError(): ?ErrorEvent404ResponseError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ErrorEvent404ResponseError $error error + * @param ?\Fingerprint\ServerAPI\Model\ErrorEvent404ResponseError $error error * * @return $this */ - public function setError($error) + public function setError(?ErrorEvent404ResponseError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -235,12 +226,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -248,13 +236,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -266,30 +251,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/ErrorEvent404ResponseError.php b/src/Model/ErrorEvent404ResponseError.php index b6b14968..0337f0bd 100644 --- a/src/Model/ErrorEvent404ResponseError.php +++ b/src/Model/ErrorEvent404ResponseError.php @@ -1,17 +1,16 @@ 'string', -'message' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'code' => null, -'message' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'ErrorEvent404ResponseError'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'code' => 'string', + 'message' => 'string']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'code' => null, + 'message' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'code' => 'code', -'message' => 'message' ]; + 'message' => 'message']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'code' => 'setCode', -'message' => 'setMessage' ]; + 'message' => 'setMessage']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'code' => 'getCode', -'message' => 'getMessage' ]; + 'message' => 'getMessage']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; } - const CODE_REQUEST_NOT_FOUND = 'RequestNotFound'; + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } /** - * Gets allowable values of the enum - * - * @return string[] + * Array of attributes to getter functions (for serialization of requests). */ - public function getCodeAllowableValues() + public static function getters(): array { - return [ - self::CODE_REQUEST_NOT_FOUND, ]; + return self::$getters; } /** - * Associative array for storing property values - * - * @var mixed[] + * The original name of the model. */ - protected $container = []; + public function getModelName(): string + { + return self::$swaggerModelName; + } /** - * Constructor + * Gets allowable values of the enum. * - * @param mixed[] $data Associated array of property values - * initializing the model + * @return string[] */ - public function __construct(array $data = null) + public function getCodeAllowableValues(): array { - $this->container['code'] = isset($data['code']) ? $data['code'] : null; - $this->container['message'] = isset($data['message']) ? $data['message'] : null; + return [ + self::CODE_REQUEST_NOT_FOUND, ]; } /** @@ -194,11 +192,11 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['code'] === null) { + if (null === $this->container['code']) { $invalidProperties[] = "'code' can't be null"; } $allowedValues = $this->getCodeAllowableValues(); @@ -209,42 +207,40 @@ public function listInvalidProperties() ); } - if ($this->container['message'] === null) { + if (null === $this->container['message']) { $invalidProperties[] = "'message' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets code - * - * @return string + * Gets code. */ - public function getCode() + public function getCode(): string { return $this->container['code']; } /** - * Sets code + * Sets code. * - * @param string $code Error code: * `RequestNotFound` - request not found for specified id + * @param string $code Error code: * `RequestNotFound` - The specified request ID was not found. It never existed, expired, or it has been deleted. * * @return $this */ - public function setCode($code) + public function setCode(string $code): self { $allowedValues = $this->getCodeAllowableValues(); if (!in_array($code, $allowedValues, true)) { @@ -261,37 +257,33 @@ public function setCode($code) } /** - * Gets message - * - * @return string + * Gets message. */ - public function getMessage() + public function getMessage(): string { return $this->container['message']; } /** - * Sets message + * Sets message. * * @param string $message message * * @return $this */ - public function setMessage($message) + public function setMessage(string $message): self { $this->container['message'] = $message; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -299,12 +291,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -312,13 +301,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -330,30 +316,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/ErrorUpdateEvent400Response.php b/src/Model/ErrorUpdateEvent400Response.php new file mode 100644 index 00000000..06737e39 --- /dev/null +++ b/src/Model/ErrorUpdateEvent400Response.php @@ -0,0 +1,260 @@ + '\Fingerprint\ServerAPI\Model\ErrorUpdateEvent400ResponseError']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'error' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'error' => 'error']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'error' => 'setError']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'error' => 'getError']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets error. + * + * @return ?\Fingerprint\ServerAPI\Model\ErrorUpdateEvent400ResponseError + */ + public function getError(): ?ErrorUpdateEvent400ResponseError + { + return $this->container['error']; + } + + /** + * Sets error. + * + * @param ?\Fingerprint\ServerAPI\Model\ErrorUpdateEvent400ResponseError $error error + * + * @return $this + */ + public function setError(?ErrorUpdateEvent400ResponseError $error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorUpdateEvent400ResponseError.php b/src/Model/ErrorUpdateEvent400ResponseError.php new file mode 100644 index 00000000..ec5eedb8 --- /dev/null +++ b/src/Model/ErrorUpdateEvent400ResponseError.php @@ -0,0 +1,327 @@ + 'string', + 'message' => 'string']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'code' => null, + 'message' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'message' => 'message']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Gets allowable values of the enum. + * + * @return string[] + */ + public function getCodeAllowableValues(): array + { + return [ + self::CODE_REQUEST_CANNOT_BE_PARSED, + self::CODE_FAILED, ]; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['code']) { + $invalidProperties[] = "'code' can't be null"; + } + $allowedValues = $this->getCodeAllowableValues(); + if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if (null === $this->container['message']) { + $invalidProperties[] = "'message' 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(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets code. + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code. + * + * @param string $code Error code: * `RequestCannotBeParsed` - the JSON content of the request contains some errors that prevented us from parsing it (wrong type/surpassed limits) * `Failed` - the event is more than 10 days old and cannot be updated + * + * @return $this + */ + public function setCode(string $code): self + { + $allowedValues = $this->getCodeAllowableValues(); + if (!in_array($code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message. + */ + public function getMessage(): string + { + return $this->container['message']; + } + + /** + * Sets message. + * + * @param string $message Details about the underlying issue with the input payload + * + * @return $this + */ + public function setMessage(string $message): self + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorUpdateEvent409Response.php b/src/Model/ErrorUpdateEvent409Response.php new file mode 100644 index 00000000..5e1a0590 --- /dev/null +++ b/src/Model/ErrorUpdateEvent409Response.php @@ -0,0 +1,260 @@ + '\Fingerprint\ServerAPI\Model\ErrorUpdateEvent409ResponseError']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'error' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'error' => 'error']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'error' => 'setError']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'error' => 'getError']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets error. + * + * @return ?\Fingerprint\ServerAPI\Model\ErrorUpdateEvent409ResponseError + */ + public function getError(): ?ErrorUpdateEvent409ResponseError + { + return $this->container['error']; + } + + /** + * Sets error. + * + * @param ?\Fingerprint\ServerAPI\Model\ErrorUpdateEvent409ResponseError $error error + * + * @return $this + */ + public function setError(?ErrorUpdateEvent409ResponseError $error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorUpdateEvent409ResponseError.php b/src/Model/ErrorUpdateEvent409ResponseError.php new file mode 100644 index 00000000..7104bb91 --- /dev/null +++ b/src/Model/ErrorUpdateEvent409ResponseError.php @@ -0,0 +1,325 @@ + 'string', + 'message' => 'string']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'code' => null, + 'message' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'message' => 'message']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Gets allowable values of the enum. + * + * @return string[] + */ + public function getCodeAllowableValues(): array + { + return [ + self::CODE_STATE_NOT_READY, ]; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['code']) { + $invalidProperties[] = "'code' can't be null"; + } + $allowedValues = $this->getCodeAllowableValues(); + if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if (null === $this->container['message']) { + $invalidProperties[] = "'message' 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(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets code. + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code. + * + * @param string $code Error code: * `StateNotReady` - The event specified with request id is not ready for updates yet. Try again. This error happens in rare cases when update API is called immediately after receiving the request id on the client. In case you need to send information right away, we recommend using the JS agent API instead. + * + * @return $this + */ + public function setCode(string $code): self + { + $allowedValues = $this->getCodeAllowableValues(); + if (!in_array($code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message. + */ + public function getMessage(): string + { + return $this->container['message']; + } + + /** + * Sets message. + * + * @param string $message message + * + * @return $this + */ + public function setMessage(string $message): self + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorVisitor400Response.php b/src/Model/ErrorVisitor400Response.php new file mode 100644 index 00000000..8add5b42 --- /dev/null +++ b/src/Model/ErrorVisitor400Response.php @@ -0,0 +1,260 @@ + '\Fingerprint\ServerAPI\Model\ErrorVisitor400ResponseError']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'error' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'error' => 'error']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'error' => 'setError']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'error' => 'getError']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets error. + * + * @return ?\Fingerprint\ServerAPI\Model\ErrorVisitor400ResponseError + */ + public function getError(): ?ErrorVisitor400ResponseError + { + return $this->container['error']; + } + + /** + * Sets error. + * + * @param ?\Fingerprint\ServerAPI\Model\ErrorVisitor400ResponseError $error error + * + * @return $this + */ + public function setError(?ErrorVisitor400ResponseError $error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorVisitor400ResponseError.php b/src/Model/ErrorVisitor400ResponseError.php new file mode 100644 index 00000000..f3a7511d --- /dev/null +++ b/src/Model/ErrorVisitor400ResponseError.php @@ -0,0 +1,325 @@ + 'string', + 'message' => 'string']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'code' => null, + 'message' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'message' => 'message']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Gets allowable values of the enum. + * + * @return string[] + */ + public function getCodeAllowableValues(): array + { + return [ + self::CODE_REQUEST_CANNOT_BE_PARSED, ]; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['code']) { + $invalidProperties[] = "'code' can't be null"; + } + $allowedValues = $this->getCodeAllowableValues(); + if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if (null === $this->container['message']) { + $invalidProperties[] = "'message' 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(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets code. + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code. + * + * @param string $code error code: * `RequestCannotBeParsed` - The visitor ID parameter is missing or in the wrong format + * + * @return $this + */ + public function setCode(string $code): self + { + $allowedValues = $this->getCodeAllowableValues(); + if (!in_array($code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message. + */ + public function getMessage(): string + { + return $this->container['message']; + } + + /** + * Sets message. + * + * @param string $message message + * + * @return $this + */ + public function setMessage(string $message): self + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorVisitor404Response.php b/src/Model/ErrorVisitor404Response.php new file mode 100644 index 00000000..d0eac080 --- /dev/null +++ b/src/Model/ErrorVisitor404Response.php @@ -0,0 +1,260 @@ + '\Fingerprint\ServerAPI\Model\ErrorVisitor404ResponseError']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'error' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'error' => 'error']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'error' => 'setError']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'error' => 'getError']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets error. + * + * @return ?\Fingerprint\ServerAPI\Model\ErrorVisitor404ResponseError + */ + public function getError(): ?ErrorVisitor404ResponseError + { + return $this->container['error']; + } + + /** + * Sets error. + * + * @param ?\Fingerprint\ServerAPI\Model\ErrorVisitor404ResponseError $error error + * + * @return $this + */ + public function setError(?ErrorVisitor404ResponseError $error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorVisitor404ResponseError.php b/src/Model/ErrorVisitor404ResponseError.php new file mode 100644 index 00000000..6365d384 --- /dev/null +++ b/src/Model/ErrorVisitor404ResponseError.php @@ -0,0 +1,325 @@ + 'string', + 'message' => 'string']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'code' => null, + 'message' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'message' => 'message']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Gets allowable values of the enum. + * + * @return string[] + */ + public function getCodeAllowableValues(): array + { + return [ + self::CODE_VISITOR_NOT_FOUND, ]; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['code']) { + $invalidProperties[] = "'code' can't be null"; + } + $allowedValues = $this->getCodeAllowableValues(); + if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if (null === $this->container['message']) { + $invalidProperties[] = "'message' 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(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets code. + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code. + * + * @param string $code Error code: * `VisitorNotFound` - The specified visitor ID was not found. It never existed or it may have already been deleted. + * + * @return $this + */ + public function setCode(string $code): self + { + $allowedValues = $this->getCodeAllowableValues(); + if (!in_array($code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message. + */ + public function getMessage(): string + { + return $this->container['message']; + } + + /** + * Sets message. + * + * @param string $message message + * + * @return $this + */ + public function setMessage(string $message): self + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorVisits403.php b/src/Model/ErrorVisits403.php index 46826318..297998f3 100644 --- a/src/Model/ErrorVisits403.php +++ b/src/Model/ErrorVisits403.php @@ -1,17 +1,16 @@ 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'ErrorVisits403'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'error' => 'string']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'error' => 'error' ]; + protected static array $attributeMap = [ + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'error' => 'setError' ]; + protected static array $setters = [ + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'error' => 'getError' ]; + protected static array $getters = [ + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,60 +173,56 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['error'] === null) { + if (null === $this->container['error']) { $invalidProperties[] = "'error' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets error - * - * @return string + * Gets error. */ - public function getError() + public function getError(): string { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param string $error Error text. + * @param string $error error text * * @return $this */ - public function setError($error) + public function setError(string $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -238,12 +230,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -251,13 +240,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -269,30 +255,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/EventResponse.php b/src/Model/EventResponse.php index eabe5e08..ee5b3fbe 100644 --- a/src/Model/EventResponse.php +++ b/src/Model/EventResponse.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\ProductsResponse', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'products' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'EventResponse'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'products' => '\Fingerprint\ServerAPI\Model\ProductsResponse', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'products' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'products' => 'products', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'products' => 'setProducts', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'products' => 'getProducts', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] */ - public static function attributeMap() + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['products'] = isset($data['products']) ? $data['products'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['products'] = isset($data['products']) ? $data['products'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -184,46 +181,44 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['products'] === null) { + if (null === $this->container['products']) { $invalidProperties[] = "'products' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets products - * - * @return \Fingerprint\ServerAPI\Model\ProductsResponse + * Gets products. */ - public function getProducts() + public function getProducts(): ProductsResponse { return $this->container['products']; } /** - * Sets products + * Sets products. * - * @param \Fingerprint\ServerAPI\Model\ProductsResponse $products products + * @param ProductsResponse $products products * * @return $this */ - public function setProducts($products) + public function setProducts(ProductsResponse $products): self { $this->container['products'] = $products; @@ -231,37 +226,35 @@ public function setProducts($products) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -269,12 +262,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -282,13 +272,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -300,30 +287,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/EventUpdateRequest.php b/src/Model/EventUpdateRequest.php new file mode 100644 index 00000000..ebcd6941 --- /dev/null +++ b/src/Model/EventUpdateRequest.php @@ -0,0 +1,320 @@ + 'string', + 'tag' => 'object', + 'suspect' => 'bool']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'linked_id' => null, + 'tag' => null, + 'suspect' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'linked_id' => 'linkedId', + 'tag' => 'tag', + 'suspect' => 'suspect']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'linked_id' => 'setLinkedId', + 'tag' => 'setTag', + 'suspect' => 'setSuspect']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'linked_id' => 'getLinkedId', + 'tag' => 'getTag', + 'suspect' => 'getSuspect']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['linked_id'] = isset($data['linked_id']) ? $data['linked_id'] : null; + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + $this->container['suspect'] = isset($data['suspect']) ? $data['suspect'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets linked_id. + * + * @return ?string + */ + public function getLinkedId(): ?string + { + return $this->container['linked_id']; + } + + /** + * Sets linked_id. + * + * @param ?string $linked_id LinkedID value to assign to the existing event + * + * @return $this + */ + public function setLinkedId(?string $linked_id): self + { + $this->container['linked_id'] = $linked_id; + + return $this; + } + + /** + * Gets tag. + * + * @return ?object + */ + public function getTag(): ?object + { + return $this->container['tag']; + } + + /** + * Sets tag. + * + * @param ?object $tag Full `tag` value to be set to the existing event. Replaces any existing `tag` payload completely. + * + * @return $this + */ + public function setTag(?object $tag): self + { + $this->container['tag'] = $tag; + + return $this; + } + + /** + * Gets suspect. + * + * @return ?bool + */ + public function getSuspect(): ?bool + { + return $this->container['suspect']; + } + + /** + * Sets suspect. + * + * @param ?bool $suspect Suspect flag indicating observed suspicious or fraudulent event + * + * @return $this + */ + public function setSuspect(?bool $suspect): self + { + $this->container['suspect'] = $suspect; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/FactoryResetResult.php b/src/Model/FactoryResetResult.php index 8faeac68..8d6872fa 100644 --- a/src/Model/FactoryResetResult.php +++ b/src/Model/FactoryResetResult.php @@ -1,17 +1,16 @@ '\DateTime', -'timestamp' => 'int' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'time' => 'date-time', -'timestamp' => 'int64' ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'FactoryResetResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'time' => '\DateTime', + 'timestamp' => 'int']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'time' => 'date-time', + 'timestamp' => 'int64']; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'time' => 'time', -'timestamp' => 'timestamp' ]; + 'timestamp' => 'timestamp']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'time' => 'setTime', -'timestamp' => 'setTimestamp' ]; + 'timestamp' => 'setTimestamp']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'time' => 'getTime', -'timestamp' => 'getTimestamp' ]; + 'timestamp' => 'getTimestamp']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['time'] = isset($data['time']) ? $data['time'] : null; + $this->container['timestamp'] = isset($data['timestamp']) ? $data['timestamp'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['time'] = isset($data['time']) ? $data['time'] : null; - $this->container['timestamp'] = isset($data['timestamp']) ? $data['timestamp'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,49 +179,47 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['time'] === null) { + if (null === $this->container['time']) { $invalidProperties[] = "'time' can't be null"; } - if ($this->container['timestamp'] === null) { + if (null === $this->container['timestamp']) { $invalidProperties[] = "'timestamp' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets time - * - * @return \DateTime + * Gets time. */ - public function getTime() + public function getTime(): \DateTime { return $this->container['time']; } /** - * Sets time + * Sets time. * - * @param \DateTime $time Time in UTC when the most recent factory reset of the Android or iOS device was done. If there is no sign of factory reset or the client is not a mobile device, the field will contain the epoch time (1 January 1970) in UTC. + * @param \DateTime $time Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. * * @return $this */ - public function setTime($time) + public function setTime(\DateTime $time): self { $this->container['time'] = $time; @@ -233,37 +227,33 @@ public function setTime($time) } /** - * Gets timestamp - * - * @return int + * Gets timestamp. */ - public function getTimestamp() + public function getTimestamp(): int { return $this->container['timestamp']; } /** - * Sets timestamp + * Sets timestamp. * - * @param int $timestamp Same value as it's in the `time` field but represented in timestamp format. + * @param int $timestamp This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. * * @return $this */ - public function setTimestamp($timestamp) + public function setTimestamp(int $timestamp): self { $this->container['timestamp'] = $timestamp; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -271,12 +261,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -284,13 +271,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -302,30 +286,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/FridaResult.php b/src/Model/FridaResult.php index 48b7de01..ad511bad 100644 --- a/src/Model/FridaResult.php +++ b/src/Model/FridaResult.php @@ -1,17 +1,16 @@ 'bool' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'FridaResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'bool']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'result' => 'result' ]; + protected static array $attributeMap = [ + 'result' => 'result']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'result' => 'setResult' ]; + protected static array $setters = [ + 'result' => 'setResult']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'result' => 'getResult' ]; + protected static array $getters = [ + 'result' => 'getResult']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,60 +173,56 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return bool + * Gets result. */ - public function getResult() + public function getResult(): bool { return $this->container['result']; } /** - * Sets result + * Sets result. * * @param bool $result [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: • `true` - Frida detected • `false` - No signs of Frida or the client is not a mobile device. * * @return $this */ - public function setResult($result) + public function setResult(bool $result): self { $this->container['result'] = $result; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -238,12 +230,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -251,13 +240,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -269,30 +255,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/HighActivityResult.php b/src/Model/HighActivityResult.php index b7ebca8b..20879925 100644 --- a/src/Model/HighActivityResult.php +++ b/src/Model/HighActivityResult.php @@ -1,17 +1,16 @@ 'bool', -'daily_requests' => 'float' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null, -'daily_requests' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'HighActivityResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'bool', + 'daily_requests' => 'float']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null, + 'daily_requests' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'result' => 'result', -'daily_requests' => 'dailyRequests' ]; + 'daily_requests' => 'dailyRequests']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'result' => 'setResult', -'daily_requests' => 'setDailyRequests' ]; + 'daily_requests' => 'setDailyRequests']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'result' => 'getResult', -'daily_requests' => 'getDailyRequests' ]; + 'daily_requests' => 'getDailyRequests']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; + $this->container['daily_requests'] = isset($data['daily_requests']) ? $data['daily_requests'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; - $this->container['daily_requests'] = isset($data['daily_requests']) ? $data['daily_requests'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,46 +179,44 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return bool + * Gets result. */ - public function getResult() + public function getResult(): bool { return $this->container['result']; } /** - * Sets result + * Sets result. * - * @param bool $result Flag indicating whether the request came from a high activity visitor. + * @param bool $result flag indicating whether the request came from a high activity visitor * * @return $this */ - public function setResult($result) + public function setResult(bool $result): self { $this->container['result'] = $result; @@ -230,37 +224,35 @@ public function setResult($result) } /** - * Gets daily_requests + * Gets daily_requests. * - * @return float + * @return ?float */ - public function getDailyRequests() + public function getDailyRequests(): ?float { return $this->container['daily_requests']; } /** - * Sets daily_requests + * Sets daily_requests. * - * @param float $daily_requests Number of requests from the same visitor in the previous day. + * @param ?float $daily_requests number of requests from the same visitor in the previous day * * @return $this */ - public function setDailyRequests($daily_requests) + public function setDailyRequests(?float $daily_requests): self { $this->container['daily_requests'] = $daily_requests; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -268,12 +260,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -281,13 +270,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -299,30 +285,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/IPLocation.php b/src/Model/IPLocation.php index 3709db3f..6f769e05 100644 --- a/src/Model/IPLocation.php +++ b/src/Model/IPLocation.php @@ -1,17 +1,16 @@ 'int', -'latitude' => 'double', -'longitude' => 'double', -'postal_code' => 'string', -'timezone' => 'string', -'city' => '\Fingerprint\ServerAPI\Model\IPLocationCity', -'country' => '\Fingerprint\ServerAPI\Model\Location', -'continent' => '\Fingerprint\ServerAPI\Model\Location', -'subdivisions' => '\Fingerprint\ServerAPI\Model\Subdivision[]' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'accuracy_radius' => null, -'latitude' => 'double', -'longitude' => 'double', -'postal_code' => null, -'timezone' => 'timezone', -'city' => null, -'country' => null, -'continent' => null, -'subdivisions' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'IPLocation'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'accuracy_radius' => 'int', + 'latitude' => 'double', + 'longitude' => 'double', + 'postal_code' => 'string', + 'timezone' => 'string', + 'city' => '\Fingerprint\ServerAPI\Model\IPLocationCity', + 'country' => '\Fingerprint\ServerAPI\Model\Location', + 'continent' => '\Fingerprint\ServerAPI\Model\Location', + 'subdivisions' => '\Fingerprint\ServerAPI\Model\Subdivision[]']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'accuracy_radius' => null, + 'latitude' => 'double', + 'longitude' => 'double', + 'postal_code' => null, + 'timezone' => 'timezone', + 'city' => null, + 'country' => null, + 'continent' => null, + 'subdivisions' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'accuracy_radius' => 'accuracyRadius', -'latitude' => 'latitude', -'longitude' => 'longitude', -'postal_code' => 'postalCode', -'timezone' => 'timezone', -'city' => 'city', -'country' => 'country', -'continent' => 'continent', -'subdivisions' => 'subdivisions' ]; + 'latitude' => 'latitude', + 'longitude' => 'longitude', + 'postal_code' => 'postalCode', + 'timezone' => 'timezone', + 'city' => 'city', + 'country' => 'country', + 'continent' => 'continent', + 'subdivisions' => 'subdivisions']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'accuracy_radius' => 'setAccuracyRadius', -'latitude' => 'setLatitude', -'longitude' => 'setLongitude', -'postal_code' => 'setPostalCode', -'timezone' => 'setTimezone', -'city' => 'setCity', -'country' => 'setCountry', -'continent' => 'setContinent', -'subdivisions' => 'setSubdivisions' ]; + 'latitude' => 'setLatitude', + 'longitude' => 'setLongitude', + 'postal_code' => 'setPostalCode', + 'timezone' => 'setTimezone', + 'city' => 'setCity', + 'country' => 'setCountry', + 'continent' => 'setContinent', + 'subdivisions' => 'setSubdivisions']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'accuracy_radius' => 'getAccuracyRadius', -'latitude' => 'getLatitude', -'longitude' => 'getLongitude', -'postal_code' => 'getPostalCode', -'timezone' => 'getTimezone', -'city' => 'getCity', -'country' => 'getCountry', -'continent' => 'getContinent', -'subdivisions' => 'getSubdivisions' ]; + 'latitude' => 'getLatitude', + 'longitude' => 'getLongitude', + 'postal_code' => 'getPostalCode', + 'timezone' => 'getTimezone', + 'city' => 'getCity', + 'country' => 'getCountry', + 'continent' => 'getContinent', + 'subdivisions' => 'getSubdivisions']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] */ - public static function attributeMap() + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['accuracy_radius'] = isset($data['accuracy_radius']) ? $data['accuracy_radius'] : null; + $this->container['latitude'] = isset($data['latitude']) ? $data['latitude'] : null; + $this->container['longitude'] = isset($data['longitude']) ? $data['longitude'] : null; + $this->container['postal_code'] = isset($data['postal_code']) ? $data['postal_code'] : null; + $this->container['timezone'] = isset($data['timezone']) ? $data['timezone'] : null; + $this->container['city'] = isset($data['city']) ? $data['city'] : null; + $this->container['country'] = isset($data['country']) ? $data['country'] : null; + $this->container['continent'] = isset($data['continent']) ? $data['continent'] : null; + $this->container['subdivisions'] = isset($data['subdivisions']) ? $data['subdivisions'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['accuracy_radius'] = isset($data['accuracy_radius']) ? $data['accuracy_radius'] : null; - $this->container['latitude'] = isset($data['latitude']) ? $data['latitude'] : null; - $this->container['longitude'] = isset($data['longitude']) ? $data['longitude'] : null; - $this->container['postal_code'] = isset($data['postal_code']) ? $data['postal_code'] : null; - $this->container['timezone'] = isset($data['timezone']) ? $data['timezone'] : null; - $this->container['city'] = isset($data['city']) ? $data['city'] : null; - $this->container['country'] = isset($data['country']) ? $data['country'] : null; - $this->container['continent'] = isset($data['continent']) ? $data['continent'] : null; - $this->container['subdivisions'] = isset($data['subdivisions']) ? $data['subdivisions'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -225,43 +221,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets accuracy_radius + * Gets accuracy_radius. * - * @return int + * @return ?int */ - public function getAccuracyRadius() + public function getAccuracyRadius(): ?int { return $this->container['accuracy_radius']; } /** - * Sets accuracy_radius + * Sets accuracy_radius. * - * @param int $accuracy_radius The IP address is likely to be within this radius (in km) of the specified location. + * @param ?int $accuracy_radius the IP address is likely to be within this radius (in km) of the specified location * * @return $this */ - public function setAccuracyRadius($accuracy_radius) + public function setAccuracyRadius(?int $accuracy_radius): self { $this->container['accuracy_radius'] = $accuracy_radius; @@ -269,23 +262,23 @@ public function setAccuracyRadius($accuracy_radius) } /** - * Gets latitude + * Gets latitude. * - * @return double + * @return ?double */ - public function getLatitude() + public function getLatitude(): ?float { return $this->container['latitude']; } /** - * Sets latitude + * Sets latitude. * - * @param double $latitude latitude + * @param ?double $latitude latitude * * @return $this */ - public function setLatitude($latitude) + public function setLatitude(?float $latitude): self { $this->container['latitude'] = $latitude; @@ -293,23 +286,23 @@ public function setLatitude($latitude) } /** - * Gets longitude + * Gets longitude. * - * @return double + * @return ?double */ - public function getLongitude() + public function getLongitude(): ?float { return $this->container['longitude']; } /** - * Sets longitude + * Sets longitude. * - * @param double $longitude longitude + * @param ?double $longitude longitude * * @return $this */ - public function setLongitude($longitude) + public function setLongitude(?float $longitude): self { $this->container['longitude'] = $longitude; @@ -317,23 +310,23 @@ public function setLongitude($longitude) } /** - * Gets postal_code + * Gets postal_code. * - * @return string + * @return ?string */ - public function getPostalCode() + public function getPostalCode(): ?string { return $this->container['postal_code']; } /** - * Sets postal_code + * Sets postal_code. * - * @param string $postal_code postal_code + * @param ?string $postal_code postal_code * * @return $this */ - public function setPostalCode($postal_code) + public function setPostalCode(?string $postal_code): self { $this->container['postal_code'] = $postal_code; @@ -341,23 +334,23 @@ public function setPostalCode($postal_code) } /** - * Gets timezone + * Gets timezone. * - * @return string + * @return ?string */ - public function getTimezone() + public function getTimezone(): ?string { return $this->container['timezone']; } /** - * Sets timezone + * Sets timezone. * - * @param string $timezone timezone + * @param ?string $timezone timezone * * @return $this */ - public function setTimezone($timezone) + public function setTimezone(?string $timezone): self { $this->container['timezone'] = $timezone; @@ -365,23 +358,23 @@ public function setTimezone($timezone) } /** - * Gets city + * Gets city. * - * @return \Fingerprint\ServerAPI\Model\IPLocationCity + * @return ?\Fingerprint\ServerAPI\Model\IPLocationCity */ - public function getCity() + public function getCity(): ?IPLocationCity { return $this->container['city']; } /** - * Sets city + * Sets city. * - * @param \Fingerprint\ServerAPI\Model\IPLocationCity $city city + * @param ?\Fingerprint\ServerAPI\Model\IPLocationCity $city city * * @return $this */ - public function setCity($city) + public function setCity(?IPLocationCity $city): self { $this->container['city'] = $city; @@ -389,23 +382,23 @@ public function setCity($city) } /** - * Gets country + * Gets country. * - * @return \Fingerprint\ServerAPI\Model\Location + * @return ?\Fingerprint\ServerAPI\Model\Location */ - public function getCountry() + public function getCountry(): ?Location { return $this->container['country']; } /** - * Sets country + * Sets country. * - * @param \Fingerprint\ServerAPI\Model\Location $country country + * @param ?\Fingerprint\ServerAPI\Model\Location $country country * * @return $this */ - public function setCountry($country) + public function setCountry(?Location $country): self { $this->container['country'] = $country; @@ -413,23 +406,23 @@ public function setCountry($country) } /** - * Gets continent + * Gets continent. * - * @return \Fingerprint\ServerAPI\Model\Location + * @return ?\Fingerprint\ServerAPI\Model\Location */ - public function getContinent() + public function getContinent(): ?Location { return $this->container['continent']; } /** - * Sets continent + * Sets continent. * - * @param \Fingerprint\ServerAPI\Model\Location $continent continent + * @param ?\Fingerprint\ServerAPI\Model\Location $continent continent * * @return $this */ - public function setContinent($continent) + public function setContinent(?Location $continent): self { $this->container['continent'] = $continent; @@ -437,37 +430,35 @@ public function setContinent($continent) } /** - * Gets subdivisions + * Gets subdivisions. * - * @return \Fingerprint\ServerAPI\Model\Subdivision[] + * @return ?\Fingerprint\ServerAPI\Model\Subdivision[] */ - public function getSubdivisions() + public function getSubdivisions(): ?array { return $this->container['subdivisions']; } /** - * Sets subdivisions + * Sets subdivisions. * - * @param \Fingerprint\ServerAPI\Model\Subdivision[] $subdivisions subdivisions + * @param ?\Fingerprint\ServerAPI\Model\Subdivision[] $subdivisions subdivisions * * @return $this */ - public function setSubdivisions($subdivisions) + public function setSubdivisions(?array $subdivisions): self { $this->container['subdivisions'] = $subdivisions; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -475,12 +466,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -488,13 +476,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -506,30 +491,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/IPLocationCity.php b/src/Model/IPLocationCity.php index eb1c5ae5..c0637bf3 100644 --- a/src/Model/IPLocationCity.php +++ b/src/Model/IPLocationCity.php @@ -1,17 +1,16 @@ 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'name' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'IPLocationCity'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'name' => 'string']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'name' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'name' => 'name' ]; + protected static array $attributeMap = [ + 'name' => 'name']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'name' => 'setName' ]; + protected static array $setters = [ + 'name' => 'setName']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'name' => 'getName' ]; + protected static array $getters = [ + 'name' => 'getName']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['name'] = isset($data['name']) ? $data['name'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,57 +173,52 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets name + * Gets name. * - * @return string + * @return ?string */ - public function getName() + public function getName(): ?string { return $this->container['name']; } /** - * Sets name + * Sets name. * - * @param string $name name + * @param ?string $name name * * @return $this */ - public function setName($name) + public function setName(?string $name): self { $this->container['name'] = $name; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -235,12 +226,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -248,13 +236,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -266,30 +251,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/IdentificationError.php b/src/Model/IdentificationError.php index 539c584f..c8890cc4 100644 --- a/src/Model/IdentificationError.php +++ b/src/Model/IdentificationError.php @@ -1,17 +1,16 @@ 'string', -'message' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'code' => null, -'message' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'IdentificationError'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'code' => 'string', + 'message' => 'string']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'code' => null, + 'message' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'code' => 'code', -'message' => 'message' ]; + 'message' => 'message']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'code' => 'setCode', -'message' => 'setMessage' ]; + 'message' => 'setMessage']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'code' => 'getCode', -'message' => 'getMessage' ]; + 'message' => 'getMessage']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; } - const CODE__429_TOO_MANY_REQUESTS = '429 Too Many Requests'; -const CODE_FAILED = 'Failed'; + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } /** - * Gets allowable values of the enum - * - * @return string[] + * Array of attributes to getter functions (for serialization of requests). */ - public function getCodeAllowableValues() + public static function getters(): array { - return [ - self::CODE__429_TOO_MANY_REQUESTS, -self::CODE_FAILED, ]; + return self::$getters; } /** - * Associative array for storing property values - * - * @var mixed[] + * The original name of the model. */ - protected $container = []; + public function getModelName(): string + { + return self::$swaggerModelName; + } /** - * Constructor + * Gets allowable values of the enum. * - * @param mixed[] $data Associated array of property values - * initializing the model + * @return string[] */ - public function __construct(array $data = null) + public function getCodeAllowableValues(): array { - $this->container['code'] = isset($data['code']) ? $data['code'] : null; - $this->container['message'] = isset($data['message']) ? $data['message'] : null; + return [ + self::CODE__429_TOO_MANY_REQUESTS, + self::CODE_FAILED, ]; } /** @@ -196,11 +194,11 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['code'] === null) { + if (null === $this->container['code']) { $invalidProperties[] = "'code' can't be null"; } $allowedValues = $this->getCodeAllowableValues(); @@ -211,42 +209,40 @@ public function listInvalidProperties() ); } - if ($this->container['message'] === null) { + if (null === $this->container['message']) { $invalidProperties[] = "'message' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets code - * - * @return string + * Gets code. */ - public function getCode() + public function getCode(): string { return $this->container['code']; } /** - * Sets code + * Sets code. * * @param string $code Error code: * `429 Too Many Requests` - the limit on secret API key requests per second has been exceeded * `Failed` - internal server error * * @return $this */ - public function setCode($code) + public function setCode(string $code): self { $allowedValues = $this->getCodeAllowableValues(); if (!in_array($code, $allowedValues, true)) { @@ -263,37 +259,33 @@ public function setCode($code) } /** - * Gets message - * - * @return string + * Gets message. */ - public function getMessage() + public function getMessage(): string { return $this->container['message']; } /** - * Sets message + * Sets message. * * @param string $message message * * @return $this */ - public function setMessage($message) + public function setMessage(string $message): self { $this->container['message'] = $message; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -301,12 +293,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -314,13 +303,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -332,30 +318,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/IncognitoResult.php b/src/Model/IncognitoResult.php index c5178f47..6299cc93 100644 --- a/src/Model/IncognitoResult.php +++ b/src/Model/IncognitoResult.php @@ -1,17 +1,16 @@ 'bool' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'IncognitoResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'bool']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'result' => 'result' ]; + protected static array $attributeMap = [ + 'result' => 'result']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'result' => 'setResult' ]; + protected static array $setters = [ + 'result' => 'setResult']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'result' => 'getResult' ]; + protected static array $getters = [ + 'result' => 'getResult']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,60 +173,56 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return bool + * Gets result. */ - public function getResult() + public function getResult(): bool { return $this->container['result']; } /** - * Sets result + * Sets result. * - * @param bool $result `true` if we detected incognito mode used in the browser, `false` otherwise. + * @param bool $result `true` if we detected incognito mode used in the browser, `false` otherwise * * @return $this */ - public function setResult($result) + public function setResult(bool $result): self { $this->container['result'] = $result; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -238,12 +230,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -251,13 +240,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -269,30 +255,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/IpBlockListResult.php b/src/Model/IpBlockListResult.php index 82d9cf37..c6131829 100644 --- a/src/Model/IpBlockListResult.php +++ b/src/Model/IpBlockListResult.php @@ -1,17 +1,16 @@ 'bool', -'details' => '\Fingerprint\ServerAPI\Model\IpBlockListResultDetails' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null, -'details' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'IpBlockListResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'bool', + 'details' => '\Fingerprint\ServerAPI\Model\IpBlockListResultDetails']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null, + 'details' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'result' => 'result', -'details' => 'details' ]; + 'details' => 'details']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'result' => 'setResult', -'details' => 'setDetails' ]; + 'details' => 'setDetails']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'result' => 'getResult', -'details' => 'getDetails' ]; + 'details' => 'getDetails']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; + $this->container['details'] = isset($data['details']) ? $data['details'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; - $this->container['details'] = isset($data['details']) ? $data['details'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,49 +179,47 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } - if ($this->container['details'] === null) { + if (null === $this->container['details']) { $invalidProperties[] = "'details' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return bool + * Gets result. */ - public function getResult() + public function getResult(): bool { return $this->container['result']; } /** - * Sets result + * Sets result. * - * @param bool $result `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. + * @param bool $result `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise * * @return $this */ - public function setResult($result) + public function setResult(bool $result): self { $this->container['result'] = $result; @@ -233,37 +227,33 @@ public function setResult($result) } /** - * Gets details - * - * @return \Fingerprint\ServerAPI\Model\IpBlockListResultDetails + * Gets details. */ - public function getDetails() + public function getDetails(): IpBlockListResultDetails { return $this->container['details']; } /** - * Sets details + * Sets details. * - * @param \Fingerprint\ServerAPI\Model\IpBlockListResultDetails $details details + * @param IpBlockListResultDetails $details details * * @return $this */ - public function setDetails($details) + public function setDetails(IpBlockListResultDetails $details): self { $this->container['details'] = $details; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -271,12 +261,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -284,13 +271,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -302,30 +286,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/IpBlockListResultDetails.php b/src/Model/IpBlockListResultDetails.php index 3fe5d75d..0695fbc1 100644 --- a/src/Model/IpBlockListResultDetails.php +++ b/src/Model/IpBlockListResultDetails.php @@ -1,17 +1,16 @@ 'bool', -'attack_source' => 'bool' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'email_spam' => null, -'attack_source' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'IpBlockListResult_details'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'email_spam' => 'bool', + 'attack_source' => 'bool']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'email_spam' => null, + 'attack_source' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'email_spam' => 'emailSpam', -'attack_source' => 'attackSource' ]; + 'attack_source' => 'attackSource']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'email_spam' => 'setEmailSpam', -'attack_source' => 'setAttackSource' ]; + 'attack_source' => 'setAttackSource']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'email_spam' => 'getEmailSpam', -'attack_source' => 'getAttackSource' ]; + 'attack_source' => 'getAttackSource']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['email_spam'] = isset($data['email_spam']) ? $data['email_spam'] : null; + $this->container['attack_source'] = isset($data['attack_source']) ? $data['attack_source'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['email_spam'] = isset($data['email_spam']) ? $data['email_spam'] : null; - $this->container['attack_source'] = isset($data['attack_source']) ? $data['attack_source'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,49 +179,47 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['email_spam'] === null) { + if (null === $this->container['email_spam']) { $invalidProperties[] = "'email_spam' can't be null"; } - if ($this->container['attack_source'] === null) { + if (null === $this->container['attack_source']) { $invalidProperties[] = "'attack_source' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets email_spam - * - * @return bool + * Gets email_spam. */ - public function getEmailSpam() + public function getEmailSpam(): bool { return $this->container['email_spam']; } /** - * Sets email_spam + * Sets email_spam. * - * @param bool $email_spam IP address was part of a known email spam attack (SMTP). + * @param bool $email_spam IP address was part of a known email spam attack (SMTP) * * @return $this */ - public function setEmailSpam($email_spam) + public function setEmailSpam(bool $email_spam): self { $this->container['email_spam'] = $email_spam; @@ -233,37 +227,33 @@ public function setEmailSpam($email_spam) } /** - * Gets attack_source - * - * @return bool + * Gets attack_source. */ - public function getAttackSource() + public function getAttackSource(): bool { return $this->container['attack_source']; } /** - * Sets attack_source + * Sets attack_source. * - * @param bool $attack_source IP address was part of a known network attack (SSH/HTTPS). + * @param bool $attack_source IP address was part of a known network attack (SSH/HTTPS) * * @return $this */ - public function setAttackSource($attack_source) + public function setAttackSource(bool $attack_source): self { $this->container['attack_source'] = $attack_source; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -271,12 +261,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -284,13 +271,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -302,30 +286,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/IpInfoResult.php b/src/Model/IpInfoResult.php index e64f7e36..2a6a7d98 100644 --- a/src/Model/IpInfoResult.php +++ b/src/Model/IpInfoResult.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\IpInfoResultV4', -'v6' => '\Fingerprint\ServerAPI\Model\IpInfoResultV6' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'v4' => null, -'v6' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'IpInfoResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'v4' => '\Fingerprint\ServerAPI\Model\IpInfoResultV4', + 'v6' => '\Fingerprint\ServerAPI\Model\IpInfoResultV6']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'v4' => null, + 'v6' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'v4' => 'v4', -'v6' => 'v6' ]; + 'v6' => 'v6']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'v4' => 'setV4', -'v6' => 'setV6' ]; + 'v6' => 'setV6']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'v4' => 'getV4', -'v6' => 'getV6' ]; + 'v6' => 'getV6']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['v4'] = isset($data['v4']) ? $data['v4'] : null; + $this->container['v6'] = isset($data['v6']) ? $data['v6'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['v4'] = isset($data['v4']) ? $data['v4'] : null; - $this->container['v6'] = isset($data['v6']) ? $data['v6'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -184,43 +181,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets v4 + * Gets v4. * - * @return \Fingerprint\ServerAPI\Model\IpInfoResultV4 + * @return ?\Fingerprint\ServerAPI\Model\IpInfoResultV4 */ - public function getV4() + public function getV4(): ?IpInfoResultV4 { return $this->container['v4']; } /** - * Sets v4 + * Sets v4. * - * @param \Fingerprint\ServerAPI\Model\IpInfoResultV4 $v4 v4 + * @param ?\Fingerprint\ServerAPI\Model\IpInfoResultV4 $v4 v4 * * @return $this */ - public function setV4($v4) + public function setV4(?IpInfoResultV4 $v4): self { $this->container['v4'] = $v4; @@ -228,37 +222,35 @@ public function setV4($v4) } /** - * Gets v6 + * Gets v6. * - * @return \Fingerprint\ServerAPI\Model\IpInfoResultV6 + * @return ?\Fingerprint\ServerAPI\Model\IpInfoResultV6 */ - public function getV6() + public function getV6(): ?IpInfoResultV6 { return $this->container['v6']; } /** - * Sets v6 + * Sets v6. * - * @param \Fingerprint\ServerAPI\Model\IpInfoResultV6 $v6 v6 + * @param ?\Fingerprint\ServerAPI\Model\IpInfoResultV6 $v6 v6 * * @return $this */ - public function setV6($v6) + public function setV6(?IpInfoResultV6 $v6): self { $this->container['v6'] = $v6; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -266,12 +258,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -279,13 +268,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -297,30 +283,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/IpInfoResultV4.php b/src/Model/IpInfoResultV4.php index 4aee3502..8a2f36d3 100644 --- a/src/Model/IpInfoResultV4.php +++ b/src/Model/IpInfoResultV4.php @@ -1,17 +1,16 @@ 'string', -'geolocation' => '\Fingerprint\ServerAPI\Model\IPLocation', -'asn' => '\Fingerprint\ServerAPI\Model\ASN', -'datacenter' => '\Fingerprint\ServerAPI\Model\DataCenter' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'address' => 'ipv4', -'geolocation' => null, -'asn' => null, -'datacenter' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'IpInfoResult_v4'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'address' => 'string', + 'geolocation' => '\Fingerprint\ServerAPI\Model\IPLocation', + 'asn' => '\Fingerprint\ServerAPI\Model\ASN', + 'datacenter' => '\Fingerprint\ServerAPI\Model\DataCenter']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'address' => 'ipv4', + 'geolocation' => null, + 'asn' => null, + 'datacenter' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'address' => 'address', -'geolocation' => 'geolocation', -'asn' => 'asn', -'datacenter' => 'datacenter' ]; + 'geolocation' => 'geolocation', + 'asn' => 'asn', + 'datacenter' => 'datacenter']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'address' => 'setAddress', -'geolocation' => 'setGeolocation', -'asn' => 'setAsn', -'datacenter' => 'setDatacenter' ]; + 'geolocation' => 'setGeolocation', + 'asn' => 'setAsn', + 'datacenter' => 'setDatacenter']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'address' => 'getAddress', -'geolocation' => 'getGeolocation', -'asn' => 'getAsn', -'datacenter' => 'getDatacenter' ]; + 'geolocation' => 'getGeolocation', + 'asn' => 'getAsn', + 'datacenter' => 'getDatacenter']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['address'] = isset($data['address']) ? $data['address'] : null; + $this->container['geolocation'] = isset($data['geolocation']) ? $data['geolocation'] : null; + $this->container['asn'] = isset($data['asn']) ? $data['asn'] : null; + $this->container['datacenter'] = isset($data['datacenter']) ? $data['datacenter'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['address'] = isset($data['address']) ? $data['address'] : null; - $this->container['geolocation'] = isset($data['geolocation']) ? $data['geolocation'] : null; - $this->container['asn'] = isset($data['asn']) ? $data['asn'] : null; - $this->container['datacenter'] = isset($data['datacenter']) ? $data['datacenter'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -195,49 +191,47 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['address'] === null) { + if (null === $this->container['address']) { $invalidProperties[] = "'address' can't be null"; } - if ($this->container['geolocation'] === null) { + if (null === $this->container['geolocation']) { $invalidProperties[] = "'geolocation' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets address - * - * @return string + * Gets address. */ - public function getAddress() + public function getAddress(): string { return $this->container['address']; } /** - * Sets address + * Sets address. * * @param string $address address * * @return $this */ - public function setAddress($address) + public function setAddress(string $address): self { $this->container['address'] = $address; @@ -245,23 +239,21 @@ public function setAddress($address) } /** - * Gets geolocation - * - * @return \Fingerprint\ServerAPI\Model\IPLocation + * Gets geolocation. */ - public function getGeolocation() + public function getGeolocation(): IPLocation { return $this->container['geolocation']; } /** - * Sets geolocation + * Sets geolocation. * - * @param \Fingerprint\ServerAPI\Model\IPLocation $geolocation geolocation + * @param IPLocation $geolocation geolocation * * @return $this */ - public function setGeolocation($geolocation) + public function setGeolocation(IPLocation $geolocation): self { $this->container['geolocation'] = $geolocation; @@ -269,23 +261,23 @@ public function setGeolocation($geolocation) } /** - * Gets asn + * Gets asn. * - * @return \Fingerprint\ServerAPI\Model\ASN + * @return ?\Fingerprint\ServerAPI\Model\ASN */ - public function getAsn() + public function getAsn(): ?ASN { return $this->container['asn']; } /** - * Sets asn + * Sets asn. * - * @param \Fingerprint\ServerAPI\Model\ASN $asn asn + * @param ?\Fingerprint\ServerAPI\Model\ASN $asn asn * * @return $this */ - public function setAsn($asn) + public function setAsn(?ASN $asn): self { $this->container['asn'] = $asn; @@ -293,37 +285,35 @@ public function setAsn($asn) } /** - * Gets datacenter + * Gets datacenter. * - * @return \Fingerprint\ServerAPI\Model\DataCenter + * @return ?\Fingerprint\ServerAPI\Model\DataCenter */ - public function getDatacenter() + public function getDatacenter(): ?DataCenter { return $this->container['datacenter']; } /** - * Sets datacenter + * Sets datacenter. * - * @param \Fingerprint\ServerAPI\Model\DataCenter $datacenter datacenter + * @param ?\Fingerprint\ServerAPI\Model\DataCenter $datacenter datacenter * * @return $this */ - public function setDatacenter($datacenter) + public function setDatacenter(?DataCenter $datacenter): self { $this->container['datacenter'] = $datacenter; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -331,12 +321,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -344,13 +331,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -362,30 +346,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/IpInfoResultV6.php b/src/Model/IpInfoResultV6.php index cd6935d0..0774ae9c 100644 --- a/src/Model/IpInfoResultV6.php +++ b/src/Model/IpInfoResultV6.php @@ -1,17 +1,16 @@ 'string', -'geolocation' => '\Fingerprint\ServerAPI\Model\IPLocation', -'asn' => '\Fingerprint\ServerAPI\Model\ASN', -'datacenter' => '\Fingerprint\ServerAPI\Model\DataCenter' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'address' => 'ipv6', -'geolocation' => null, -'asn' => null, -'datacenter' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'IpInfoResult_v6'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'address' => 'string', + 'geolocation' => '\Fingerprint\ServerAPI\Model\IPLocation', + 'asn' => '\Fingerprint\ServerAPI\Model\ASN', + 'datacenter' => '\Fingerprint\ServerAPI\Model\DataCenter']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'address' => 'ipv6', + 'geolocation' => null, + 'asn' => null, + 'datacenter' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'address' => 'address', -'geolocation' => 'geolocation', -'asn' => 'asn', -'datacenter' => 'datacenter' ]; + 'geolocation' => 'geolocation', + 'asn' => 'asn', + 'datacenter' => 'datacenter']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'address' => 'setAddress', -'geolocation' => 'setGeolocation', -'asn' => 'setAsn', -'datacenter' => 'setDatacenter' ]; + 'geolocation' => 'setGeolocation', + 'asn' => 'setAsn', + 'datacenter' => 'setDatacenter']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'address' => 'getAddress', -'geolocation' => 'getGeolocation', -'asn' => 'getAsn', -'datacenter' => 'getDatacenter' ]; + 'geolocation' => 'getGeolocation', + 'asn' => 'getAsn', + 'datacenter' => 'getDatacenter']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['address'] = isset($data['address']) ? $data['address'] : null; + $this->container['geolocation'] = isset($data['geolocation']) ? $data['geolocation'] : null; + $this->container['asn'] = isset($data['asn']) ? $data['asn'] : null; + $this->container['datacenter'] = isset($data['datacenter']) ? $data['datacenter'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['address'] = isset($data['address']) ? $data['address'] : null; - $this->container['geolocation'] = isset($data['geolocation']) ? $data['geolocation'] : null; - $this->container['asn'] = isset($data['asn']) ? $data['asn'] : null; - $this->container['datacenter'] = isset($data['datacenter']) ? $data['datacenter'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -195,49 +191,47 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['address'] === null) { + if (null === $this->container['address']) { $invalidProperties[] = "'address' can't be null"; } - if ($this->container['geolocation'] === null) { + if (null === $this->container['geolocation']) { $invalidProperties[] = "'geolocation' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets address - * - * @return string + * Gets address. */ - public function getAddress() + public function getAddress(): string { return $this->container['address']; } /** - * Sets address + * Sets address. * * @param string $address address * * @return $this */ - public function setAddress($address) + public function setAddress(string $address): self { $this->container['address'] = $address; @@ -245,23 +239,21 @@ public function setAddress($address) } /** - * Gets geolocation - * - * @return \Fingerprint\ServerAPI\Model\IPLocation + * Gets geolocation. */ - public function getGeolocation() + public function getGeolocation(): IPLocation { return $this->container['geolocation']; } /** - * Sets geolocation + * Sets geolocation. * - * @param \Fingerprint\ServerAPI\Model\IPLocation $geolocation geolocation + * @param IPLocation $geolocation geolocation * * @return $this */ - public function setGeolocation($geolocation) + public function setGeolocation(IPLocation $geolocation): self { $this->container['geolocation'] = $geolocation; @@ -269,23 +261,23 @@ public function setGeolocation($geolocation) } /** - * Gets asn + * Gets asn. * - * @return \Fingerprint\ServerAPI\Model\ASN + * @return ?\Fingerprint\ServerAPI\Model\ASN */ - public function getAsn() + public function getAsn(): ?ASN { return $this->container['asn']; } /** - * Sets asn + * Sets asn. * - * @param \Fingerprint\ServerAPI\Model\ASN $asn asn + * @param ?\Fingerprint\ServerAPI\Model\ASN $asn asn * * @return $this */ - public function setAsn($asn) + public function setAsn(?ASN $asn): self { $this->container['asn'] = $asn; @@ -293,37 +285,35 @@ public function setAsn($asn) } /** - * Gets datacenter + * Gets datacenter. * - * @return \Fingerprint\ServerAPI\Model\DataCenter + * @return ?\Fingerprint\ServerAPI\Model\DataCenter */ - public function getDatacenter() + public function getDatacenter(): ?DataCenter { return $this->container['datacenter']; } /** - * Sets datacenter + * Sets datacenter. * - * @param \Fingerprint\ServerAPI\Model\DataCenter $datacenter datacenter + * @param ?\Fingerprint\ServerAPI\Model\DataCenter $datacenter datacenter * * @return $this */ - public function setDatacenter($datacenter) + public function setDatacenter(?DataCenter $datacenter): self { $this->container['datacenter'] = $datacenter; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -331,12 +321,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -344,13 +331,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -362,30 +346,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/JailbrokenResult.php b/src/Model/JailbrokenResult.php index 1a19096b..fa94ca4d 100644 --- a/src/Model/JailbrokenResult.php +++ b/src/Model/JailbrokenResult.php @@ -1,17 +1,16 @@ 'bool' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'JailbrokenResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'bool']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'result' => 'result' ]; + protected static array $attributeMap = [ + 'result' => 'result']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'result' => 'setResult' ]; + protected static array $setters = [ + 'result' => 'setResult']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'result' => 'getResult' ]; + protected static array $getters = [ + 'result' => 'getResult']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,60 +173,56 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return bool + * Gets result. */ - public function getResult() + public function getResult(): bool { return $this->container['result']; } /** - * Sets result + * Sets result. * * @param bool $result iOS specific jailbreak detection. There are 2 values: • `true` - Jailbreak detected • `false` - No signs of jailbreak or the client is not iOS. * * @return $this */ - public function setResult($result) + public function setResult(bool $result): self { $this->container['result'] = $result; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -238,12 +230,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -251,13 +240,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -269,30 +255,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/Location.php b/src/Model/Location.php index b61a952d..10af00e7 100644 --- a/src/Model/Location.php +++ b/src/Model/Location.php @@ -1,17 +1,16 @@ 'string', -'name' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'code' => null, -'name' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'Location'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'code' => 'string', + 'name' => 'string']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'code' => null, + 'name' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'code' => 'code', -'name' => 'name' ]; + 'name' => 'name']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'code' => 'setCode', -'name' => 'setName' ]; + 'name' => 'setName']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'code' => 'getCode', -'name' => 'getName' ]; + 'name' => 'getName']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['code'] = isset($data['code']) ? $data['code'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,49 +179,47 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['code'] === null) { + if (null === $this->container['code']) { $invalidProperties[] = "'code' can't be null"; } - if ($this->container['name'] === null) { + if (null === $this->container['name']) { $invalidProperties[] = "'name' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets code - * - * @return string + * Gets code. */ - public function getCode() + public function getCode(): string { return $this->container['code']; } /** - * Sets code + * Sets code. * * @param string $code code * * @return $this */ - public function setCode($code) + public function setCode(string $code): self { $this->container['code'] = $code; @@ -233,37 +227,33 @@ public function setCode($code) } /** - * Gets name - * - * @return string + * Gets name. */ - public function getName() + public function getName(): string { return $this->container['name']; } /** - * Sets name + * Sets name. * * @param string $name name * * @return $this */ - public function setName($name) + public function setName(string $name): self { $this->container['name'] = $name; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -271,12 +261,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -284,13 +271,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -302,30 +286,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/LocationSpoofingResult.php b/src/Model/LocationSpoofingResult.php index 2f164617..fb7e697c 100644 --- a/src/Model/LocationSpoofingResult.php +++ b/src/Model/LocationSpoofingResult.php @@ -1,17 +1,16 @@ 'bool' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'LocationSpoofingResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'bool']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'result' => 'result' ]; + protected static array $attributeMap = [ + 'result' => 'result']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'result' => 'setResult' ]; + protected static array $setters = [ + 'result' => 'setResult']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'result' => 'getResult' ]; + protected static array $getters = [ + 'result' => 'getResult']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,60 +173,56 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return bool + * Gets result. */ - public function getResult() + public function getResult(): bool { return $this->container['result']; } /** - * Sets result + * Sets result. * - * @param bool $result Flag indicating whether the request came from a mobile device with location spoofing enabled. + * @param bool $result flag indicating whether the request came from a mobile device with location spoofing enabled * * @return $this */ - public function setResult($result) + public function setResult(bool $result): self { $this->container['result'] = $result; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -238,12 +230,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -251,13 +240,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -269,30 +255,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/ModelInterface.php b/src/Model/ModelInterface.php index c6adaf20..0156c76d 100644 --- a/src/Model/ModelInterface.php +++ b/src/Model/ModelInterface.php @@ -1,17 +1,18 @@ 'bool' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'PrivacySettingsResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'bool']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'result' => 'result' ]; + protected static array $attributeMap = [ + 'result' => 'result']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'result' => 'setResult' ]; + protected static array $setters = [ + 'result' => 'setResult']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'result' => 'getResult' ]; + protected static array $getters = [ + 'result' => 'getResult']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,60 +173,56 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return bool + * Gets result. */ - public function getResult() + public function getResult(): bool { return $this->container['result']; } /** - * Sets result + * Sets result. * * @param bool $result `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. * * @return $this */ - public function setResult($result) + public function setResult(bool $result): self { $this->container['result'] = $result; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -238,12 +230,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -251,13 +240,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -269,30 +255,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/ProductError.php b/src/Model/ProductError.php index 00e8625d..5a0879e9 100644 --- a/src/Model/ProductError.php +++ b/src/Model/ProductError.php @@ -1,17 +1,16 @@ 'string', -'message' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'code' => null, -'message' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'ProductError'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'code' => 'string', + 'message' => 'string']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'code' => null, + 'message' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'code' => 'code', -'message' => 'message' ]; + 'message' => 'message']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'code' => 'setCode', -'message' => 'setMessage' ]; + 'message' => 'setMessage']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'code' => 'getCode', -'message' => 'getMessage' ]; + 'message' => 'getMessage']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; } - const CODE_TOO_MANY_REQUESTS = 'TooManyRequests'; -const CODE_FAILED = 'Failed'; + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } /** - * Gets allowable values of the enum - * - * @return string[] + * Array of attributes to getter functions (for serialization of requests). */ - public function getCodeAllowableValues() + public static function getters(): array { - return [ - self::CODE_TOO_MANY_REQUESTS, -self::CODE_FAILED, ]; + return self::$getters; } /** - * Associative array for storing property values - * - * @var mixed[] + * The original name of the model. */ - protected $container = []; + public function getModelName(): string + { + return self::$swaggerModelName; + } /** - * Constructor + * Gets allowable values of the enum. * - * @param mixed[] $data Associated array of property values - * initializing the model + * @return string[] */ - public function __construct(array $data = null) + public function getCodeAllowableValues(): array { - $this->container['code'] = isset($data['code']) ? $data['code'] : null; - $this->container['message'] = isset($data['message']) ? $data['message'] : null; + return [ + self::CODE_TOO_MANY_REQUESTS, + self::CODE_FAILED, ]; } /** @@ -196,11 +194,11 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['code'] === null) { + if (null === $this->container['code']) { $invalidProperties[] = "'code' can't be null"; } $allowedValues = $this->getCodeAllowableValues(); @@ -211,42 +209,40 @@ public function listInvalidProperties() ); } - if ($this->container['message'] === null) { + if (null === $this->container['message']) { $invalidProperties[] = "'message' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets code - * - * @return string + * Gets code. */ - public function getCode() + public function getCode(): string { return $this->container['code']; } /** - * Sets code + * Sets code. * * @param string $code Error code: * `TooManyRequests` - the limit on secret API key requests per second has been exceeded * `Failed` - internal server error * * @return $this */ - public function setCode($code) + public function setCode(string $code): self { $allowedValues = $this->getCodeAllowableValues(); if (!in_array($code, $allowedValues, true)) { @@ -263,37 +259,33 @@ public function setCode($code) } /** - * Gets message - * - * @return string + * Gets message. */ - public function getMessage() + public function getMessage(): string { return $this->container['message']; } /** - * Sets message + * Sets message. * * @param string $message message * * @return $this */ - public function setMessage($message) + public function setMessage(string $message): self { $this->container['message'] = $message; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -301,12 +293,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -314,13 +303,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -332,30 +318,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/ProductsResponse.php b/src/Model/ProductsResponse.php index fbdf4497..16649fd8 100644 --- a/src/Model/ProductsResponse.php +++ b/src/Model/ProductsResponse.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\ProductsResponseIdentification', -'botd' => '\Fingerprint\ServerAPI\Model\ProductsResponseBotd', -'ip_info' => '\Fingerprint\ServerAPI\Model\SignalResponseIpInfo', -'incognito' => '\Fingerprint\ServerAPI\Model\SignalResponseIncognito', -'root_apps' => '\Fingerprint\ServerAPI\Model\SignalResponseRootApps', -'emulator' => '\Fingerprint\ServerAPI\Model\SignalResponseEmulator', -'cloned_app' => '\Fingerprint\ServerAPI\Model\SignalResponseClonedApp', -'factory_reset' => '\Fingerprint\ServerAPI\Model\SignalResponseFactoryReset', -'jailbroken' => '\Fingerprint\ServerAPI\Model\SignalResponseJailbroken', -'frida' => '\Fingerprint\ServerAPI\Model\SignalResponseFrida', -'ip_blocklist' => '\Fingerprint\ServerAPI\Model\SignalResponseIpBlocklist', -'tor' => '\Fingerprint\ServerAPI\Model\SignalResponseTor', -'privacy_settings' => '\Fingerprint\ServerAPI\Model\SignalResponsePrivacySettings', -'virtual_machine' => '\Fingerprint\ServerAPI\Model\SignalResponseVirtualMachine', -'vpn' => '\Fingerprint\ServerAPI\Model\SignalResponseVpn', -'proxy' => '\Fingerprint\ServerAPI\Model\SignalResponseProxy', -'tampering' => '\Fingerprint\ServerAPI\Model\SignalResponseTampering', -'high_activity' => '\Fingerprint\ServerAPI\Model\SignalResponseHighActivity', -'location_spoofing' => '\Fingerprint\ServerAPI\Model\SignalResponseLocationSpoofing', -'suspect_score' => '\Fingerprint\ServerAPI\Model\SignalResponseSuspectScore', -'raw_device_attributes' => '\Fingerprint\ServerAPI\Model\SignalResponseRawDeviceAttributes' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'identification' => null, -'botd' => null, -'ip_info' => null, -'incognito' => null, -'root_apps' => null, -'emulator' => null, -'cloned_app' => null, -'factory_reset' => null, -'jailbroken' => null, -'frida' => null, -'ip_blocklist' => null, -'tor' => null, -'privacy_settings' => null, -'virtual_machine' => null, -'vpn' => null, -'proxy' => null, -'tampering' => null, -'high_activity' => null, -'location_spoofing' => null, -'suspect_score' => null, -'raw_device_attributes' => null ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization + 'botd' => '\Fingerprint\ServerAPI\Model\ProductsResponseBotd', + 'ip_info' => '\Fingerprint\ServerAPI\Model\SignalResponseIpInfo', + 'incognito' => '\Fingerprint\ServerAPI\Model\SignalResponseIncognito', + 'root_apps' => '\Fingerprint\ServerAPI\Model\SignalResponseRootApps', + 'emulator' => '\Fingerprint\ServerAPI\Model\SignalResponseEmulator', + 'cloned_app' => '\Fingerprint\ServerAPI\Model\SignalResponseClonedApp', + 'factory_reset' => '\Fingerprint\ServerAPI\Model\SignalResponseFactoryReset', + 'jailbroken' => '\Fingerprint\ServerAPI\Model\SignalResponseJailbroken', + 'frida' => '\Fingerprint\ServerAPI\Model\SignalResponseFrida', + 'ip_blocklist' => '\Fingerprint\ServerAPI\Model\SignalResponseIpBlocklist', + 'tor' => '\Fingerprint\ServerAPI\Model\SignalResponseTor', + 'privacy_settings' => '\Fingerprint\ServerAPI\Model\SignalResponsePrivacySettings', + 'virtual_machine' => '\Fingerprint\ServerAPI\Model\SignalResponseVirtualMachine', + 'vpn' => '\Fingerprint\ServerAPI\Model\SignalResponseVpn', + 'proxy' => '\Fingerprint\ServerAPI\Model\SignalResponseProxy', + 'tampering' => '\Fingerprint\ServerAPI\Model\SignalResponseTampering', + 'high_activity' => '\Fingerprint\ServerAPI\Model\SignalResponseHighActivity', + 'location_spoofing' => '\Fingerprint\ServerAPI\Model\SignalResponseLocationSpoofing', + 'suspect_score' => '\Fingerprint\ServerAPI\Model\SignalResponseSuspectScore', + 'raw_device_attributes' => '\Fingerprint\ServerAPI\Model\SignalResponseRawDeviceAttributes', + 'remote_control' => '\Fingerprint\ServerAPI\Model\SignalResponseRemoteControl', + 'velocity' => '\Fingerprint\ServerAPI\Model\SignalResponseVelocity', + 'developer_tools' => '\Fingerprint\ServerAPI\Model\SignalResponseDeveloperTools']; + + /** + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'identification' => null, + 'botd' => null, + 'ip_info' => null, + 'incognito' => null, + 'root_apps' => null, + 'emulator' => null, + 'cloned_app' => null, + 'factory_reset' => null, + 'jailbroken' => null, + 'frida' => null, + 'ip_blocklist' => null, + 'tor' => null, + 'privacy_settings' => null, + 'virtual_machine' => null, + 'vpn' => null, + 'proxy' => null, + 'tampering' => null, + 'high_activity' => null, + 'location_spoofing' => null, + 'suspect_score' => null, + 'raw_device_attributes' => null, + 'remote_control' => null, + 'velocity' => null, + 'developer_tools' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'identification' => 'identification', -'botd' => 'botd', -'ip_info' => 'ipInfo', -'incognito' => 'incognito', -'root_apps' => 'rootApps', -'emulator' => 'emulator', -'cloned_app' => 'clonedApp', -'factory_reset' => 'factoryReset', -'jailbroken' => 'jailbroken', -'frida' => 'frida', -'ip_blocklist' => 'ipBlocklist', -'tor' => 'tor', -'privacy_settings' => 'privacySettings', -'virtual_machine' => 'virtualMachine', -'vpn' => 'vpn', -'proxy' => 'proxy', -'tampering' => 'tampering', -'high_activity' => 'highActivity', -'location_spoofing' => 'locationSpoofing', -'suspect_score' => 'suspectScore', -'raw_device_attributes' => 'rawDeviceAttributes' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) + 'botd' => 'botd', + 'ip_info' => 'ipInfo', + 'incognito' => 'incognito', + 'root_apps' => 'rootApps', + 'emulator' => 'emulator', + 'cloned_app' => 'clonedApp', + 'factory_reset' => 'factoryReset', + 'jailbroken' => 'jailbroken', + 'frida' => 'frida', + 'ip_blocklist' => 'ipBlocklist', + 'tor' => 'tor', + 'privacy_settings' => 'privacySettings', + 'virtual_machine' => 'virtualMachine', + 'vpn' => 'vpn', + 'proxy' => 'proxy', + 'tampering' => 'tampering', + 'high_activity' => 'highActivity', + 'location_spoofing' => 'locationSpoofing', + 'suspect_score' => 'suspectScore', + 'raw_device_attributes' => 'rawDeviceAttributes', + 'remote_control' => 'remoteControl', + 'velocity' => 'velocity', + 'developer_tools' => 'developerTools']; + + /** + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'identification' => 'setIdentification', -'botd' => 'setBotd', -'ip_info' => 'setIpInfo', -'incognito' => 'setIncognito', -'root_apps' => 'setRootApps', -'emulator' => 'setEmulator', -'cloned_app' => 'setClonedApp', -'factory_reset' => 'setFactoryReset', -'jailbroken' => 'setJailbroken', -'frida' => 'setFrida', -'ip_blocklist' => 'setIpBlocklist', -'tor' => 'setTor', -'privacy_settings' => 'setPrivacySettings', -'virtual_machine' => 'setVirtualMachine', -'vpn' => 'setVpn', -'proxy' => 'setProxy', -'tampering' => 'setTampering', -'high_activity' => 'setHighActivity', -'location_spoofing' => 'setLocationSpoofing', -'suspect_score' => 'setSuspectScore', -'raw_device_attributes' => 'setRawDeviceAttributes' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) + 'botd' => 'setBotd', + 'ip_info' => 'setIpInfo', + 'incognito' => 'setIncognito', + 'root_apps' => 'setRootApps', + 'emulator' => 'setEmulator', + 'cloned_app' => 'setClonedApp', + 'factory_reset' => 'setFactoryReset', + 'jailbroken' => 'setJailbroken', + 'frida' => 'setFrida', + 'ip_blocklist' => 'setIpBlocklist', + 'tor' => 'setTor', + 'privacy_settings' => 'setPrivacySettings', + 'virtual_machine' => 'setVirtualMachine', + 'vpn' => 'setVpn', + 'proxy' => 'setProxy', + 'tampering' => 'setTampering', + 'high_activity' => 'setHighActivity', + 'location_spoofing' => 'setLocationSpoofing', + 'suspect_score' => 'setSuspectScore', + 'raw_device_attributes' => 'setRawDeviceAttributes', + 'remote_control' => 'setRemoteControl', + 'velocity' => 'setVelocity', + 'developer_tools' => 'setDeveloperTools']; + + /** + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'identification' => 'getIdentification', -'botd' => 'getBotd', -'ip_info' => 'getIpInfo', -'incognito' => 'getIncognito', -'root_apps' => 'getRootApps', -'emulator' => 'getEmulator', -'cloned_app' => 'getClonedApp', -'factory_reset' => 'getFactoryReset', -'jailbroken' => 'getJailbroken', -'frida' => 'getFrida', -'ip_blocklist' => 'getIpBlocklist', -'tor' => 'getTor', -'privacy_settings' => 'getPrivacySettings', -'virtual_machine' => 'getVirtualMachine', -'vpn' => 'getVpn', -'proxy' => 'getProxy', -'tampering' => 'getTampering', -'high_activity' => 'getHighActivity', -'location_spoofing' => 'getLocationSpoofing', -'suspect_score' => 'getSuspectScore', -'raw_device_attributes' => 'getRawDeviceAttributes' ]; - - /** - * 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::$swaggerModelName; - } - - - - /** - * Associative array for storing property values + 'botd' => 'getBotd', + 'ip_info' => 'getIpInfo', + 'incognito' => 'getIncognito', + 'root_apps' => 'getRootApps', + 'emulator' => 'getEmulator', + 'cloned_app' => 'getClonedApp', + 'factory_reset' => 'getFactoryReset', + 'jailbroken' => 'getJailbroken', + 'frida' => 'getFrida', + 'ip_blocklist' => 'getIpBlocklist', + 'tor' => 'getTor', + 'privacy_settings' => 'getPrivacySettings', + 'virtual_machine' => 'getVirtualMachine', + 'vpn' => 'getVpn', + 'proxy' => 'getProxy', + 'tampering' => 'getTampering', + 'high_activity' => 'getHighActivity', + 'location_spoofing' => 'getLocationSpoofing', + 'suspect_score' => 'getSuspectScore', + 'raw_device_attributes' => 'getRawDeviceAttributes', + 'remote_control' => 'getRemoteControl', + 'velocity' => 'getVelocity', + 'developer_tools' => 'getDeveloperTools']; + + /** + * Associative array for storing property values. * * @var mixed[] */ - protected $container = []; + protected array $container = []; /** - * Constructor + * Constructor. * * @param mixed[] $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->container['identification'] = isset($data['identification']) ? $data['identification'] : null; $this->container['botd'] = isset($data['botd']) ? $data['botd'] : null; @@ -291,6 +239,73 @@ public function __construct(array $data = null) $this->container['location_spoofing'] = isset($data['location_spoofing']) ? $data['location_spoofing'] : null; $this->container['suspect_score'] = isset($data['suspect_score']) ? $data['suspect_score'] : null; $this->container['raw_device_attributes'] = isset($data['raw_device_attributes']) ? $data['raw_device_attributes'] : null; + $this->container['remote_control'] = isset($data['remote_control']) ? $data['remote_control'] : null; + $this->container['velocity'] = isset($data['velocity']) ? $data['velocity'] : null; + $this->container['developer_tools'] = isset($data['developer_tools']) ? $data['developer_tools'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -298,43 +313,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets identification + * Gets identification. * - * @return \Fingerprint\ServerAPI\Model\ProductsResponseIdentification + * @return ?\Fingerprint\ServerAPI\Model\ProductsResponseIdentification */ - public function getIdentification() + public function getIdentification(): ?ProductsResponseIdentification { return $this->container['identification']; } /** - * Sets identification + * Sets identification. * - * @param \Fingerprint\ServerAPI\Model\ProductsResponseIdentification $identification identification + * @param ?\Fingerprint\ServerAPI\Model\ProductsResponseIdentification $identification identification * * @return $this */ - public function setIdentification($identification) + public function setIdentification(?ProductsResponseIdentification $identification): self { $this->container['identification'] = $identification; @@ -342,23 +354,23 @@ public function setIdentification($identification) } /** - * Gets botd + * Gets botd. * - * @return \Fingerprint\ServerAPI\Model\ProductsResponseBotd + * @return ?\Fingerprint\ServerAPI\Model\ProductsResponseBotd */ - public function getBotd() + public function getBotd(): ?ProductsResponseBotd { return $this->container['botd']; } /** - * Sets botd + * Sets botd. * - * @param \Fingerprint\ServerAPI\Model\ProductsResponseBotd $botd botd + * @param ?\Fingerprint\ServerAPI\Model\ProductsResponseBotd $botd botd * * @return $this */ - public function setBotd($botd) + public function setBotd(?ProductsResponseBotd $botd): self { $this->container['botd'] = $botd; @@ -366,23 +378,23 @@ public function setBotd($botd) } /** - * Gets ip_info + * Gets ip_info. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseIpInfo + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseIpInfo */ - public function getIpInfo() + public function getIpInfo(): ?SignalResponseIpInfo { return $this->container['ip_info']; } /** - * Sets ip_info + * Sets ip_info. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseIpInfo $ip_info ip_info + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseIpInfo $ip_info ip_info * * @return $this */ - public function setIpInfo($ip_info) + public function setIpInfo(?SignalResponseIpInfo $ip_info): self { $this->container['ip_info'] = $ip_info; @@ -390,23 +402,23 @@ public function setIpInfo($ip_info) } /** - * Gets incognito + * Gets incognito. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseIncognito + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseIncognito */ - public function getIncognito() + public function getIncognito(): ?SignalResponseIncognito { return $this->container['incognito']; } /** - * Sets incognito + * Sets incognito. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseIncognito $incognito incognito + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseIncognito $incognito incognito * * @return $this */ - public function setIncognito($incognito) + public function setIncognito(?SignalResponseIncognito $incognito): self { $this->container['incognito'] = $incognito; @@ -414,23 +426,23 @@ public function setIncognito($incognito) } /** - * Gets root_apps + * Gets root_apps. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseRootApps + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseRootApps */ - public function getRootApps() + public function getRootApps(): ?SignalResponseRootApps { return $this->container['root_apps']; } /** - * Sets root_apps + * Sets root_apps. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseRootApps $root_apps root_apps + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseRootApps $root_apps root_apps * * @return $this */ - public function setRootApps($root_apps) + public function setRootApps(?SignalResponseRootApps $root_apps): self { $this->container['root_apps'] = $root_apps; @@ -438,23 +450,23 @@ public function setRootApps($root_apps) } /** - * Gets emulator + * Gets emulator. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseEmulator + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseEmulator */ - public function getEmulator() + public function getEmulator(): ?SignalResponseEmulator { return $this->container['emulator']; } /** - * Sets emulator + * Sets emulator. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseEmulator $emulator emulator + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseEmulator $emulator emulator * * @return $this */ - public function setEmulator($emulator) + public function setEmulator(?SignalResponseEmulator $emulator): self { $this->container['emulator'] = $emulator; @@ -462,23 +474,23 @@ public function setEmulator($emulator) } /** - * Gets cloned_app + * Gets cloned_app. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseClonedApp + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseClonedApp */ - public function getClonedApp() + public function getClonedApp(): ?SignalResponseClonedApp { return $this->container['cloned_app']; } /** - * Sets cloned_app + * Sets cloned_app. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseClonedApp $cloned_app cloned_app + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseClonedApp $cloned_app cloned_app * * @return $this */ - public function setClonedApp($cloned_app) + public function setClonedApp(?SignalResponseClonedApp $cloned_app): self { $this->container['cloned_app'] = $cloned_app; @@ -486,23 +498,23 @@ public function setClonedApp($cloned_app) } /** - * Gets factory_reset + * Gets factory_reset. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseFactoryReset + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseFactoryReset */ - public function getFactoryReset() + public function getFactoryReset(): ?SignalResponseFactoryReset { return $this->container['factory_reset']; } /** - * Sets factory_reset + * Sets factory_reset. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseFactoryReset $factory_reset factory_reset + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseFactoryReset $factory_reset factory_reset * * @return $this */ - public function setFactoryReset($factory_reset) + public function setFactoryReset(?SignalResponseFactoryReset $factory_reset): self { $this->container['factory_reset'] = $factory_reset; @@ -510,23 +522,23 @@ public function setFactoryReset($factory_reset) } /** - * Gets jailbroken + * Gets jailbroken. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseJailbroken + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseJailbroken */ - public function getJailbroken() + public function getJailbroken(): ?SignalResponseJailbroken { return $this->container['jailbroken']; } /** - * Sets jailbroken + * Sets jailbroken. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseJailbroken $jailbroken jailbroken + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseJailbroken $jailbroken jailbroken * * @return $this */ - public function setJailbroken($jailbroken) + public function setJailbroken(?SignalResponseJailbroken $jailbroken): self { $this->container['jailbroken'] = $jailbroken; @@ -534,23 +546,23 @@ public function setJailbroken($jailbroken) } /** - * Gets frida + * Gets frida. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseFrida + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseFrida */ - public function getFrida() + public function getFrida(): ?SignalResponseFrida { return $this->container['frida']; } /** - * Sets frida + * Sets frida. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseFrida $frida frida + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseFrida $frida frida * * @return $this */ - public function setFrida($frida) + public function setFrida(?SignalResponseFrida $frida): self { $this->container['frida'] = $frida; @@ -558,23 +570,23 @@ public function setFrida($frida) } /** - * Gets ip_blocklist + * Gets ip_blocklist. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseIpBlocklist + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseIpBlocklist */ - public function getIpBlocklist() + public function getIpBlocklist(): ?SignalResponseIpBlocklist { return $this->container['ip_blocklist']; } /** - * Sets ip_blocklist + * Sets ip_blocklist. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseIpBlocklist $ip_blocklist ip_blocklist + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseIpBlocklist $ip_blocklist ip_blocklist * * @return $this */ - public function setIpBlocklist($ip_blocklist) + public function setIpBlocklist(?SignalResponseIpBlocklist $ip_blocklist): self { $this->container['ip_blocklist'] = $ip_blocklist; @@ -582,23 +594,23 @@ public function setIpBlocklist($ip_blocklist) } /** - * Gets tor + * Gets tor. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseTor + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseTor */ - public function getTor() + public function getTor(): ?SignalResponseTor { return $this->container['tor']; } /** - * Sets tor + * Sets tor. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseTor $tor tor + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseTor $tor tor * * @return $this */ - public function setTor($tor) + public function setTor(?SignalResponseTor $tor): self { $this->container['tor'] = $tor; @@ -606,23 +618,23 @@ public function setTor($tor) } /** - * Gets privacy_settings + * Gets privacy_settings. * - * @return \Fingerprint\ServerAPI\Model\SignalResponsePrivacySettings + * @return ?\Fingerprint\ServerAPI\Model\SignalResponsePrivacySettings */ - public function getPrivacySettings() + public function getPrivacySettings(): ?SignalResponsePrivacySettings { return $this->container['privacy_settings']; } /** - * Sets privacy_settings + * Sets privacy_settings. * - * @param \Fingerprint\ServerAPI\Model\SignalResponsePrivacySettings $privacy_settings privacy_settings + * @param ?\Fingerprint\ServerAPI\Model\SignalResponsePrivacySettings $privacy_settings privacy_settings * * @return $this */ - public function setPrivacySettings($privacy_settings) + public function setPrivacySettings(?SignalResponsePrivacySettings $privacy_settings): self { $this->container['privacy_settings'] = $privacy_settings; @@ -630,23 +642,23 @@ public function setPrivacySettings($privacy_settings) } /** - * Gets virtual_machine + * Gets virtual_machine. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseVirtualMachine + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseVirtualMachine */ - public function getVirtualMachine() + public function getVirtualMachine(): ?SignalResponseVirtualMachine { return $this->container['virtual_machine']; } /** - * Sets virtual_machine + * Sets virtual_machine. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseVirtualMachine $virtual_machine virtual_machine + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseVirtualMachine $virtual_machine virtual_machine * * @return $this */ - public function setVirtualMachine($virtual_machine) + public function setVirtualMachine(?SignalResponseVirtualMachine $virtual_machine): self { $this->container['virtual_machine'] = $virtual_machine; @@ -654,23 +666,23 @@ public function setVirtualMachine($virtual_machine) } /** - * Gets vpn + * Gets vpn. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseVpn + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseVpn */ - public function getVpn() + public function getVpn(): ?SignalResponseVpn { return $this->container['vpn']; } /** - * Sets vpn + * Sets vpn. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseVpn $vpn vpn + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseVpn $vpn vpn * * @return $this */ - public function setVpn($vpn) + public function setVpn(?SignalResponseVpn $vpn): self { $this->container['vpn'] = $vpn; @@ -678,23 +690,23 @@ public function setVpn($vpn) } /** - * Gets proxy + * Gets proxy. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseProxy + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseProxy */ - public function getProxy() + public function getProxy(): ?SignalResponseProxy { return $this->container['proxy']; } /** - * Sets proxy + * Sets proxy. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseProxy $proxy proxy + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseProxy $proxy proxy * * @return $this */ - public function setProxy($proxy) + public function setProxy(?SignalResponseProxy $proxy): self { $this->container['proxy'] = $proxy; @@ -702,23 +714,23 @@ public function setProxy($proxy) } /** - * Gets tampering + * Gets tampering. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseTampering + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseTampering */ - public function getTampering() + public function getTampering(): ?SignalResponseTampering { return $this->container['tampering']; } /** - * Sets tampering + * Sets tampering. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseTampering $tampering tampering + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseTampering $tampering tampering * * @return $this */ - public function setTampering($tampering) + public function setTampering(?SignalResponseTampering $tampering): self { $this->container['tampering'] = $tampering; @@ -726,23 +738,23 @@ public function setTampering($tampering) } /** - * Gets high_activity + * Gets high_activity. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseHighActivity + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseHighActivity */ - public function getHighActivity() + public function getHighActivity(): ?SignalResponseHighActivity { return $this->container['high_activity']; } /** - * Sets high_activity + * Sets high_activity. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseHighActivity $high_activity high_activity + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseHighActivity $high_activity high_activity * * @return $this */ - public function setHighActivity($high_activity) + public function setHighActivity(?SignalResponseHighActivity $high_activity): self { $this->container['high_activity'] = $high_activity; @@ -750,23 +762,23 @@ public function setHighActivity($high_activity) } /** - * Gets location_spoofing + * Gets location_spoofing. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseLocationSpoofing + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseLocationSpoofing */ - public function getLocationSpoofing() + public function getLocationSpoofing(): ?SignalResponseLocationSpoofing { return $this->container['location_spoofing']; } /** - * Sets location_spoofing + * Sets location_spoofing. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseLocationSpoofing $location_spoofing location_spoofing + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseLocationSpoofing $location_spoofing location_spoofing * * @return $this */ - public function setLocationSpoofing($location_spoofing) + public function setLocationSpoofing(?SignalResponseLocationSpoofing $location_spoofing): self { $this->container['location_spoofing'] = $location_spoofing; @@ -774,23 +786,23 @@ public function setLocationSpoofing($location_spoofing) } /** - * Gets suspect_score + * Gets suspect_score. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseSuspectScore + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseSuspectScore */ - public function getSuspectScore() + public function getSuspectScore(): ?SignalResponseSuspectScore { return $this->container['suspect_score']; } /** - * Sets suspect_score + * Sets suspect_score. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseSuspectScore $suspect_score suspect_score + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseSuspectScore $suspect_score suspect_score * * @return $this */ - public function setSuspectScore($suspect_score) + public function setSuspectScore(?SignalResponseSuspectScore $suspect_score): self { $this->container['suspect_score'] = $suspect_score; @@ -798,99 +810,143 @@ public function setSuspectScore($suspect_score) } /** - * Gets raw_device_attributes + * Gets raw_device_attributes. * - * @return \Fingerprint\ServerAPI\Model\SignalResponseRawDeviceAttributes + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseRawDeviceAttributes */ - public function getRawDeviceAttributes() + public function getRawDeviceAttributes(): ?SignalResponseRawDeviceAttributes { return $this->container['raw_device_attributes']; } /** - * Sets raw_device_attributes + * Sets raw_device_attributes. * - * @param \Fingerprint\ServerAPI\Model\SignalResponseRawDeviceAttributes $raw_device_attributes raw_device_attributes + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseRawDeviceAttributes $raw_device_attributes raw_device_attributes * * @return $this */ - public function setRawDeviceAttributes($raw_device_attributes) + public function setRawDeviceAttributes(?SignalResponseRawDeviceAttributes $raw_device_attributes): self { $this->container['raw_device_attributes'] = $raw_device_attributes; return $this; } + + /** + * Gets remote_control. + * + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseRemoteControl + */ + public function getRemoteControl(): ?SignalResponseRemoteControl + { + return $this->container['remote_control']; + } + /** - * Returns true if offset exists. False otherwise. + * Sets remote_control. * - * @param integer $offset Offset + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseRemoteControl $remote_control remote_control * - * @return boolean + * @return $this */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function setRemoteControl(?SignalResponseRemoteControl $remote_control): self { - return isset($this->container[$offset]); + $this->container['remote_control'] = $remote_control; + + return $this; } /** - * Gets offset. + * Gets velocity. * - * @param integer $offset Offset + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseVelocity + */ + public function getVelocity(): ?SignalResponseVelocity + { + return $this->container['velocity']; + } + + /** + * Sets velocity. * - * @return mixed + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseVelocity $velocity velocity + * + * @return $this */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function setVelocity(?SignalResponseVelocity $velocity): self { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + $this->container['velocity'] = $velocity; + + return $this; } /** - * Sets value based on offset. + * Gets developer_tools. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseDeveloperTools + */ + public function getDeveloperTools(): ?SignalResponseDeveloperTools + { + return $this->container['developer_tools']; + } + + /** + * Sets developer_tools. * - * @return void + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseDeveloperTools $developer_tools developer_tools + * + * @return $this */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function setDeveloperTools(?SignalResponseDeveloperTools $developer_tools): self { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } + $this->container['developer_tools'] = $developer_tools; + + return $this; } /** - * Unsets offset. + * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetGet($offset): mixed { - unset($this->container[$offset]); + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** - * Gets the string presentation of the object + * Sets value based on offset. * - * @return string + * @param int $offset Offset + * @param mixed $value Value to be set */ - public function __toString() + public function offsetSet($offset, mixed $value): void { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; } + } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); } } diff --git a/src/Model/ProductsResponseBotd.php b/src/Model/ProductsResponseBotd.php index 352245dc..7d8255c1 100644 --- a/src/Model/ProductsResponseBotd.php +++ b/src/Model/ProductsResponseBotd.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\BotdResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'ProductsResponseBotd'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\BotdResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\BotdResult + * @return ?\Fingerprint\ServerAPI\Model\BotdResult */ - public function getData() + public function getData(): ?BotdResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\BotdResult $data data + * @param ?\Fingerprint\ServerAPI\Model\BotdResult $data data * * @return $this */ - public function setData($data) + public function setData(?BotdResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/ProductsResponseIdentification.php b/src/Model/ProductsResponseIdentification.php index a6034934..dfec88dc 100644 --- a/src/Model/ProductsResponseIdentification.php +++ b/src/Model/ProductsResponseIdentification.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\ProductsResponseIdentificationData', -'error' => '\Fingerprint\ServerAPI\Model\IdentificationError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'ProductsResponseIdentification'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\ProductsResponseIdentificationData', + 'error' => '\Fingerprint\ServerAPI\Model\IdentificationError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\ProductsResponseIdentificationData + * @return ?\Fingerprint\ServerAPI\Model\ProductsResponseIdentificationData */ - public function getData() + public function getData(): ?ProductsResponseIdentificationData { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\ProductsResponseIdentificationData $data data + * @param ?\Fingerprint\ServerAPI\Model\ProductsResponseIdentificationData $data data * * @return $this */ - public function setData($data) + public function setData(?ProductsResponseIdentificationData $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\IdentificationError + * @return ?\Fingerprint\ServerAPI\Model\IdentificationError */ - public function getError() + public function getError(): ?IdentificationError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\IdentificationError $error error + * @param ?\Fingerprint\ServerAPI\Model\IdentificationError $error error * * @return $this */ - public function setError($error) + public function setError(?IdentificationError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/ProductsResponseIdentificationData.php b/src/Model/ProductsResponseIdentificationData.php index 0e77cc98..1bf397fc 100644 --- a/src/Model/ProductsResponseIdentificationData.php +++ b/src/Model/ProductsResponseIdentificationData.php @@ -1,17 +1,16 @@ 'string', -'browser_details' => '\Fingerprint\ServerAPI\Model\BrowserDetails', -'incognito' => 'bool', -'ip' => 'string', -'ip_location' => '\Fingerprint\ServerAPI\Model\DeprecatedIPLocation', -'timestamp' => 'int', -'time' => '\DateTime', -'url' => 'string', -'tag' => 'map[string,object]', -'linked_id' => 'string', -'confidence' => '\Fingerprint\ServerAPI\Model\Confidence', -'visitor_found' => 'bool', -'first_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt', -'last_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt', -'visitor_id' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'request_id' => null, -'browser_details' => null, -'incognito' => null, -'ip' => 'ipv4', -'ip_location' => null, -'timestamp' => 'int64', -'time' => 'date-time', -'url' => null, -'tag' => null, -'linked_id' => null, -'confidence' => null, -'visitor_found' => null, -'first_seen_at' => null, -'last_seen_at' => null, -'visitor_id' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'ProductsResponseIdentificationData'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization + protected static array $swaggerTypes = [ + 'request_id' => 'string', + 'browser_details' => '\Fingerprint\ServerAPI\Model\BrowserDetails', + 'incognito' => 'bool', + 'ip' => 'string', + 'ip_location' => '\Fingerprint\ServerAPI\Model\DeprecatedIPLocation', + 'timestamp' => 'int', + 'time' => '\DateTime', + 'url' => 'string', + 'tag' => 'map[string,object]', + 'linked_id' => 'string', + 'confidence' => '\Fingerprint\ServerAPI\Model\Confidence', + 'visitor_found' => 'bool', + 'first_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt', + 'last_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt', + 'visitor_id' => 'string']; + + /** + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'request_id' => null, + 'browser_details' => null, + 'incognito' => null, + 'ip' => 'ipv4', + 'ip_location' => null, + 'timestamp' => 'int64', + 'time' => 'date-time', + 'url' => null, + 'tag' => null, + 'linked_id' => null, + 'confidence' => null, + 'visitor_found' => null, + 'first_seen_at' => null, + 'last_seen_at' => null, + 'visitor_id' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'request_id' => 'requestId', -'browser_details' => 'browserDetails', -'incognito' => 'incognito', -'ip' => 'ip', -'ip_location' => 'ipLocation', -'timestamp' => 'timestamp', -'time' => 'time', -'url' => 'url', -'tag' => 'tag', -'linked_id' => 'linkedId', -'confidence' => 'confidence', -'visitor_found' => 'visitorFound', -'first_seen_at' => 'firstSeenAt', -'last_seen_at' => 'lastSeenAt', -'visitor_id' => 'visitorId' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) + 'browser_details' => 'browserDetails', + 'incognito' => 'incognito', + 'ip' => 'ip', + 'ip_location' => 'ipLocation', + 'timestamp' => 'timestamp', + 'time' => 'time', + 'url' => 'url', + 'tag' => 'tag', + 'linked_id' => 'linkedId', + 'confidence' => 'confidence', + 'visitor_found' => 'visitorFound', + 'first_seen_at' => 'firstSeenAt', + 'last_seen_at' => 'lastSeenAt', + 'visitor_id' => 'visitorId']; + + /** + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'request_id' => 'setRequestId', -'browser_details' => 'setBrowserDetails', -'incognito' => 'setIncognito', -'ip' => 'setIp', -'ip_location' => 'setIpLocation', -'timestamp' => 'setTimestamp', -'time' => 'setTime', -'url' => 'setUrl', -'tag' => 'setTag', -'linked_id' => 'setLinkedId', -'confidence' => 'setConfidence', -'visitor_found' => 'setVisitorFound', -'first_seen_at' => 'setFirstSeenAt', -'last_seen_at' => 'setLastSeenAt', -'visitor_id' => 'setVisitorId' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) + 'browser_details' => 'setBrowserDetails', + 'incognito' => 'setIncognito', + 'ip' => 'setIp', + 'ip_location' => 'setIpLocation', + 'timestamp' => 'setTimestamp', + 'time' => 'setTime', + 'url' => 'setUrl', + 'tag' => 'setTag', + 'linked_id' => 'setLinkedId', + 'confidence' => 'setConfidence', + 'visitor_found' => 'setVisitorFound', + 'first_seen_at' => 'setFirstSeenAt', + 'last_seen_at' => 'setLastSeenAt', + 'visitor_id' => 'setVisitorId']; + + /** + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'request_id' => 'getRequestId', -'browser_details' => 'getBrowserDetails', -'incognito' => 'getIncognito', -'ip' => 'getIp', -'ip_location' => 'getIpLocation', -'timestamp' => 'getTimestamp', -'time' => 'getTime', -'url' => 'getUrl', -'tag' => 'getTag', -'linked_id' => 'getLinkedId', -'confidence' => 'getConfidence', -'visitor_found' => 'getVisitorFound', -'first_seen_at' => 'getFirstSeenAt', -'last_seen_at' => 'getLastSeenAt', -'visitor_id' => 'getVisitorId' ]; + 'browser_details' => 'getBrowserDetails', + 'incognito' => 'getIncognito', + 'ip' => 'getIp', + 'ip_location' => 'getIpLocation', + 'timestamp' => 'getTimestamp', + 'time' => 'getTime', + 'url' => 'getUrl', + 'tag' => 'getTag', + 'linked_id' => 'getLinkedId', + 'confidence' => 'getConfidence', + 'visitor_found' => 'getVisitorFound', + 'first_seen_at' => 'getFirstSeenAt', + 'last_seen_at' => 'getLastSeenAt', + 'visitor_id' => 'getVisitorId']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['request_id'] = isset($data['request_id']) ? $data['request_id'] : null; + $this->container['browser_details'] = isset($data['browser_details']) ? $data['browser_details'] : null; + $this->container['incognito'] = isset($data['incognito']) ? $data['incognito'] : null; + $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; + $this->container['ip_location'] = isset($data['ip_location']) ? $data['ip_location'] : null; + $this->container['timestamp'] = isset($data['timestamp']) ? $data['timestamp'] : null; + $this->container['time'] = isset($data['time']) ? $data['time'] : null; + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + $this->container['linked_id'] = isset($data['linked_id']) ? $data['linked_id'] : null; + $this->container['confidence'] = isset($data['confidence']) ? $data['confidence'] : null; + $this->container['visitor_found'] = isset($data['visitor_found']) ? $data['visitor_found'] : null; + $this->container['first_seen_at'] = isset($data['first_seen_at']) ? $data['first_seen_at'] : null; + $this->container['last_seen_at'] = isset($data['last_seen_at']) ? $data['last_seen_at'] : null; + $this->container['visitor_id'] = isset($data['visitor_id']) ? $data['visitor_id'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; } - + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to getter functions (for serialization of requests). */ - protected $container = []; + public static function getters(): array + { + return self::$getters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * The original name of the model. */ - public function __construct(array $data = null) + public function getModelName(): string { - $this->container['request_id'] = isset($data['request_id']) ? $data['request_id'] : null; - $this->container['browser_details'] = isset($data['browser_details']) ? $data['browser_details'] : null; - $this->container['incognito'] = isset($data['incognito']) ? $data['incognito'] : null; - $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; - $this->container['ip_location'] = isset($data['ip_location']) ? $data['ip_location'] : null; - $this->container['timestamp'] = isset($data['timestamp']) ? $data['timestamp'] : null; - $this->container['time'] = isset($data['time']) ? $data['time'] : null; - $this->container['url'] = isset($data['url']) ? $data['url'] : null; - $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; - $this->container['linked_id'] = isset($data['linked_id']) ? $data['linked_id'] : null; - $this->container['confidence'] = isset($data['confidence']) ? $data['confidence'] : null; - $this->container['visitor_found'] = isset($data['visitor_found']) ? $data['visitor_found'] : null; - $this->container['first_seen_at'] = isset($data['first_seen_at']) ? $data['first_seen_at'] : null; - $this->container['last_seen_at'] = isset($data['last_seen_at']) ? $data['last_seen_at'] : null; - $this->container['visitor_id'] = isset($data['visitor_id']) ? $data['visitor_id'] : null; + return self::$swaggerModelName; } /** @@ -261,79 +257,77 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['request_id'] === null) { + if (null === $this->container['request_id']) { $invalidProperties[] = "'request_id' can't be null"; } - if ($this->container['browser_details'] === null) { + if (null === $this->container['browser_details']) { $invalidProperties[] = "'browser_details' can't be null"; } - if ($this->container['incognito'] === null) { + if (null === $this->container['incognito']) { $invalidProperties[] = "'incognito' can't be null"; } - if ($this->container['ip'] === null) { + if (null === $this->container['ip']) { $invalidProperties[] = "'ip' can't be null"; } - if ($this->container['timestamp'] === null) { + if (null === $this->container['timestamp']) { $invalidProperties[] = "'timestamp' can't be null"; } - if ($this->container['time'] === null) { + if (null === $this->container['time']) { $invalidProperties[] = "'time' can't be null"; } - if ($this->container['url'] === null) { + if (null === $this->container['url']) { $invalidProperties[] = "'url' can't be null"; } - if ($this->container['tag'] === null) { + if (null === $this->container['tag']) { $invalidProperties[] = "'tag' can't be null"; } - if ($this->container['visitor_found'] === null) { + if (null === $this->container['visitor_found']) { $invalidProperties[] = "'visitor_found' can't be null"; } - if ($this->container['first_seen_at'] === null) { + if (null === $this->container['first_seen_at']) { $invalidProperties[] = "'first_seen_at' can't be null"; } - if ($this->container['last_seen_at'] === null) { + if (null === $this->container['last_seen_at']) { $invalidProperties[] = "'last_seen_at' can't be null"; } - if ($this->container['visitor_id'] === null) { + if (null === $this->container['visitor_id']) { $invalidProperties[] = "'visitor_id' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets request_id - * - * @return string + * Gets request_id. */ - public function getRequestId() + public function getRequestId(): string { return $this->container['request_id']; } /** - * Sets request_id + * Sets request_id. * - * @param string $request_id Unique identifier of the user's identification request. + * @param string $request_id unique identifier of the user's identification request * * @return $this */ - public function setRequestId($request_id) + public function setRequestId(string $request_id): self { $this->container['request_id'] = $request_id; @@ -341,23 +335,21 @@ public function setRequestId($request_id) } /** - * Gets browser_details - * - * @return \Fingerprint\ServerAPI\Model\BrowserDetails + * Gets browser_details. */ - public function getBrowserDetails() + public function getBrowserDetails(): BrowserDetails { return $this->container['browser_details']; } /** - * Sets browser_details + * Sets browser_details. * - * @param \Fingerprint\ServerAPI\Model\BrowserDetails $browser_details browser_details + * @param BrowserDetails $browser_details browser_details * * @return $this */ - public function setBrowserDetails($browser_details) + public function setBrowserDetails(BrowserDetails $browser_details): self { $this->container['browser_details'] = $browser_details; @@ -365,23 +357,21 @@ public function setBrowserDetails($browser_details) } /** - * Gets incognito - * - * @return bool + * Gets incognito. */ - public function getIncognito() + public function getIncognito(): bool { return $this->container['incognito']; } /** - * Sets incognito + * Sets incognito. * - * @param bool $incognito Flag if user used incognito session. + * @param bool $incognito flag if user used incognito session * * @return $this */ - public function setIncognito($incognito) + public function setIncognito(bool $incognito): self { $this->container['incognito'] = $incognito; @@ -389,23 +379,21 @@ public function setIncognito($incognito) } /** - * Gets ip - * - * @return string + * Gets ip. */ - public function getIp() + public function getIp(): string { return $this->container['ip']; } /** - * Sets ip + * Sets ip. * * @param string $ip ip * * @return $this */ - public function setIp($ip) + public function setIp(string $ip): self { $this->container['ip'] = $ip; @@ -413,23 +401,23 @@ public function setIp($ip) } /** - * Gets ip_location + * Gets ip_location. * - * @return \Fingerprint\ServerAPI\Model\DeprecatedIPLocation + * @return ?\Fingerprint\ServerAPI\Model\DeprecatedIPLocation */ - public function getIpLocation() + public function getIpLocation(): ?DeprecatedIPLocation { return $this->container['ip_location']; } /** - * Sets ip_location + * Sets ip_location. * - * @param \Fingerprint\ServerAPI\Model\DeprecatedIPLocation $ip_location ip_location + * @param ?\Fingerprint\ServerAPI\Model\DeprecatedIPLocation $ip_location ip_location * * @return $this */ - public function setIpLocation($ip_location) + public function setIpLocation(?DeprecatedIPLocation $ip_location): self { $this->container['ip_location'] = $ip_location; @@ -437,23 +425,21 @@ public function setIpLocation($ip_location) } /** - * Gets timestamp - * - * @return int + * Gets timestamp. */ - public function getTimestamp() + public function getTimestamp(): int { return $this->container['timestamp']; } /** - * Sets timestamp + * Sets timestamp. * - * @param int $timestamp Timestamp of the event with millisecond precision in Unix time. + * @param int $timestamp timestamp of the event with millisecond precision in Unix time * * @return $this */ - public function setTimestamp($timestamp) + public function setTimestamp(int $timestamp): self { $this->container['timestamp'] = $timestamp; @@ -461,23 +447,21 @@ public function setTimestamp($timestamp) } /** - * Gets time - * - * @return \DateTime + * Gets time. */ - public function getTime() + public function getTime(): \DateTime { return $this->container['time']; } /** - * Sets time + * Sets time. * - * @param \DateTime $time Time expressed according to ISO 8601 in UTC format. + * @param \DateTime $time time expressed according to ISO 8601 in UTC format * * @return $this */ - public function setTime($time) + public function setTime(\DateTime $time): self { $this->container['time'] = $time; @@ -485,23 +469,21 @@ public function setTime($time) } /** - * Gets url - * - * @return string + * Gets url. */ - public function getUrl() + public function getUrl(): string { return $this->container['url']; } /** - * Sets url + * Sets url. * - * @param string $url Page URL from which the identification request was sent. + * @param string $url page URL from which the identification request was sent * * @return $this */ - public function setUrl($url) + public function setUrl(string $url): self { $this->container['url'] = $url; @@ -509,23 +491,23 @@ public function setUrl($url) } /** - * Gets tag + * Gets tag. * * @return map[string,object] */ - public function getTag() + public function getTag(): array { return $this->container['tag']; } /** - * Sets tag + * Sets tag. * - * @param map[string,object] $tag A customer-provided value or an object that was sent with identification request. + * @param map[string,object] $tag A customer-provided value or an object that was sent with identification request * * @return $this */ - public function setTag($tag) + public function setTag(array $tag): self { $this->container['tag'] = $tag; @@ -533,23 +515,23 @@ public function setTag($tag) } /** - * Gets linked_id + * Gets linked_id. * - * @return string + * @return ?string */ - public function getLinkedId() + public function getLinkedId(): ?string { return $this->container['linked_id']; } /** - * Sets linked_id + * Sets linked_id. * - * @param string $linked_id A customer-provided id that was sent with identification request. + * @param ?string $linked_id a customer-provided id that was sent with identification request * * @return $this */ - public function setLinkedId($linked_id) + public function setLinkedId(?string $linked_id): self { $this->container['linked_id'] = $linked_id; @@ -557,23 +539,23 @@ public function setLinkedId($linked_id) } /** - * Gets confidence + * Gets confidence. * - * @return \Fingerprint\ServerAPI\Model\Confidence + * @return ?\Fingerprint\ServerAPI\Model\Confidence */ - public function getConfidence() + public function getConfidence(): ?Confidence { return $this->container['confidence']; } /** - * Sets confidence + * Sets confidence. * - * @param \Fingerprint\ServerAPI\Model\Confidence $confidence confidence + * @param ?\Fingerprint\ServerAPI\Model\Confidence $confidence confidence * * @return $this */ - public function setConfidence($confidence) + public function setConfidence(?Confidence $confidence): self { $this->container['confidence'] = $confidence; @@ -581,23 +563,21 @@ public function setConfidence($confidence) } /** - * Gets visitor_found - * - * @return bool + * Gets visitor_found. */ - public function getVisitorFound() + public function getVisitorFound(): bool { return $this->container['visitor_found']; } /** - * Sets visitor_found + * Sets visitor_found. * - * @param bool $visitor_found Attribute represents if a visitor had been identified before. + * @param bool $visitor_found attribute represents if a visitor had been identified before * * @return $this */ - public function setVisitorFound($visitor_found) + public function setVisitorFound(bool $visitor_found): self { $this->container['visitor_found'] = $visitor_found; @@ -605,23 +585,21 @@ public function setVisitorFound($visitor_found) } /** - * Gets first_seen_at - * - * @return \Fingerprint\ServerAPI\Model\SeenAt + * Gets first_seen_at. */ - public function getFirstSeenAt() + public function getFirstSeenAt(): SeenAt { return $this->container['first_seen_at']; } /** - * Sets first_seen_at + * Sets first_seen_at. * - * @param \Fingerprint\ServerAPI\Model\SeenAt $first_seen_at first_seen_at + * @param SeenAt $first_seen_at first_seen_at * * @return $this */ - public function setFirstSeenAt($first_seen_at) + public function setFirstSeenAt(SeenAt $first_seen_at): self { $this->container['first_seen_at'] = $first_seen_at; @@ -629,23 +607,21 @@ public function setFirstSeenAt($first_seen_at) } /** - * Gets last_seen_at - * - * @return \Fingerprint\ServerAPI\Model\SeenAt + * Gets last_seen_at. */ - public function getLastSeenAt() + public function getLastSeenAt(): SeenAt { return $this->container['last_seen_at']; } /** - * Sets last_seen_at + * Sets last_seen_at. * - * @param \Fingerprint\ServerAPI\Model\SeenAt $last_seen_at last_seen_at + * @param SeenAt $last_seen_at last_seen_at * * @return $this */ - public function setLastSeenAt($last_seen_at) + public function setLastSeenAt(SeenAt $last_seen_at): self { $this->container['last_seen_at'] = $last_seen_at; @@ -653,37 +629,33 @@ public function setLastSeenAt($last_seen_at) } /** - * Gets visitor_id - * - * @return string + * Gets visitor_id. */ - public function getVisitorId() + public function getVisitorId(): string { return $this->container['visitor_id']; } /** - * Sets visitor_id + * Sets visitor_id. * - * @param string $visitor_id String of 20 characters that uniquely identifies the visitor's browser. + * @param string $visitor_id string of 20 characters that uniquely identifies the visitor's browser * * @return $this */ - public function setVisitorId($visitor_id) + public function setVisitorId(string $visitor_id): self { $this->container['visitor_id'] = $visitor_id; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -691,12 +663,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -704,13 +673,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -722,30 +688,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/ProxyResult.php b/src/Model/ProxyResult.php index 51f5b296..0ba7fc50 100644 --- a/src/Model/ProxyResult.php +++ b/src/Model/ProxyResult.php @@ -1,17 +1,16 @@ 'bool' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'ProxyResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'bool']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'result' => 'result' ]; + protected static array $attributeMap = [ + 'result' => 'result']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'result' => 'setResult' ]; + protected static array $setters = [ + 'result' => 'setResult']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'result' => 'getResult' ]; + protected static array $getters = [ + 'result' => 'getResult']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,60 +173,56 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return bool + * Gets result. */ - public function getResult() + public function getResult(): bool { return $this->container['result']; } /** - * Sets result + * Sets result. * - * @param bool $result `true` if the request IP address is used by a public proxy provider, `false` otherwise. + * @param bool $result `true` if the request IP address is used by a public proxy provider, `false` otherwise * * @return $this */ - public function setResult($result) + public function setResult(bool $result): self { $this->container['result'] = $result; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -238,12 +230,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -251,13 +240,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -269,30 +255,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/RawDeviceAttributesResult.php b/src/Model/RawDeviceAttributesResult.php index cd96408f..1e560cb3 100644 --- a/src/Model/RawDeviceAttributesResult.php +++ b/src/Model/RawDeviceAttributesResult.php @@ -1,17 +1,16 @@ listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -211,12 +201,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -224,13 +211,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -242,30 +226,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/RemoteControlResult.php b/src/Model/RemoteControlResult.php new file mode 100644 index 00000000..125baf85 --- /dev/null +++ b/src/Model/RemoteControlResult.php @@ -0,0 +1,264 @@ + 'bool']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'result' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'result' => 'result']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'result' => 'setResult']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'result' => 'getResult']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['result'] = isset($data['result']) ? $data['result'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['result']) { + $invalidProperties[] = "'result' 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(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets result. + */ + public function getResult(): bool + { + return $this->container['result']; + } + + /** + * Sets result. + * + * @param bool $result `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. + * + * @return $this + */ + public function setResult(bool $result): self + { + $this->container['result'] = $result; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/Response.php b/src/Model/Response.php index 540abf2a..2aa4f347 100644 --- a/src/Model/Response.php +++ b/src/Model/Response.php @@ -1,17 +1,16 @@ 'string', -'visits' => '\Fingerprint\ServerAPI\Model\ResponseVisits[]', -'last_timestamp' => 'int', -'pagination_key' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'visitor_id' => null, -'visits' => null, -'last_timestamp' => 'int64', -'pagination_key' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'Response'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'visitor_id' => 'string', + 'visits' => '\Fingerprint\ServerAPI\Model\ResponseVisits[]', + 'last_timestamp' => 'int', + 'pagination_key' => 'string']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'visitor_id' => null, + 'visits' => null, + 'last_timestamp' => 'int64', + 'pagination_key' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'visitor_id' => 'visitorId', -'visits' => 'visits', -'last_timestamp' => 'lastTimestamp', -'pagination_key' => 'paginationKey' ]; + 'visits' => 'visits', + 'last_timestamp' => 'lastTimestamp', + 'pagination_key' => 'paginationKey']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'visitor_id' => 'setVisitorId', -'visits' => 'setVisits', -'last_timestamp' => 'setLastTimestamp', -'pagination_key' => 'setPaginationKey' ]; + 'visits' => 'setVisits', + 'last_timestamp' => 'setLastTimestamp', + 'pagination_key' => 'setPaginationKey']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'visitor_id' => 'getVisitorId', -'visits' => 'getVisits', -'last_timestamp' => 'getLastTimestamp', -'pagination_key' => 'getPaginationKey' ]; + 'visits' => 'getVisits', + 'last_timestamp' => 'getLastTimestamp', + 'pagination_key' => 'getPaginationKey']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['visitor_id'] = isset($data['visitor_id']) ? $data['visitor_id'] : null; + $this->container['visits'] = isset($data['visits']) ? $data['visits'] : null; + $this->container['last_timestamp'] = isset($data['last_timestamp']) ? $data['last_timestamp'] : null; + $this->container['pagination_key'] = isset($data['pagination_key']) ? $data['pagination_key'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['visitor_id'] = isset($data['visitor_id']) ? $data['visitor_id'] : null; - $this->container['visits'] = isset($data['visits']) ? $data['visits'] : null; - $this->container['last_timestamp'] = isset($data['last_timestamp']) ? $data['last_timestamp'] : null; - $this->container['pagination_key'] = isset($data['pagination_key']) ? $data['pagination_key'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -196,49 +193,47 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['visitor_id'] === null) { + if (null === $this->container['visitor_id']) { $invalidProperties[] = "'visitor_id' can't be null"; } - if ($this->container['visits'] === null) { + if (null === $this->container['visits']) { $invalidProperties[] = "'visits' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets visitor_id - * - * @return string + * Gets visitor_id. */ - public function getVisitorId() + public function getVisitorId(): string { return $this->container['visitor_id']; } /** - * Sets visitor_id + * Sets visitor_id. * * @param string $visitor_id visitor_id * * @return $this */ - public function setVisitorId($visitor_id) + public function setVisitorId(string $visitor_id): self { $this->container['visitor_id'] = $visitor_id; @@ -246,23 +241,23 @@ public function setVisitorId($visitor_id) } /** - * Gets visits + * Gets visits. * * @return \Fingerprint\ServerAPI\Model\ResponseVisits[] */ - public function getVisits() + public function getVisits(): array { return $this->container['visits']; } /** - * Sets visits + * Sets visits. * * @param \Fingerprint\ServerAPI\Model\ResponseVisits[] $visits visits * * @return $this */ - public function setVisits($visits) + public function setVisits(array $visits): self { $this->container['visits'] = $visits; @@ -270,23 +265,23 @@ public function setVisits($visits) } /** - * Gets last_timestamp + * Gets last_timestamp. * - * @return int + * @return ?int */ - public function getLastTimestamp() + public function getLastTimestamp(): ?int { return $this->container['last_timestamp']; } /** - * Sets last_timestamp + * Sets last_timestamp. * - * @param int $last_timestamp ⚠️ Deprecated paging attribute, please use `paginationKey` instead. Timestamp of the last visit in the current page of results. + * @param ?int $last_timestamp ⚠️ Deprecated paging attribute, please use `paginationKey` instead. Timestamp of the last visit in the current page of results. * * @return $this */ - public function setLastTimestamp($last_timestamp) + public function setLastTimestamp(?int $last_timestamp): self { $this->container['last_timestamp'] = $last_timestamp; @@ -294,37 +289,35 @@ public function setLastTimestamp($last_timestamp) } /** - * Gets pagination_key + * Gets pagination_key. * - * @return string + * @return ?string */ - public function getPaginationKey() + public function getPaginationKey(): ?string { return $this->container['pagination_key']; } /** - * Sets pagination_key + * Sets pagination_key. * - * @param string $pagination_key Request ID of the last visit in the current page of results. Use this value in the following request as the `paginationKey` parameter to get the next page of results. + * @param ?string $pagination_key Request ID of the last visit in the current page of results. Use this value in the following request as the `paginationKey` parameter to get the next page of results. * * @return $this */ - public function setPaginationKey($pagination_key) + public function setPaginationKey(?string $pagination_key): self { $this->container['pagination_key'] = $pagination_key; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -332,12 +325,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -345,13 +335,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -363,30 +350,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/ResponseVisits.php b/src/Model/ResponseVisits.php index 9f72d757..e3b67f55 100644 --- a/src/Model/ResponseVisits.php +++ b/src/Model/ResponseVisits.php @@ -1,17 +1,16 @@ 'string', -'browser_details' => '\Fingerprint\ServerAPI\Model\BrowserDetails', -'incognito' => 'bool', -'ip' => 'string', -'ip_location' => '\Fingerprint\ServerAPI\Model\DeprecatedIPLocation', -'timestamp' => 'int', -'time' => '\DateTime', -'url' => 'string', -'tag' => 'map[string,object]', -'linked_id' => 'string', -'confidence' => '\Fingerprint\ServerAPI\Model\Confidence', -'visitor_found' => 'bool', -'first_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt', -'last_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'request_id' => null, -'browser_details' => null, -'incognito' => null, -'ip' => 'ipv4', -'ip_location' => null, -'timestamp' => 'int64', -'time' => 'date-time', -'url' => null, -'tag' => null, -'linked_id' => null, -'confidence' => null, -'visitor_found' => null, -'first_seen_at' => null, -'last_seen_at' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'ResponseVisits'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization + protected static array $swaggerTypes = [ + 'request_id' => 'string', + 'browser_details' => '\Fingerprint\ServerAPI\Model\BrowserDetails', + 'incognito' => 'bool', + 'ip' => 'string', + 'ip_location' => '\Fingerprint\ServerAPI\Model\DeprecatedIPLocation', + 'timestamp' => 'int', + 'time' => '\DateTime', + 'url' => 'string', + 'tag' => 'map[string,object]', + 'linked_id' => 'string', + 'confidence' => '\Fingerprint\ServerAPI\Model\Confidence', + 'visitor_found' => 'bool', + 'first_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt', + 'last_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt']; + + /** + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'request_id' => null, + 'browser_details' => null, + 'incognito' => null, + 'ip' => 'ipv4', + 'ip_location' => null, + 'timestamp' => 'int64', + 'time' => 'date-time', + 'url' => null, + 'tag' => null, + 'linked_id' => null, + 'confidence' => null, + 'visitor_found' => null, + 'first_seen_at' => null, + 'last_seen_at' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'request_id' => 'requestId', -'browser_details' => 'browserDetails', -'incognito' => 'incognito', -'ip' => 'ip', -'ip_location' => 'ipLocation', -'timestamp' => 'timestamp', -'time' => 'time', -'url' => 'url', -'tag' => 'tag', -'linked_id' => 'linkedId', -'confidence' => 'confidence', -'visitor_found' => 'visitorFound', -'first_seen_at' => 'firstSeenAt', -'last_seen_at' => 'lastSeenAt' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) + 'browser_details' => 'browserDetails', + 'incognito' => 'incognito', + 'ip' => 'ip', + 'ip_location' => 'ipLocation', + 'timestamp' => 'timestamp', + 'time' => 'time', + 'url' => 'url', + 'tag' => 'tag', + 'linked_id' => 'linkedId', + 'confidence' => 'confidence', + 'visitor_found' => 'visitorFound', + 'first_seen_at' => 'firstSeenAt', + 'last_seen_at' => 'lastSeenAt']; + + /** + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'request_id' => 'setRequestId', -'browser_details' => 'setBrowserDetails', -'incognito' => 'setIncognito', -'ip' => 'setIp', -'ip_location' => 'setIpLocation', -'timestamp' => 'setTimestamp', -'time' => 'setTime', -'url' => 'setUrl', -'tag' => 'setTag', -'linked_id' => 'setLinkedId', -'confidence' => 'setConfidence', -'visitor_found' => 'setVisitorFound', -'first_seen_at' => 'setFirstSeenAt', -'last_seen_at' => 'setLastSeenAt' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) + 'browser_details' => 'setBrowserDetails', + 'incognito' => 'setIncognito', + 'ip' => 'setIp', + 'ip_location' => 'setIpLocation', + 'timestamp' => 'setTimestamp', + 'time' => 'setTime', + 'url' => 'setUrl', + 'tag' => 'setTag', + 'linked_id' => 'setLinkedId', + 'confidence' => 'setConfidence', + 'visitor_found' => 'setVisitorFound', + 'first_seen_at' => 'setFirstSeenAt', + 'last_seen_at' => 'setLastSeenAt']; + + /** + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'request_id' => 'getRequestId', -'browser_details' => 'getBrowserDetails', -'incognito' => 'getIncognito', -'ip' => 'getIp', -'ip_location' => 'getIpLocation', -'timestamp' => 'getTimestamp', -'time' => 'getTime', -'url' => 'getUrl', -'tag' => 'getTag', -'linked_id' => 'getLinkedId', -'confidence' => 'getConfidence', -'visitor_found' => 'getVisitorFound', -'first_seen_at' => 'getFirstSeenAt', -'last_seen_at' => 'getLastSeenAt' ]; + 'browser_details' => 'getBrowserDetails', + 'incognito' => 'getIncognito', + 'ip' => 'getIp', + 'ip_location' => 'getIpLocation', + 'timestamp' => 'getTimestamp', + 'time' => 'getTime', + 'url' => 'getUrl', + 'tag' => 'getTag', + 'linked_id' => 'getLinkedId', + 'confidence' => 'getConfidence', + 'visitor_found' => 'getVisitorFound', + 'first_seen_at' => 'getFirstSeenAt', + 'last_seen_at' => 'getLastSeenAt']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['request_id'] = isset($data['request_id']) ? $data['request_id'] : null; + $this->container['browser_details'] = isset($data['browser_details']) ? $data['browser_details'] : null; + $this->container['incognito'] = isset($data['incognito']) ? $data['incognito'] : null; + $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; + $this->container['ip_location'] = isset($data['ip_location']) ? $data['ip_location'] : null; + $this->container['timestamp'] = isset($data['timestamp']) ? $data['timestamp'] : null; + $this->container['time'] = isset($data['time']) ? $data['time'] : null; + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + $this->container['linked_id'] = isset($data['linked_id']) ? $data['linked_id'] : null; + $this->container['confidence'] = isset($data['confidence']) ? $data['confidence'] : null; + $this->container['visitor_found'] = isset($data['visitor_found']) ? $data['visitor_found'] : null; + $this->container['first_seen_at'] = isset($data['first_seen_at']) ? $data['first_seen_at'] : null; + $this->container['last_seen_at'] = isset($data['last_seen_at']) ? $data['last_seen_at'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['request_id'] = isset($data['request_id']) ? $data['request_id'] : null; - $this->container['browser_details'] = isset($data['browser_details']) ? $data['browser_details'] : null; - $this->container['incognito'] = isset($data['incognito']) ? $data['incognito'] : null; - $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; - $this->container['ip_location'] = isset($data['ip_location']) ? $data['ip_location'] : null; - $this->container['timestamp'] = isset($data['timestamp']) ? $data['timestamp'] : null; - $this->container['time'] = isset($data['time']) ? $data['time'] : null; - $this->container['url'] = isset($data['url']) ? $data['url'] : null; - $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; - $this->container['linked_id'] = isset($data['linked_id']) ? $data['linked_id'] : null; - $this->container['confidence'] = isset($data['confidence']) ? $data['confidence'] : null; - $this->container['visitor_found'] = isset($data['visitor_found']) ? $data['visitor_found'] : null; - $this->container['first_seen_at'] = isset($data['first_seen_at']) ? $data['first_seen_at'] : null; - $this->container['last_seen_at'] = isset($data['last_seen_at']) ? $data['last_seen_at'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -255,76 +251,74 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['request_id'] === null) { + if (null === $this->container['request_id']) { $invalidProperties[] = "'request_id' can't be null"; } - if ($this->container['browser_details'] === null) { + if (null === $this->container['browser_details']) { $invalidProperties[] = "'browser_details' can't be null"; } - if ($this->container['incognito'] === null) { + if (null === $this->container['incognito']) { $invalidProperties[] = "'incognito' can't be null"; } - if ($this->container['ip'] === null) { + if (null === $this->container['ip']) { $invalidProperties[] = "'ip' can't be null"; } - if ($this->container['timestamp'] === null) { + if (null === $this->container['timestamp']) { $invalidProperties[] = "'timestamp' can't be null"; } - if ($this->container['time'] === null) { + if (null === $this->container['time']) { $invalidProperties[] = "'time' can't be null"; } - if ($this->container['url'] === null) { + if (null === $this->container['url']) { $invalidProperties[] = "'url' can't be null"; } - if ($this->container['tag'] === null) { + if (null === $this->container['tag']) { $invalidProperties[] = "'tag' can't be null"; } - if ($this->container['visitor_found'] === null) { + if (null === $this->container['visitor_found']) { $invalidProperties[] = "'visitor_found' can't be null"; } - if ($this->container['first_seen_at'] === null) { + if (null === $this->container['first_seen_at']) { $invalidProperties[] = "'first_seen_at' can't be null"; } - if ($this->container['last_seen_at'] === null) { + if (null === $this->container['last_seen_at']) { $invalidProperties[] = "'last_seen_at' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets request_id - * - * @return string + * Gets request_id. */ - public function getRequestId() + public function getRequestId(): string { return $this->container['request_id']; } /** - * Sets request_id + * Sets request_id. * - * @param string $request_id Unique identifier of the user's identification request. + * @param string $request_id unique identifier of the user's identification request * * @return $this */ - public function setRequestId($request_id) + public function setRequestId(string $request_id): self { $this->container['request_id'] = $request_id; @@ -332,23 +326,21 @@ public function setRequestId($request_id) } /** - * Gets browser_details - * - * @return \Fingerprint\ServerAPI\Model\BrowserDetails + * Gets browser_details. */ - public function getBrowserDetails() + public function getBrowserDetails(): BrowserDetails { return $this->container['browser_details']; } /** - * Sets browser_details + * Sets browser_details. * - * @param \Fingerprint\ServerAPI\Model\BrowserDetails $browser_details browser_details + * @param BrowserDetails $browser_details browser_details * * @return $this */ - public function setBrowserDetails($browser_details) + public function setBrowserDetails(BrowserDetails $browser_details): self { $this->container['browser_details'] = $browser_details; @@ -356,23 +348,21 @@ public function setBrowserDetails($browser_details) } /** - * Gets incognito - * - * @return bool + * Gets incognito. */ - public function getIncognito() + public function getIncognito(): bool { return $this->container['incognito']; } /** - * Sets incognito + * Sets incognito. * - * @param bool $incognito Flag if user used incognito session. + * @param bool $incognito flag if user used incognito session * * @return $this */ - public function setIncognito($incognito) + public function setIncognito(bool $incognito): self { $this->container['incognito'] = $incognito; @@ -380,23 +370,21 @@ public function setIncognito($incognito) } /** - * Gets ip - * - * @return string + * Gets ip. */ - public function getIp() + public function getIp(): string { return $this->container['ip']; } /** - * Sets ip + * Sets ip. * * @param string $ip ip * * @return $this */ - public function setIp($ip) + public function setIp(string $ip): self { $this->container['ip'] = $ip; @@ -404,23 +392,23 @@ public function setIp($ip) } /** - * Gets ip_location + * Gets ip_location. * - * @return \Fingerprint\ServerAPI\Model\DeprecatedIPLocation + * @return ?\Fingerprint\ServerAPI\Model\DeprecatedIPLocation */ - public function getIpLocation() + public function getIpLocation(): ?DeprecatedIPLocation { return $this->container['ip_location']; } /** - * Sets ip_location + * Sets ip_location. * - * @param \Fingerprint\ServerAPI\Model\DeprecatedIPLocation $ip_location ip_location + * @param ?\Fingerprint\ServerAPI\Model\DeprecatedIPLocation $ip_location ip_location * * @return $this */ - public function setIpLocation($ip_location) + public function setIpLocation(?DeprecatedIPLocation $ip_location): self { $this->container['ip_location'] = $ip_location; @@ -428,23 +416,21 @@ public function setIpLocation($ip_location) } /** - * Gets timestamp - * - * @return int + * Gets timestamp. */ - public function getTimestamp() + public function getTimestamp(): int { return $this->container['timestamp']; } /** - * Sets timestamp + * Sets timestamp. * - * @param int $timestamp Timestamp of the event with millisecond precision in Unix time. + * @param int $timestamp timestamp of the event with millisecond precision in Unix time * * @return $this */ - public function setTimestamp($timestamp) + public function setTimestamp(int $timestamp): self { $this->container['timestamp'] = $timestamp; @@ -452,23 +438,21 @@ public function setTimestamp($timestamp) } /** - * Gets time - * - * @return \DateTime + * Gets time. */ - public function getTime() + public function getTime(): \DateTime { return $this->container['time']; } /** - * Sets time + * Sets time. * - * @param \DateTime $time Time expressed according to ISO 8601 in UTC format. + * @param \DateTime $time time expressed according to ISO 8601 in UTC format * * @return $this */ - public function setTime($time) + public function setTime(\DateTime $time): self { $this->container['time'] = $time; @@ -476,23 +460,21 @@ public function setTime($time) } /** - * Gets url - * - * @return string + * Gets url. */ - public function getUrl() + public function getUrl(): string { return $this->container['url']; } /** - * Sets url + * Sets url. * - * @param string $url Page URL from which the identification request was sent. + * @param string $url page URL from which the identification request was sent * * @return $this */ - public function setUrl($url) + public function setUrl(string $url): self { $this->container['url'] = $url; @@ -500,23 +482,23 @@ public function setUrl($url) } /** - * Gets tag + * Gets tag. * * @return map[string,object] */ - public function getTag() + public function getTag(): array { return $this->container['tag']; } /** - * Sets tag + * Sets tag. * - * @param map[string,object] $tag A customer-provided value or an object that was sent with identification request. + * @param map[string,object] $tag A customer-provided value or an object that was sent with identification request * * @return $this */ - public function setTag($tag) + public function setTag(array $tag): self { $this->container['tag'] = $tag; @@ -524,23 +506,23 @@ public function setTag($tag) } /** - * Gets linked_id + * Gets linked_id. * - * @return string + * @return ?string */ - public function getLinkedId() + public function getLinkedId(): ?string { return $this->container['linked_id']; } /** - * Sets linked_id + * Sets linked_id. * - * @param string $linked_id A customer-provided id that was sent with identification request. + * @param ?string $linked_id a customer-provided id that was sent with identification request * * @return $this */ - public function setLinkedId($linked_id) + public function setLinkedId(?string $linked_id): self { $this->container['linked_id'] = $linked_id; @@ -548,23 +530,23 @@ public function setLinkedId($linked_id) } /** - * Gets confidence + * Gets confidence. * - * @return \Fingerprint\ServerAPI\Model\Confidence + * @return ?\Fingerprint\ServerAPI\Model\Confidence */ - public function getConfidence() + public function getConfidence(): ?Confidence { return $this->container['confidence']; } /** - * Sets confidence + * Sets confidence. * - * @param \Fingerprint\ServerAPI\Model\Confidence $confidence confidence + * @param ?\Fingerprint\ServerAPI\Model\Confidence $confidence confidence * * @return $this */ - public function setConfidence($confidence) + public function setConfidence(?Confidence $confidence): self { $this->container['confidence'] = $confidence; @@ -572,23 +554,21 @@ public function setConfidence($confidence) } /** - * Gets visitor_found - * - * @return bool + * Gets visitor_found. */ - public function getVisitorFound() + public function getVisitorFound(): bool { return $this->container['visitor_found']; } /** - * Sets visitor_found + * Sets visitor_found. * - * @param bool $visitor_found Attribute represents if a visitor had been identified before. + * @param bool $visitor_found attribute represents if a visitor had been identified before * * @return $this */ - public function setVisitorFound($visitor_found) + public function setVisitorFound(bool $visitor_found): self { $this->container['visitor_found'] = $visitor_found; @@ -596,23 +576,21 @@ public function setVisitorFound($visitor_found) } /** - * Gets first_seen_at - * - * @return \Fingerprint\ServerAPI\Model\SeenAt + * Gets first_seen_at. */ - public function getFirstSeenAt() + public function getFirstSeenAt(): SeenAt { return $this->container['first_seen_at']; } /** - * Sets first_seen_at + * Sets first_seen_at. * - * @param \Fingerprint\ServerAPI\Model\SeenAt $first_seen_at first_seen_at + * @param SeenAt $first_seen_at first_seen_at * * @return $this */ - public function setFirstSeenAt($first_seen_at) + public function setFirstSeenAt(SeenAt $first_seen_at): self { $this->container['first_seen_at'] = $first_seen_at; @@ -620,37 +598,33 @@ public function setFirstSeenAt($first_seen_at) } /** - * Gets last_seen_at - * - * @return \Fingerprint\ServerAPI\Model\SeenAt + * Gets last_seen_at. */ - public function getLastSeenAt() + public function getLastSeenAt(): SeenAt { return $this->container['last_seen_at']; } /** - * Sets last_seen_at + * Sets last_seen_at. * - * @param \Fingerprint\ServerAPI\Model\SeenAt $last_seen_at last_seen_at + * @param SeenAt $last_seen_at last_seen_at * * @return $this */ - public function setLastSeenAt($last_seen_at) + public function setLastSeenAt(SeenAt $last_seen_at): self { $this->container['last_seen_at'] = $last_seen_at; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -658,12 +632,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -671,13 +642,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -689,30 +657,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/RootAppsResult.php b/src/Model/RootAppsResult.php index c1e6eae6..6c1c82cf 100644 --- a/src/Model/RootAppsResult.php +++ b/src/Model/RootAppsResult.php @@ -1,17 +1,16 @@ 'bool' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'RootAppsResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'bool']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'result' => 'result' ]; + protected static array $attributeMap = [ + 'result' => 'result']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'result' => 'setResult' ]; + protected static array $setters = [ + 'result' => 'setResult']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'result' => 'getResult' ]; + protected static array $getters = [ + 'result' => 'getResult']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,60 +173,56 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return bool + * Gets result. */ - public function getResult() + public function getResult(): bool { return $this->container['result']; } /** - * Sets result + * Sets result. * * @param bool $result Android specific root management apps detection. There are 2 values: • `true` - Root Management Apps detected (e.g. Magisk) • `false` - No Root Management Apps detected or the client isn't Android. * * @return $this */ - public function setResult($result) + public function setResult(bool $result): self { $this->container['result'] = $result; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -238,12 +230,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -251,13 +240,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -269,30 +255,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SeenAt.php b/src/Model/SeenAt.php index 17c647fc..29de802d 100644 --- a/src/Model/SeenAt.php +++ b/src/Model/SeenAt.php @@ -1,17 +1,16 @@ '\DateTime', -'subscription' => '\DateTime' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'global' => 'date-time', -'subscription' => 'date-time' ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SeenAt'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'global' => '\DateTime', + 'subscription' => '\DateTime']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'global' => 'date-time', + 'subscription' => 'date-time']; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'global' => 'global', -'subscription' => 'subscription' ]; + 'subscription' => 'subscription']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'global' => 'setGlobal', -'subscription' => 'setSubscription' ]; + 'subscription' => 'setSubscription']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'global' => 'getGlobal', -'subscription' => 'getSubscription' ]; + 'subscription' => 'getSubscription']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['global'] = isset($data['global']) ? $data['global'] : null; + $this->container['subscription'] = isset($data['subscription']) ? $data['subscription'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['global'] = isset($data['global']) ? $data['global'] : null; - $this->container['subscription'] = isset($data['subscription']) ? $data['subscription'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,49 +179,47 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['global'] === null) { + if (null === $this->container['global']) { $invalidProperties[] = "'global' can't be null"; } - if ($this->container['subscription'] === null) { + if (null === $this->container['subscription']) { $invalidProperties[] = "'subscription' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets global - * - * @return \DateTime + * Gets global. */ - public function getGlobal() + public function getGlobal(): \DateTime { return $this->container['global']; } /** - * Sets global + * Sets global. * * @param \DateTime $global global * * @return $this */ - public function setGlobal($global) + public function setGlobal(\DateTime $global): self { $this->container['global'] = $global; @@ -233,37 +227,33 @@ public function setGlobal($global) } /** - * Gets subscription - * - * @return \DateTime + * Gets subscription. */ - public function getSubscription() + public function getSubscription(): \DateTime { return $this->container['subscription']; } /** - * Sets subscription + * Sets subscription. * * @param \DateTime $subscription subscription * * @return $this */ - public function setSubscription($subscription) + public function setSubscription(\DateTime $subscription): self { $this->container['subscription'] = $subscription; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -271,12 +261,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -284,13 +271,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -302,30 +286,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseClonedApp.php b/src/Model/SignalResponseClonedApp.php index 6f1e3658..0edbcaf2 100644 --- a/src/Model/SignalResponseClonedApp.php +++ b/src/Model/SignalResponseClonedApp.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\ClonedAppResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseClonedApp'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\ClonedAppResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\ClonedAppResult + * @return ?\Fingerprint\ServerAPI\Model\ClonedAppResult */ - public function getData() + public function getData(): ?ClonedAppResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\ClonedAppResult $data data + * @param ?\Fingerprint\ServerAPI\Model\ClonedAppResult $data data * * @return $this */ - public function setData($data) + public function setData(?ClonedAppResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseDeveloperTools.php b/src/Model/SignalResponseDeveloperTools.php new file mode 100644 index 00000000..d25d3207 --- /dev/null +++ b/src/Model/SignalResponseDeveloperTools.php @@ -0,0 +1,290 @@ + '\Fingerprint\ServerAPI\Model\DeveloperToolsResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'data' => 'data', + 'error' => 'error']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'data' => 'setData', + 'error' => 'setError']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'data' => 'getData', + 'error' => 'getError']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets data. + * + * @return ?\Fingerprint\ServerAPI\Model\DeveloperToolsResult + */ + public function getData(): ?DeveloperToolsResult + { + return $this->container['data']; + } + + /** + * Sets data. + * + * @param ?\Fingerprint\ServerAPI\Model\DeveloperToolsResult $data data + * + * @return $this + */ + public function setData(?DeveloperToolsResult $data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets error. + * + * @return ?\Fingerprint\ServerAPI\Model\ProductError + */ + public function getError(): ?ProductError + { + return $this->container['error']; + } + + /** + * Sets error. + * + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error + * + * @return $this + */ + public function setError(?ProductError $error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/SignalResponseEmulator.php b/src/Model/SignalResponseEmulator.php index 24e25401..15d6b196 100644 --- a/src/Model/SignalResponseEmulator.php +++ b/src/Model/SignalResponseEmulator.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\EmulatorResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseEmulator'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\EmulatorResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\EmulatorResult + * @return ?\Fingerprint\ServerAPI\Model\EmulatorResult */ - public function getData() + public function getData(): ?EmulatorResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\EmulatorResult $data data + * @param ?\Fingerprint\ServerAPI\Model\EmulatorResult $data data * * @return $this */ - public function setData($data) + public function setData(?EmulatorResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseFactoryReset.php b/src/Model/SignalResponseFactoryReset.php index b0dca3c5..95f0737a 100644 --- a/src/Model/SignalResponseFactoryReset.php +++ b/src/Model/SignalResponseFactoryReset.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\FactoryResetResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseFactoryReset'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\FactoryResetResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\FactoryResetResult + * @return ?\Fingerprint\ServerAPI\Model\FactoryResetResult */ - public function getData() + public function getData(): ?FactoryResetResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\FactoryResetResult $data data + * @param ?\Fingerprint\ServerAPI\Model\FactoryResetResult $data data * * @return $this */ - public function setData($data) + public function setData(?FactoryResetResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseFrida.php b/src/Model/SignalResponseFrida.php index 2f4ada91..86aba169 100644 --- a/src/Model/SignalResponseFrida.php +++ b/src/Model/SignalResponseFrida.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\FridaResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseFrida'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\FridaResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\FridaResult + * @return ?\Fingerprint\ServerAPI\Model\FridaResult */ - public function getData() + public function getData(): ?FridaResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\FridaResult $data data + * @param ?\Fingerprint\ServerAPI\Model\FridaResult $data data * * @return $this */ - public function setData($data) + public function setData(?FridaResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseHighActivity.php b/src/Model/SignalResponseHighActivity.php index 95653e16..9a1e755a 100644 --- a/src/Model/SignalResponseHighActivity.php +++ b/src/Model/SignalResponseHighActivity.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\HighActivityResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseHighActivity'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\HighActivityResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\HighActivityResult + * @return ?\Fingerprint\ServerAPI\Model\HighActivityResult */ - public function getData() + public function getData(): ?HighActivityResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\HighActivityResult $data data + * @param ?\Fingerprint\ServerAPI\Model\HighActivityResult $data data * * @return $this */ - public function setData($data) + public function setData(?HighActivityResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseIncognito.php b/src/Model/SignalResponseIncognito.php index 4d260b01..e8e87138 100644 --- a/src/Model/SignalResponseIncognito.php +++ b/src/Model/SignalResponseIncognito.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\IncognitoResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseIncognito'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\IncognitoResult', + 'error' => '\Fingerprint\ServerAPI\Model\IdentificationError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\IncognitoResult + * @return ?\Fingerprint\ServerAPI\Model\IncognitoResult */ - public function getData() + public function getData(): ?IncognitoResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\IncognitoResult $data data + * @param ?\Fingerprint\ServerAPI\Model\IncognitoResult $data data * * @return $this */ - public function setData($data) + public function setData(?IncognitoResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\IdentificationError */ - public function getError() + public function getError(): ?IdentificationError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\IdentificationError $error error * * @return $this */ - public function setError($error) + public function setError(?IdentificationError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseIpBlocklist.php b/src/Model/SignalResponseIpBlocklist.php index ef458033..00a37d29 100644 --- a/src/Model/SignalResponseIpBlocklist.php +++ b/src/Model/SignalResponseIpBlocklist.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\IpBlockListResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseIpBlocklist'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\IpBlockListResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\IpBlockListResult + * @return ?\Fingerprint\ServerAPI\Model\IpBlockListResult */ - public function getData() + public function getData(): ?IpBlockListResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\IpBlockListResult $data data + * @param ?\Fingerprint\ServerAPI\Model\IpBlockListResult $data data * * @return $this */ - public function setData($data) + public function setData(?IpBlockListResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseIpInfo.php b/src/Model/SignalResponseIpInfo.php index ce532800..48e5fa40 100644 --- a/src/Model/SignalResponseIpInfo.php +++ b/src/Model/SignalResponseIpInfo.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\IpInfoResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseIpInfo'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\IpInfoResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\IpInfoResult + * @return ?\Fingerprint\ServerAPI\Model\IpInfoResult */ - public function getData() + public function getData(): ?IpInfoResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\IpInfoResult $data data + * @param ?\Fingerprint\ServerAPI\Model\IpInfoResult $data data * * @return $this */ - public function setData($data) + public function setData(?IpInfoResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseJailbroken.php b/src/Model/SignalResponseJailbroken.php index ea00612a..5d33f2fe 100644 --- a/src/Model/SignalResponseJailbroken.php +++ b/src/Model/SignalResponseJailbroken.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\JailbrokenResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseJailbroken'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\JailbrokenResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\JailbrokenResult + * @return ?\Fingerprint\ServerAPI\Model\JailbrokenResult */ - public function getData() + public function getData(): ?JailbrokenResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\JailbrokenResult $data data + * @param ?\Fingerprint\ServerAPI\Model\JailbrokenResult $data data * * @return $this */ - public function setData($data) + public function setData(?JailbrokenResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseLocationSpoofing.php b/src/Model/SignalResponseLocationSpoofing.php index 49e498c4..aef5b071 100644 --- a/src/Model/SignalResponseLocationSpoofing.php +++ b/src/Model/SignalResponseLocationSpoofing.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\LocationSpoofingResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseLocationSpoofing'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\LocationSpoofingResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\LocationSpoofingResult + * @return ?\Fingerprint\ServerAPI\Model\LocationSpoofingResult */ - public function getData() + public function getData(): ?LocationSpoofingResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\LocationSpoofingResult $data data + * @param ?\Fingerprint\ServerAPI\Model\LocationSpoofingResult $data data * * @return $this */ - public function setData($data) + public function setData(?LocationSpoofingResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponsePrivacySettings.php b/src/Model/SignalResponsePrivacySettings.php index fb7c9beb..a97c78aa 100644 --- a/src/Model/SignalResponsePrivacySettings.php +++ b/src/Model/SignalResponsePrivacySettings.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\PrivacySettingsResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponsePrivacySettings'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\PrivacySettingsResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\PrivacySettingsResult + * @return ?\Fingerprint\ServerAPI\Model\PrivacySettingsResult */ - public function getData() + public function getData(): ?PrivacySettingsResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\PrivacySettingsResult $data data + * @param ?\Fingerprint\ServerAPI\Model\PrivacySettingsResult $data data * * @return $this */ - public function setData($data) + public function setData(?PrivacySettingsResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseProxy.php b/src/Model/SignalResponseProxy.php index bcb74a95..0f354989 100644 --- a/src/Model/SignalResponseProxy.php +++ b/src/Model/SignalResponseProxy.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\ProxyResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseProxy'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\ProxyResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\ProxyResult + * @return ?\Fingerprint\ServerAPI\Model\ProxyResult */ - public function getData() + public function getData(): ?ProxyResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\ProxyResult $data data + * @param ?\Fingerprint\ServerAPI\Model\ProxyResult $data data * * @return $this */ - public function setData($data) + public function setData(?ProxyResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseRawDeviceAttributes.php b/src/Model/SignalResponseRawDeviceAttributes.php index 44be597f..68a20adc 100644 --- a/src/Model/SignalResponseRawDeviceAttributes.php +++ b/src/Model/SignalResponseRawDeviceAttributes.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\RawDeviceAttributesResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseRawDeviceAttributes'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\RawDeviceAttributesResult', + 'error' => '\Fingerprint\ServerAPI\Model\IdentificationError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\RawDeviceAttributesResult + * @return ?\Fingerprint\ServerAPI\Model\RawDeviceAttributesResult */ - public function getData() + public function getData(): array { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\RawDeviceAttributesResult $data data + * @param ?\Fingerprint\ServerAPI\Model\RawDeviceAttributesResult $data data * * @return $this */ - public function setData($data) + public function setData(?array $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\IdentificationError */ - public function getError() + public function getError(): ?IdentificationError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\IdentificationError $error error * * @return $this */ - public function setError($error) + public function setError(?IdentificationError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseRemoteControl.php b/src/Model/SignalResponseRemoteControl.php new file mode 100644 index 00000000..afec1f39 --- /dev/null +++ b/src/Model/SignalResponseRemoteControl.php @@ -0,0 +1,290 @@ + '\Fingerprint\ServerAPI\Model\RemoteControlResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'data' => 'data', + 'error' => 'error']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'data' => 'setData', + 'error' => 'setError']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'data' => 'getData', + 'error' => 'getError']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets data. + * + * @return ?\Fingerprint\ServerAPI\Model\RemoteControlResult + */ + public function getData(): ?RemoteControlResult + { + return $this->container['data']; + } + + /** + * Sets data. + * + * @param ?\Fingerprint\ServerAPI\Model\RemoteControlResult $data data + * + * @return $this + */ + public function setData(?RemoteControlResult $data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets error. + * + * @return ?\Fingerprint\ServerAPI\Model\ProductError + */ + public function getError(): ?ProductError + { + return $this->container['error']; + } + + /** + * Sets error. + * + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error + * + * @return $this + */ + public function setError(?ProductError $error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/SignalResponseRootApps.php b/src/Model/SignalResponseRootApps.php index 7c602ae9..d5ed6c79 100644 --- a/src/Model/SignalResponseRootApps.php +++ b/src/Model/SignalResponseRootApps.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\RootAppsResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseRootApps'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\RootAppsResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\RootAppsResult + * @return ?\Fingerprint\ServerAPI\Model\RootAppsResult */ - public function getData() + public function getData(): ?RootAppsResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\RootAppsResult $data data + * @param ?\Fingerprint\ServerAPI\Model\RootAppsResult $data data * * @return $this */ - public function setData($data) + public function setData(?RootAppsResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseSuspectScore.php b/src/Model/SignalResponseSuspectScore.php index ff99ef3a..3614acf0 100644 --- a/src/Model/SignalResponseSuspectScore.php +++ b/src/Model/SignalResponseSuspectScore.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\SuspectScoreResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseSuspectScore'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\SuspectScoreResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\SuspectScoreResult + * @return ?\Fingerprint\ServerAPI\Model\SuspectScoreResult */ - public function getData() + public function getData(): ?SuspectScoreResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\SuspectScoreResult $data data + * @param ?\Fingerprint\ServerAPI\Model\SuspectScoreResult $data data * * @return $this */ - public function setData($data) + public function setData(?SuspectScoreResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseTampering.php b/src/Model/SignalResponseTampering.php index 55f261f6..68c818ea 100644 --- a/src/Model/SignalResponseTampering.php +++ b/src/Model/SignalResponseTampering.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\TamperingResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseTampering'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\TamperingResult', + 'error' => '\Fingerprint\ServerAPI\Model\IdentificationError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\TamperingResult + * @return ?\Fingerprint\ServerAPI\Model\TamperingResult */ - public function getData() + public function getData(): ?TamperingResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\TamperingResult $data data + * @param ?\Fingerprint\ServerAPI\Model\TamperingResult $data data * * @return $this */ - public function setData($data) + public function setData(?TamperingResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\IdentificationError */ - public function getError() + public function getError(): ?IdentificationError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\IdentificationError $error error * * @return $this */ - public function setError($error) + public function setError(?IdentificationError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseTor.php b/src/Model/SignalResponseTor.php index 4a580853..06ac9768 100644 --- a/src/Model/SignalResponseTor.php +++ b/src/Model/SignalResponseTor.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\TorResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseTor'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\TorResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\TorResult + * @return ?\Fingerprint\ServerAPI\Model\TorResult */ - public function getData() + public function getData(): ?TorResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\TorResult $data data + * @param ?\Fingerprint\ServerAPI\Model\TorResult $data data * * @return $this */ - public function setData($data) + public function setData(?TorResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseVelocity.php b/src/Model/SignalResponseVelocity.php new file mode 100644 index 00000000..3ccfbdbe --- /dev/null +++ b/src/Model/SignalResponseVelocity.php @@ -0,0 +1,290 @@ + '\Fingerprint\ServerAPI\Model\VelocityResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'data' => 'data', + 'error' => 'error']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'data' => 'setData', + 'error' => 'setError']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'data' => 'getData', + 'error' => 'getError']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets data. + * + * @return ?\Fingerprint\ServerAPI\Model\VelocityResult + */ + public function getData(): ?VelocityResult + { + return $this->container['data']; + } + + /** + * Sets data. + * + * @param ?\Fingerprint\ServerAPI\Model\VelocityResult $data data + * + * @return $this + */ + public function setData(?VelocityResult $data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets error. + * + * @return ?\Fingerprint\ServerAPI\Model\ProductError + */ + public function getError(): ?ProductError + { + return $this->container['error']; + } + + /** + * Sets error. + * + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error + * + * @return $this + */ + public function setError(?ProductError $error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/SignalResponseVirtualMachine.php b/src/Model/SignalResponseVirtualMachine.php index 8a0f878e..906eedd2 100644 --- a/src/Model/SignalResponseVirtualMachine.php +++ b/src/Model/SignalResponseVirtualMachine.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\VirtualMachineResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseVirtualMachine'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\VirtualMachineResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\VirtualMachineResult + * @return ?\Fingerprint\ServerAPI\Model\VirtualMachineResult */ - public function getData() + public function getData(): ?VirtualMachineResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\VirtualMachineResult $data data + * @param ?\Fingerprint\ServerAPI\Model\VirtualMachineResult $data data * * @return $this */ - public function setData($data) + public function setData(?VirtualMachineResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SignalResponseVpn.php b/src/Model/SignalResponseVpn.php index 2a64e9c6..b96d13c5 100644 --- a/src/Model/SignalResponseVpn.php +++ b/src/Model/SignalResponseVpn.php @@ -1,17 +1,16 @@ '\Fingerprint\ServerAPI\Model\VpnResult', -'error' => '\Fingerprint\ServerAPI\Model\ProductError' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'data' => null, -'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SignalResponseVpn'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'data' => '\Fingerprint\ServerAPI\Model\VpnResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'data' => 'data', -'error' => 'error' ]; + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'data' => 'setData', -'error' => 'setError' ]; + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'data' => 'getData', -'error' => 'getError' ]; + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets data + * Gets data. * - * @return \Fingerprint\ServerAPI\Model\VpnResult + * @return ?\Fingerprint\ServerAPI\Model\VpnResult */ - public function getData() + public function getData(): ?VpnResult { return $this->container['data']; } /** - * Sets data + * Sets data. * - * @param \Fingerprint\ServerAPI\Model\VpnResult $data data + * @param ?\Fingerprint\ServerAPI\Model\VpnResult $data data * * @return $this */ - public function setData($data) + public function setData(?VpnResult $data): self { $this->container['data'] = $data; @@ -227,37 +220,35 @@ public function setData($data) } /** - * Gets error + * Gets error. * - * @return \Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\ProductError */ - public function getError() + public function getError(): ?ProductError { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param \Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error * * @return $this */ - public function setError($error) + public function setError(?ProductError $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/Subdivision.php b/src/Model/Subdivision.php index 160c9ce1..0c2835d8 100644 --- a/src/Model/Subdivision.php +++ b/src/Model/Subdivision.php @@ -1,17 +1,16 @@ 'string', -'name' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'iso_code' => null, -'name' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'Subdivision'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'iso_code' => 'string', + 'name' => 'string']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'iso_code' => null, + 'name' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'iso_code' => 'isoCode', -'name' => 'name' ]; + 'name' => 'name']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'iso_code' => 'setIsoCode', -'name' => 'setName' ]; + 'name' => 'setName']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'iso_code' => 'getIsoCode', -'name' => 'getName' ]; + 'name' => 'getName']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['iso_code'] = isset($data['iso_code']) ? $data['iso_code'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['iso_code'] = isset($data['iso_code']) ? $data['iso_code'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,43 +179,40 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - $invalidProperties = []; - - return $invalidProperties; + return []; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets iso_code + * Gets iso_code. * - * @return string + * @return ?string */ - public function getIsoCode() + public function getIsoCode(): ?string { return $this->container['iso_code']; } /** - * Sets iso_code + * Sets iso_code. * - * @param string $iso_code iso_code + * @param ?string $iso_code iso_code * * @return $this */ - public function setIsoCode($iso_code) + public function setIsoCode(?string $iso_code): self { $this->container['iso_code'] = $iso_code; @@ -227,37 +220,35 @@ public function setIsoCode($iso_code) } /** - * Gets name + * Gets name. * - * @return string + * @return ?string */ - public function getName() + public function getName(): ?string { return $this->container['name']; } /** - * Sets name + * Sets name. * - * @param string $name name + * @param ?string $name name * * @return $this */ - public function setName($name) + public function setName(?string $name): self { $this->container['name'] = $name; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -265,12 +256,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -278,13 +266,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -296,30 +281,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/SuspectScoreResult.php b/src/Model/SuspectScoreResult.php index f4847f1a..3225bda1 100644 --- a/src/Model/SuspectScoreResult.php +++ b/src/Model/SuspectScoreResult.php @@ -1,17 +1,16 @@ 'int' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'SuspectScoreResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'int']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'result' => 'result' ]; + protected static array $attributeMap = [ + 'result' => 'result']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'result' => 'setResult' ]; + protected static array $setters = [ + 'result' => 'setResult']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'result' => 'getResult' ]; + protected static array $getters = [ + 'result' => 'getResult']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,60 +173,56 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return int + * Gets result. */ - public function getResult() + public function getResult(): int { return $this->container['result']; } /** - * Sets result + * Sets result. * * @param int $result Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score * * @return $this */ - public function setResult($result) + public function setResult(int $result): self { $this->container['result'] = $result; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -238,12 +230,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -251,13 +240,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -269,30 +255,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/TamperingResult.php b/src/Model/TamperingResult.php index 34800593..e642bcd4 100644 --- a/src/Model/TamperingResult.php +++ b/src/Model/TamperingResult.php @@ -1,17 +1,16 @@ 'bool', -'anomaly_score' => 'float' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null, -'anomaly_score' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'TamperingResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'bool', + 'anomaly_score' => 'float']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null, + 'anomaly_score' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'result' => 'result', -'anomaly_score' => 'anomalyScore' ]; + 'anomaly_score' => 'anomalyScore']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'result' => 'setResult', -'anomaly_score' => 'setAnomalyScore' ]; + 'anomaly_score' => 'setAnomalyScore']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'result' => 'getResult', -'anomaly_score' => 'getAnomalyScore' ]; + 'anomaly_score' => 'getAnomalyScore']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; + $this->container['anomaly_score'] = isset($data['anomaly_score']) ? $data['anomaly_score'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; - $this->container['anomaly_score'] = isset($data['anomaly_score']) ? $data['anomaly_score'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -183,49 +179,47 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } - if ($this->container['anomaly_score'] === null) { + if (null === $this->container['anomaly_score']) { $invalidProperties[] = "'anomaly_score' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return bool + * Gets result. */ - public function getResult() + public function getResult(): bool { return $this->container['result']; } /** - * Sets result + * Sets result. * - * @param bool $result Flag indicating whether browser tampering was detected according to our internal thresholds. + * @param bool $result flag indicating whether browser tampering was detected according to our internal thresholds * * @return $this */ - public function setResult($result) + public function setResult(bool $result): self { $this->container['result'] = $result; @@ -233,37 +227,33 @@ public function setResult($result) } /** - * Gets anomaly_score - * - * @return float + * Gets anomaly_score. */ - public function getAnomalyScore() + public function getAnomalyScore(): float { return $this->container['anomaly_score']; } /** - * Sets anomaly_score + * Sets anomaly_score. * * @param float $anomaly_score Confidence score (`0.0 - 1.0`) for the tampering detection. Values above `0.5` suggest that we're reasonably sure there was a tampering attempt. Values below `0.5` are genuine browsers. * * @return $this */ - public function setAnomalyScore($anomaly_score) + public function setAnomalyScore(float $anomaly_score): self { $this->container['anomaly_score'] = $anomaly_score; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -271,12 +261,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -284,13 +271,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -302,30 +286,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/ManyRequestsResponse.php b/src/Model/TooManyRequestsResponse.php similarity index 56% rename from src/Model/ManyRequestsResponse.php rename to src/Model/TooManyRequestsResponse.php index 292605f8..6034721b 100644 --- a/src/Model/ManyRequestsResponse.php +++ b/src/Model/TooManyRequestsResponse.php @@ -1,17 +1,16 @@ 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'error' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'TooManyRequestsResponse'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'error' => 'string']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'error' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'error' => 'error' ]; + protected static array $attributeMap = [ + 'error' => 'error']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'error' => 'setError' ]; + protected static array $setters = [ + 'error' => 'setError']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'error' => 'getError' ]; + protected static array $getters = [ + 'error' => 'getError']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,60 +173,56 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['error'] === null) { + if (null === $this->container['error']) { $invalidProperties[] = "'error' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets error - * - * @return string + * Gets error. */ - public function getError() + public function getError(): string { return $this->container['error']; } /** - * Sets error + * Sets error. * - * @param string $error Error text. + * @param string $error error text * * @return $this */ - public function setError($error) + public function setError(string $error): self { $this->container['error'] = $error; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -238,12 +230,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -251,13 +240,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -269,30 +255,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/TorResult.php b/src/Model/TorResult.php index 12dc0bf8..c09aeaaf 100644 --- a/src/Model/TorResult.php +++ b/src/Model/TorResult.php @@ -1,17 +1,16 @@ 'bool' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'TorResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'bool']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'result' => 'result' ]; + protected static array $attributeMap = [ + 'result' => 'result']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'result' => 'setResult' ]; + protected static array $setters = [ + 'result' => 'setResult']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'result' => 'getResult' ]; + protected static array $getters = [ + 'result' => 'getResult']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,60 +173,56 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return bool + * Gets result. */ - public function getResult() + public function getResult(): bool { return $this->container['result']; } /** - * Sets result + * Sets result. * - * @param bool $result `true` if the request IP address is a known tor exit node, `false` otherwise. + * @param bool $result `true` if the request IP address is a known tor exit node, `false` otherwise * * @return $this */ - public function setResult($result) + public function setResult(bool $result): self { $this->container['result'] = $result; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -238,12 +230,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -251,13 +240,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -269,30 +255,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/VelocityIntervalResult.php b/src/Model/VelocityIntervalResult.php new file mode 100644 index 00000000..efa97f7d --- /dev/null +++ b/src/Model/VelocityIntervalResult.php @@ -0,0 +1,327 @@ + 'int', + '_1h' => 'int', + '_24h' => 'int']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + '_5m' => null, + '_1h' => null, + '_24h' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + '_5m' => '5m', + '_1h' => '1h', + '_24h' => '24h']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + '_5m' => 'set5m', + '_1h' => 'set1h', + '_24h' => 'set24h']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + '_5m' => 'get5m', + '_1h' => 'get1h', + '_24h' => 'get24h']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['_5m'] = isset($data['_5m']) ? $data['_5m'] : null; + $this->container['_1h'] = isset($data['_1h']) ? $data['_1h'] : null; + $this->container['_24h'] = isset($data['_24h']) ? $data['_24h'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['_5m']) { + $invalidProperties[] = "'_5m' can't be null"; + } + if (null === $this->container['_1h']) { + $invalidProperties[] = "'_1h' 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(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets _5m. + */ + public function get5m(): int + { + return $this->container['_5m']; + } + + /** + * Sets _5m. + * + * @param int $_5m _5m + * + * @return $this + */ + public function set5m(int $_5m): self + { + $this->container['_5m'] = $_5m; + + return $this; + } + + /** + * Gets _1h. + */ + public function get1h(): int + { + return $this->container['_1h']; + } + + /** + * Sets _1h. + * + * @param int $_1h _1h + * + * @return $this + */ + public function set1h(int $_1h): self + { + $this->container['_1h'] = $_1h; + + return $this; + } + + /** + * Gets _24h. + * + * @return ?int + */ + public function get24h(): ?int + { + return $this->container['_24h']; + } + + /** + * Sets _24h. + * + * @param ?int $_24h The `24h` interval of `distinctIp`, `distinctLinkedId`, and `distinctCountry` will be omitted if the number of `events`` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. + * + * @return $this + */ + public function set24h(?int $_24h): self + { + $this->container['_24h'] = $_24h; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/VelocityIntervals.php b/src/Model/VelocityIntervals.php new file mode 100644 index 00000000..f2a84395 --- /dev/null +++ b/src/Model/VelocityIntervals.php @@ -0,0 +1,260 @@ + '\Fingerprint\ServerAPI\Model\VelocityIntervalResult']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'intervals' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'intervals' => 'intervals']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'intervals' => 'setIntervals']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'intervals' => 'getIntervals']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['intervals'] = isset($data['intervals']) ? $data['intervals'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets intervals. + * + * @return ?\Fingerprint\ServerAPI\Model\VelocityIntervalResult + */ + public function getIntervals(): ?VelocityIntervalResult + { + return $this->container['intervals']; + } + + /** + * Sets intervals. + * + * @param ?\Fingerprint\ServerAPI\Model\VelocityIntervalResult $intervals intervals + * + * @return $this + */ + public function setIntervals(?VelocityIntervalResult $intervals): self + { + $this->container['intervals'] = $intervals; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/VelocityResult.php b/src/Model/VelocityResult.php new file mode 100644 index 00000000..5e2a665e --- /dev/null +++ b/src/Model/VelocityResult.php @@ -0,0 +1,359 @@ + '\Fingerprint\ServerAPI\Model\VelocityIntervals', + 'distinct_linked_id' => '\Fingerprint\ServerAPI\Model\VelocityIntervals', + 'distinct_country' => '\Fingerprint\ServerAPI\Model\VelocityIntervals', + 'events' => '\Fingerprint\ServerAPI\Model\VelocityIntervals']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'distinct_ip' => null, + 'distinct_linked_id' => null, + 'distinct_country' => null, + 'events' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'distinct_ip' => 'distinctIp', + 'distinct_linked_id' => 'distinctLinkedId', + 'distinct_country' => 'distinctCountry', + 'events' => 'events']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'distinct_ip' => 'setDistinctIp', + 'distinct_linked_id' => 'setDistinctLinkedId', + 'distinct_country' => 'setDistinctCountry', + 'events' => 'setEvents']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'distinct_ip' => 'getDistinctIp', + 'distinct_linked_id' => 'getDistinctLinkedId', + 'distinct_country' => 'getDistinctCountry', + 'events' => 'getEvents']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['distinct_ip'] = isset($data['distinct_ip']) ? $data['distinct_ip'] : null; + $this->container['distinct_linked_id'] = isset($data['distinct_linked_id']) ? $data['distinct_linked_id'] : null; + $this->container['distinct_country'] = isset($data['distinct_country']) ? $data['distinct_country'] : null; + $this->container['events'] = isset($data['events']) ? $data['events'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['distinct_ip']) { + $invalidProperties[] = "'distinct_ip' can't be null"; + } + if (null === $this->container['distinct_linked_id']) { + $invalidProperties[] = "'distinct_linked_id' can't be null"; + } + if (null === $this->container['distinct_country']) { + $invalidProperties[] = "'distinct_country' can't be null"; + } + if (null === $this->container['events']) { + $invalidProperties[] = "'events' 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(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets distinct_ip. + */ + public function getDistinctIp(): VelocityIntervals + { + return $this->container['distinct_ip']; + } + + /** + * Sets distinct_ip. + * + * @param VelocityIntervals $distinct_ip distinct_ip + * + * @return $this + */ + public function setDistinctIp(VelocityIntervals $distinct_ip): self + { + $this->container['distinct_ip'] = $distinct_ip; + + return $this; + } + + /** + * Gets distinct_linked_id. + */ + public function getDistinctLinkedId(): VelocityIntervals + { + return $this->container['distinct_linked_id']; + } + + /** + * Sets distinct_linked_id. + * + * @param VelocityIntervals $distinct_linked_id distinct_linked_id + * + * @return $this + */ + public function setDistinctLinkedId(VelocityIntervals $distinct_linked_id): self + { + $this->container['distinct_linked_id'] = $distinct_linked_id; + + return $this; + } + + /** + * Gets distinct_country. + */ + public function getDistinctCountry(): VelocityIntervals + { + return $this->container['distinct_country']; + } + + /** + * Sets distinct_country. + * + * @param VelocityIntervals $distinct_country distinct_country + * + * @return $this + */ + public function setDistinctCountry(VelocityIntervals $distinct_country): self + { + $this->container['distinct_country'] = $distinct_country; + + return $this; + } + + /** + * Gets events. + */ + public function getEvents(): VelocityIntervals + { + return $this->container['events']; + } + + /** + * Sets events. + * + * @param VelocityIntervals $events events + * + * @return $this + */ + public function setEvents(VelocityIntervals $events): self + { + $this->container['events'] = $events; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/VirtualMachineResult.php b/src/Model/VirtualMachineResult.php index 4cef9e80..644f9144 100644 --- a/src/Model/VirtualMachineResult.php +++ b/src/Model/VirtualMachineResult.php @@ -1,17 +1,16 @@ 'bool' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'VirtualMachineResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'bool']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ - 'result' => 'result' ]; + protected static array $attributeMap = [ + 'result' => 'result']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ - 'result' => 'setResult' ]; + protected static array $setters = [ + 'result' => 'setResult']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ - 'result' => 'getResult' ]; + protected static array $getters = [ + 'result' => 'getResult']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -177,60 +173,56 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return bool + * Gets result. */ - public function getResult() + public function getResult(): bool { return $this->container['result']; } /** - * Sets result + * Sets result. * * @param bool $result `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. * * @return $this */ - public function setResult($result) + public function setResult(bool $result): self { $this->container['result'] = $result; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -238,12 +230,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -251,13 +240,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -269,30 +255,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/Visit.php b/src/Model/Visit.php index 6ac84e9e..63ad75b2 100644 --- a/src/Model/Visit.php +++ b/src/Model/Visit.php @@ -1,17 +1,16 @@ 'string', -'browser_details' => '\Fingerprint\ServerAPI\Model\BrowserDetails', -'incognito' => 'bool', -'ip' => 'string', -'ip_location' => '\Fingerprint\ServerAPI\Model\DeprecatedIPLocation', -'timestamp' => 'int', -'time' => '\DateTime', -'url' => 'string', -'tag' => 'map[string,object]', -'linked_id' => 'string', -'confidence' => '\Fingerprint\ServerAPI\Model\Confidence', -'visitor_found' => 'bool', -'first_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt', -'last_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'request_id' => null, -'browser_details' => null, -'incognito' => null, -'ip' => 'ipv4', -'ip_location' => null, -'timestamp' => 'int64', -'time' => 'date-time', -'url' => null, -'tag' => null, -'linked_id' => null, -'confidence' => null, -'visitor_found' => null, -'first_seen_at' => null, -'last_seen_at' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'Visit'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization + protected static array $swaggerTypes = [ + 'request_id' => 'string', + 'browser_details' => '\Fingerprint\ServerAPI\Model\BrowserDetails', + 'incognito' => 'bool', + 'ip' => 'string', + 'ip_location' => '\Fingerprint\ServerAPI\Model\DeprecatedIPLocation', + 'timestamp' => 'int', + 'time' => '\DateTime', + 'url' => 'string', + 'tag' => 'map[string,object]', + 'linked_id' => 'string', + 'confidence' => '\Fingerprint\ServerAPI\Model\Confidence', + 'visitor_found' => 'bool', + 'first_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt', + 'last_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt']; + + /** + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'request_id' => null, + 'browser_details' => null, + 'incognito' => null, + 'ip' => 'ipv4', + 'ip_location' => null, + 'timestamp' => 'int64', + 'time' => 'date-time', + 'url' => null, + 'tag' => null, + 'linked_id' => null, + 'confidence' => null, + 'visitor_found' => null, + 'first_seen_at' => null, + 'last_seen_at' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'request_id' => 'requestId', -'browser_details' => 'browserDetails', -'incognito' => 'incognito', -'ip' => 'ip', -'ip_location' => 'ipLocation', -'timestamp' => 'timestamp', -'time' => 'time', -'url' => 'url', -'tag' => 'tag', -'linked_id' => 'linkedId', -'confidence' => 'confidence', -'visitor_found' => 'visitorFound', -'first_seen_at' => 'firstSeenAt', -'last_seen_at' => 'lastSeenAt' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) + 'browser_details' => 'browserDetails', + 'incognito' => 'incognito', + 'ip' => 'ip', + 'ip_location' => 'ipLocation', + 'timestamp' => 'timestamp', + 'time' => 'time', + 'url' => 'url', + 'tag' => 'tag', + 'linked_id' => 'linkedId', + 'confidence' => 'confidence', + 'visitor_found' => 'visitorFound', + 'first_seen_at' => 'firstSeenAt', + 'last_seen_at' => 'lastSeenAt']; + + /** + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'request_id' => 'setRequestId', -'browser_details' => 'setBrowserDetails', -'incognito' => 'setIncognito', -'ip' => 'setIp', -'ip_location' => 'setIpLocation', -'timestamp' => 'setTimestamp', -'time' => 'setTime', -'url' => 'setUrl', -'tag' => 'setTag', -'linked_id' => 'setLinkedId', -'confidence' => 'setConfidence', -'visitor_found' => 'setVisitorFound', -'first_seen_at' => 'setFirstSeenAt', -'last_seen_at' => 'setLastSeenAt' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) + 'browser_details' => 'setBrowserDetails', + 'incognito' => 'setIncognito', + 'ip' => 'setIp', + 'ip_location' => 'setIpLocation', + 'timestamp' => 'setTimestamp', + 'time' => 'setTime', + 'url' => 'setUrl', + 'tag' => 'setTag', + 'linked_id' => 'setLinkedId', + 'confidence' => 'setConfidence', + 'visitor_found' => 'setVisitorFound', + 'first_seen_at' => 'setFirstSeenAt', + 'last_seen_at' => 'setLastSeenAt']; + + /** + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'request_id' => 'getRequestId', -'browser_details' => 'getBrowserDetails', -'incognito' => 'getIncognito', -'ip' => 'getIp', -'ip_location' => 'getIpLocation', -'timestamp' => 'getTimestamp', -'time' => 'getTime', -'url' => 'getUrl', -'tag' => 'getTag', -'linked_id' => 'getLinkedId', -'confidence' => 'getConfidence', -'visitor_found' => 'getVisitorFound', -'first_seen_at' => 'getFirstSeenAt', -'last_seen_at' => 'getLastSeenAt' ]; + 'browser_details' => 'getBrowserDetails', + 'incognito' => 'getIncognito', + 'ip' => 'getIp', + 'ip_location' => 'getIpLocation', + 'timestamp' => 'getTimestamp', + 'time' => 'getTime', + 'url' => 'getUrl', + 'tag' => 'getTag', + 'linked_id' => 'getLinkedId', + 'confidence' => 'getConfidence', + 'visitor_found' => 'getVisitorFound', + 'first_seen_at' => 'getFirstSeenAt', + 'last_seen_at' => 'getLastSeenAt']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['request_id'] = isset($data['request_id']) ? $data['request_id'] : null; + $this->container['browser_details'] = isset($data['browser_details']) ? $data['browser_details'] : null; + $this->container['incognito'] = isset($data['incognito']) ? $data['incognito'] : null; + $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; + $this->container['ip_location'] = isset($data['ip_location']) ? $data['ip_location'] : null; + $this->container['timestamp'] = isset($data['timestamp']) ? $data['timestamp'] : null; + $this->container['time'] = isset($data['time']) ? $data['time'] : null; + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + $this->container['linked_id'] = isset($data['linked_id']) ? $data['linked_id'] : null; + $this->container['confidence'] = isset($data['confidence']) ? $data['confidence'] : null; + $this->container['visitor_found'] = isset($data['visitor_found']) ? $data['visitor_found'] : null; + $this->container['first_seen_at'] = isset($data['first_seen_at']) ? $data['first_seen_at'] : null; + $this->container['last_seen_at'] = isset($data['last_seen_at']) ? $data['last_seen_at'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; } - + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to getter functions (for serialization of requests). */ - protected $container = []; + public static function getters(): array + { + return self::$getters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * The original name of the model. */ - public function __construct(array $data = null) + public function getModelName(): string { - $this->container['request_id'] = isset($data['request_id']) ? $data['request_id'] : null; - $this->container['browser_details'] = isset($data['browser_details']) ? $data['browser_details'] : null; - $this->container['incognito'] = isset($data['incognito']) ? $data['incognito'] : null; - $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; - $this->container['ip_location'] = isset($data['ip_location']) ? $data['ip_location'] : null; - $this->container['timestamp'] = isset($data['timestamp']) ? $data['timestamp'] : null; - $this->container['time'] = isset($data['time']) ? $data['time'] : null; - $this->container['url'] = isset($data['url']) ? $data['url'] : null; - $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; - $this->container['linked_id'] = isset($data['linked_id']) ? $data['linked_id'] : null; - $this->container['confidence'] = isset($data['confidence']) ? $data['confidence'] : null; - $this->container['visitor_found'] = isset($data['visitor_found']) ? $data['visitor_found'] : null; - $this->container['first_seen_at'] = isset($data['first_seen_at']) ? $data['first_seen_at'] : null; - $this->container['last_seen_at'] = isset($data['last_seen_at']) ? $data['last_seen_at'] : null; + return self::$swaggerModelName; } /** @@ -255,76 +251,71 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['request_id'] === null) { + if (null === $this->container['request_id']) { $invalidProperties[] = "'request_id' can't be null"; } - if ($this->container['browser_details'] === null) { + if (null === $this->container['browser_details']) { $invalidProperties[] = "'browser_details' can't be null"; } - if ($this->container['incognito'] === null) { + if (null === $this->container['incognito']) { $invalidProperties[] = "'incognito' can't be null"; } - if ($this->container['ip'] === null) { + if (null === $this->container['ip']) { $invalidProperties[] = "'ip' can't be null"; } - if ($this->container['timestamp'] === null) { + if (null === $this->container['timestamp']) { $invalidProperties[] = "'timestamp' can't be null"; } - if ($this->container['time'] === null) { + if (null === $this->container['time']) { $invalidProperties[] = "'time' can't be null"; } - if ($this->container['url'] === null) { + if (null === $this->container['url']) { $invalidProperties[] = "'url' can't be null"; } - if ($this->container['tag'] === null) { - $invalidProperties[] = "'tag' can't be null"; - } - if ($this->container['visitor_found'] === null) { + if (null === $this->container['visitor_found']) { $invalidProperties[] = "'visitor_found' can't be null"; } - if ($this->container['first_seen_at'] === null) { + if (null === $this->container['first_seen_at']) { $invalidProperties[] = "'first_seen_at' can't be null"; } - if ($this->container['last_seen_at'] === null) { + if (null === $this->container['last_seen_at']) { $invalidProperties[] = "'last_seen_at' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets request_id - * - * @return string + * Gets request_id. */ - public function getRequestId() + public function getRequestId(): string { return $this->container['request_id']; } /** - * Sets request_id + * Sets request_id. * - * @param string $request_id Unique identifier of the user's identification request. + * @param string $request_id unique identifier of the user's identification request * * @return $this */ - public function setRequestId($request_id) + public function setRequestId(string $request_id): self { $this->container['request_id'] = $request_id; @@ -332,23 +323,21 @@ public function setRequestId($request_id) } /** - * Gets browser_details - * - * @return \Fingerprint\ServerAPI\Model\BrowserDetails + * Gets browser_details. */ - public function getBrowserDetails() + public function getBrowserDetails(): BrowserDetails { return $this->container['browser_details']; } /** - * Sets browser_details + * Sets browser_details. * - * @param \Fingerprint\ServerAPI\Model\BrowserDetails $browser_details browser_details + * @param BrowserDetails $browser_details browser_details * * @return $this */ - public function setBrowserDetails($browser_details) + public function setBrowserDetails(BrowserDetails $browser_details): self { $this->container['browser_details'] = $browser_details; @@ -356,23 +345,21 @@ public function setBrowserDetails($browser_details) } /** - * Gets incognito - * - * @return bool + * Gets incognito. */ - public function getIncognito() + public function getIncognito(): bool { return $this->container['incognito']; } /** - * Sets incognito + * Sets incognito. * - * @param bool $incognito Flag if user used incognito session. + * @param bool $incognito flag if user used incognito session * * @return $this */ - public function setIncognito($incognito) + public function setIncognito(bool $incognito): self { $this->container['incognito'] = $incognito; @@ -380,23 +367,21 @@ public function setIncognito($incognito) } /** - * Gets ip - * - * @return string + * Gets ip. */ - public function getIp() + public function getIp(): string { return $this->container['ip']; } /** - * Sets ip + * Sets ip. * * @param string $ip ip * * @return $this */ - public function setIp($ip) + public function setIp(string $ip): self { $this->container['ip'] = $ip; @@ -404,23 +389,23 @@ public function setIp($ip) } /** - * Gets ip_location + * Gets ip_location. * - * @return \Fingerprint\ServerAPI\Model\DeprecatedIPLocation + * @return ?\Fingerprint\ServerAPI\Model\DeprecatedIPLocation */ - public function getIpLocation() + public function getIpLocation(): ?DeprecatedIPLocation { return $this->container['ip_location']; } /** - * Sets ip_location + * Sets ip_location. * - * @param \Fingerprint\ServerAPI\Model\DeprecatedIPLocation $ip_location ip_location + * @param ?\Fingerprint\ServerAPI\Model\DeprecatedIPLocation $ip_location ip_location * * @return $this */ - public function setIpLocation($ip_location) + public function setIpLocation(?DeprecatedIPLocation $ip_location): self { $this->container['ip_location'] = $ip_location; @@ -428,23 +413,21 @@ public function setIpLocation($ip_location) } /** - * Gets timestamp - * - * @return int + * Gets timestamp. */ - public function getTimestamp() + public function getTimestamp(): int { return $this->container['timestamp']; } /** - * Sets timestamp + * Sets timestamp. * - * @param int $timestamp Timestamp of the event with millisecond precision in Unix time. + * @param int $timestamp timestamp of the event with millisecond precision in Unix time * * @return $this */ - public function setTimestamp($timestamp) + public function setTimestamp(int $timestamp): self { $this->container['timestamp'] = $timestamp; @@ -452,23 +435,21 @@ public function setTimestamp($timestamp) } /** - * Gets time - * - * @return \DateTime + * Gets time. */ - public function getTime() + public function getTime(): \DateTime { return $this->container['time']; } /** - * Sets time + * Sets time. * - * @param \DateTime $time Time expressed according to ISO 8601 in UTC format. + * @param \DateTime $time time expressed according to ISO 8601 in UTC format * * @return $this */ - public function setTime($time) + public function setTime(\DateTime $time): self { $this->container['time'] = $time; @@ -476,23 +457,21 @@ public function setTime($time) } /** - * Gets url - * - * @return string + * Gets url. */ - public function getUrl() + public function getUrl(): string { return $this->container['url']; } /** - * Sets url + * Sets url. * - * @param string $url Page URL from which the identification request was sent. + * @param string $url page URL from which the identification request was sent * * @return $this */ - public function setUrl($url) + public function setUrl(string $url): self { $this->container['url'] = $url; @@ -500,23 +479,23 @@ public function setUrl($url) } /** - * Gets tag + * Gets tag. * - * @return map[string,object] + * @return ?map[string,object] */ - public function getTag() + public function getTag(): ?array { return $this->container['tag']; } /** - * Sets tag + * Sets tag. * - * @param map[string,object] $tag A customer-provided value or an object that was sent with identification request. + * @param ?map[string,object] $tag A customer-provided value or an object that was sent with identification request * * @return $this */ - public function setTag($tag) + public function setTag(?array $tag): self { $this->container['tag'] = $tag; @@ -524,23 +503,23 @@ public function setTag($tag) } /** - * Gets linked_id + * Gets linked_id. * - * @return string + * @return ?string */ - public function getLinkedId() + public function getLinkedId(): ?string { return $this->container['linked_id']; } /** - * Sets linked_id + * Sets linked_id. * - * @param string $linked_id A customer-provided id that was sent with identification request. + * @param ?string $linked_id a customer-provided id that was sent with identification request * * @return $this */ - public function setLinkedId($linked_id) + public function setLinkedId(?string $linked_id): self { $this->container['linked_id'] = $linked_id; @@ -548,23 +527,23 @@ public function setLinkedId($linked_id) } /** - * Gets confidence + * Gets confidence. * - * @return \Fingerprint\ServerAPI\Model\Confidence + * @return ?\Fingerprint\ServerAPI\Model\Confidence */ - public function getConfidence() + public function getConfidence(): ?Confidence { return $this->container['confidence']; } /** - * Sets confidence + * Sets confidence. * - * @param \Fingerprint\ServerAPI\Model\Confidence $confidence confidence + * @param ?\Fingerprint\ServerAPI\Model\Confidence $confidence confidence * * @return $this */ - public function setConfidence($confidence) + public function setConfidence(?Confidence $confidence): self { $this->container['confidence'] = $confidence; @@ -572,23 +551,21 @@ public function setConfidence($confidence) } /** - * Gets visitor_found - * - * @return bool + * Gets visitor_found. */ - public function getVisitorFound() + public function getVisitorFound(): bool { return $this->container['visitor_found']; } /** - * Sets visitor_found + * Sets visitor_found. * - * @param bool $visitor_found Attribute represents if a visitor had been identified before. + * @param bool $visitor_found attribute represents if a visitor had been identified before * * @return $this */ - public function setVisitorFound($visitor_found) + public function setVisitorFound(bool $visitor_found): self { $this->container['visitor_found'] = $visitor_found; @@ -596,23 +573,21 @@ public function setVisitorFound($visitor_found) } /** - * Gets first_seen_at - * - * @return \Fingerprint\ServerAPI\Model\SeenAt + * Gets first_seen_at. */ - public function getFirstSeenAt() + public function getFirstSeenAt(): SeenAt { return $this->container['first_seen_at']; } /** - * Sets first_seen_at + * Sets first_seen_at. * - * @param \Fingerprint\ServerAPI\Model\SeenAt $first_seen_at first_seen_at + * @param SeenAt $first_seen_at first_seen_at * * @return $this */ - public function setFirstSeenAt($first_seen_at) + public function setFirstSeenAt(SeenAt $first_seen_at): self { $this->container['first_seen_at'] = $first_seen_at; @@ -620,37 +595,33 @@ public function setFirstSeenAt($first_seen_at) } /** - * Gets last_seen_at - * - * @return \Fingerprint\ServerAPI\Model\SeenAt + * Gets last_seen_at. */ - public function getLastSeenAt() + public function getLastSeenAt(): SeenAt { return $this->container['last_seen_at']; } /** - * Sets last_seen_at + * Sets last_seen_at. * - * @param \Fingerprint\ServerAPI\Model\SeenAt $last_seen_at last_seen_at + * @param SeenAt $last_seen_at last_seen_at * * @return $this */ - public function setLastSeenAt($last_seen_at) + public function setLastSeenAt(SeenAt $last_seen_at): self { $this->container['last_seen_at'] = $last_seen_at; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -658,12 +629,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -671,13 +639,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -689,30 +654,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/VpnResult.php b/src/Model/VpnResult.php index df82623b..2b5651e8 100644 --- a/src/Model/VpnResult.php +++ b/src/Model/VpnResult.php @@ -1,17 +1,16 @@ 'bool', -'origin_timezone' => 'string', -'origin_country' => 'string', -'methods' => '\Fingerprint\ServerAPI\Model\VpnResultMethods' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'result' => null, -'origin_timezone' => null, -'origin_country' => null, -'methods' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'VpnResult'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'result' => 'bool', + 'origin_timezone' => 'string', + 'origin_country' => 'string', + 'methods' => '\Fingerprint\ServerAPI\Model\VpnResultMethods']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'result' => null, + 'origin_timezone' => null, + 'origin_country' => null, + 'methods' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'result' => 'result', -'origin_timezone' => 'originTimezone', -'origin_country' => 'originCountry', -'methods' => 'methods' ]; + 'origin_timezone' => 'originTimezone', + 'origin_country' => 'originCountry', + 'methods' => 'methods']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'result' => 'setResult', -'origin_timezone' => 'setOriginTimezone', -'origin_country' => 'setOriginCountry', -'methods' => 'setMethods' ]; + 'origin_timezone' => 'setOriginTimezone', + 'origin_country' => 'setOriginCountry', + 'methods' => 'setMethods']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'result' => 'getResult', -'origin_timezone' => 'getOriginTimezone', -'origin_country' => 'getOriginCountry', -'methods' => 'getMethods' ]; + 'origin_timezone' => 'getOriginTimezone', + 'origin_country' => 'getOriginCountry', + 'methods' => 'getMethods']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. * - * @return array + * @param mixed[] $data Associated array of property values + * initializing the model */ - public static function attributeMap() + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['result'] = isset($data['result']) ? $data['result'] : null; + $this->container['origin_timezone'] = isset($data['origin_timezone']) ? $data['origin_timezone'] : null; + $this->container['origin_country'] = isset($data['origin_country']) ? $data['origin_country'] : null; + $this->container['methods'] = isset($data['methods']) ? $data['methods'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; } - + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to setter functions (for deserialization of responses). */ - protected $container = []; + public static function setters(): array + { + return self::$setters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * Array of attributes to getter functions (for serialization of requests). */ - public function __construct(array $data = null) + public static function getters(): array { - $this->container['result'] = isset($data['result']) ? $data['result'] : null; - $this->container['origin_timezone'] = isset($data['origin_timezone']) ? $data['origin_timezone'] : null; - $this->container['origin_country'] = isset($data['origin_country']) ? $data['origin_country'] : null; - $this->container['methods'] = isset($data['methods']) ? $data['methods'] : null; + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; } /** @@ -195,52 +191,50 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['result'] === null) { + if (null === $this->container['result']) { $invalidProperties[] = "'result' can't be null"; } - if ($this->container['origin_timezone'] === null) { + if (null === $this->container['origin_timezone']) { $invalidProperties[] = "'origin_timezone' can't be null"; } - if ($this->container['methods'] === null) { + if (null === $this->container['methods']) { $invalidProperties[] = "'methods' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets result - * - * @return bool + * Gets result. */ - public function getResult() + public function getResult(): bool { return $this->container['result']; } /** - * Sets result + * Sets result. * - * @param bool $result VPN or other anonymizing service has been used when sending the request. + * @param bool $result VPN or other anonymizing service has been used when sending the request * * @return $this */ - public function setResult($result) + public function setResult(bool $result): self { $this->container['result'] = $result; @@ -248,23 +242,21 @@ public function setResult($result) } /** - * Gets origin_timezone - * - * @return string + * Gets origin_timezone. */ - public function getOriginTimezone() + public function getOriginTimezone(): string { return $this->container['origin_timezone']; } /** - * Sets origin_timezone + * Sets origin_timezone. * - * @param string $origin_timezone Local timezone which is used in timezoneMismatch method. + * @param string $origin_timezone local timezone which is used in timezoneMismatch method * * @return $this */ - public function setOriginTimezone($origin_timezone) + public function setOriginTimezone(string $origin_timezone): self { $this->container['origin_timezone'] = $origin_timezone; @@ -272,23 +264,23 @@ public function setOriginTimezone($origin_timezone) } /** - * Gets origin_country + * Gets origin_country. * - * @return string + * @return ?string */ - public function getOriginCountry() + public function getOriginCountry(): ?string { return $this->container['origin_country']; } /** - * Sets origin_country + * Sets origin_country. * - * @param string $origin_country Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). + * @param ?string $origin_country Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). * * @return $this */ - public function setOriginCountry($origin_country) + public function setOriginCountry(?string $origin_country): self { $this->container['origin_country'] = $origin_country; @@ -296,37 +288,33 @@ public function setOriginCountry($origin_country) } /** - * Gets methods - * - * @return \Fingerprint\ServerAPI\Model\VpnResultMethods + * Gets methods. */ - public function getMethods() + public function getMethods(): VpnResultMethods { return $this->container['methods']; } /** - * Sets methods + * Sets methods. * - * @param \Fingerprint\ServerAPI\Model\VpnResultMethods $methods methods + * @param VpnResultMethods $methods methods * * @return $this */ - public function setMethods($methods) + public function setMethods(VpnResultMethods $methods): self { $this->container['methods'] = $methods; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -334,12 +322,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -347,13 +332,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -365,30 +347,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/VpnResultMethods.php b/src/Model/VpnResultMethods.php index 7db1af75..36f39b53 100644 --- a/src/Model/VpnResultMethods.php +++ b/src/Model/VpnResultMethods.php @@ -1,17 +1,16 @@ 'bool', -'public_vpn' => 'bool', -'auxiliary_mobile' => 'bool' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'timezone_mismatch' => null, -'public_vpn' => null, -'auxiliary_mobile' => null ]; + * The original name of the model. + */ + protected static string $swaggerModelName = 'VpnResult_methods'; /** - * Array of property to type mappings. Used for (de)serialization + * Array of property to type mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } + protected static array $swaggerTypes = [ + 'timezone_mismatch' => 'bool', + 'public_vpn' => 'bool', + 'auxiliary_mobile' => 'bool', + 'os_mismatch' => 'bool']; /** - * Array of property to format mappings. Used for (de)serialization + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'timezone_mismatch' => null, + 'public_vpn' => null, + 'auxiliary_mobile' => null, + 'os_mismatch' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'timezone_mismatch' => 'timezoneMismatch', -'public_vpn' => 'publicVPN', -'auxiliary_mobile' => 'auxiliaryMobile' ]; + 'public_vpn' => 'publicVPN', + 'auxiliary_mobile' => 'auxiliaryMobile', + 'os_mismatch' => 'osMismatch']; /** - * Array of attributes to setter functions (for deserialization of responses) + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'timezone_mismatch' => 'setTimezoneMismatch', -'public_vpn' => 'setPublicVpn', -'auxiliary_mobile' => 'setAuxiliaryMobile' ]; + 'public_vpn' => 'setPublicVpn', + 'auxiliary_mobile' => 'setAuxiliaryMobile', + 'os_mismatch' => 'setOsMismatch']; /** - * Array of attributes to getter functions (for serialization of requests) + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'timezone_mismatch' => 'getTimezoneMismatch', -'public_vpn' => 'getPublicVpn', -'auxiliary_mobile' => 'getAuxiliaryMobile' ]; + 'public_vpn' => 'getPublicVpn', + 'auxiliary_mobile' => 'getAuxiliaryMobile', + 'os_mismatch' => 'getOsMismatch']; /** - * Array of attributes where the key is the local name, - * and the value is the original name + * Associative array for storing property values. * - * @return array + * @var mixed[] */ - public static function attributeMap() + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) { - return self::$attributeMap; + $this->container['timezone_mismatch'] = isset($data['timezone_mismatch']) ? $data['timezone_mismatch'] : null; + $this->container['public_vpn'] = isset($data['public_vpn']) ? $data['public_vpn'] : null; + $this->container['auxiliary_mobile'] = isset($data['auxiliary_mobile']) ? $data['auxiliary_mobile'] : null; + $this->container['os_mismatch'] = isset($data['os_mismatch']) ? $data['os_mismatch'] : null; } /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array + * Gets the string presentation of the object. */ - public static function setters() + public function __toString(): string { - return self::$setters; + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array + * Array of property to type mappings. Used for (de)serialization. */ - public static function getters() + public static function swaggerTypes(): array { - return self::$getters; + return self::$swaggerTypes; } /** - * The original name of the model. - * - * @return string + * Array of property to format mappings. Used for (de)serialization. */ - public function getModelName() + public static function swaggerFormats(): array { - return self::$swaggerModelName; + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; } - + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } /** - * Associative array for storing property values - * - * @var mixed[] + * Array of attributes to getter functions (for serialization of requests). */ - protected $container = []; + public static function getters(): array + { + return self::$getters; + } /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model + * The original name of the model. */ - public function __construct(array $data = null) + public function getModelName(): string { - $this->container['timezone_mismatch'] = isset($data['timezone_mismatch']) ? $data['timezone_mismatch'] : null; - $this->container['public_vpn'] = isset($data['public_vpn']) ? $data['public_vpn'] : null; - $this->container['auxiliary_mobile'] = isset($data['auxiliary_mobile']) ? $data['auxiliary_mobile'] : null; + return self::$swaggerModelName; } /** @@ -189,52 +191,53 @@ public function __construct(array $data = null) * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['timezone_mismatch'] === null) { + if (null === $this->container['timezone_mismatch']) { $invalidProperties[] = "'timezone_mismatch' can't be null"; } - if ($this->container['public_vpn'] === null) { + if (null === $this->container['public_vpn']) { $invalidProperties[] = "'public_vpn' can't be null"; } - if ($this->container['auxiliary_mobile'] === null) { + if (null === $this->container['auxiliary_mobile']) { $invalidProperties[] = "'auxiliary_mobile' can't be null"; } + if (null === $this->container['os_mismatch']) { + $invalidProperties[] = "'os_mismatch' can't be null"; + } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets timezone_mismatch - * - * @return bool + * Gets timezone_mismatch. */ - public function getTimezoneMismatch() + public function getTimezoneMismatch(): bool { return $this->container['timezone_mismatch']; } /** - * Sets timezone_mismatch + * Sets timezone_mismatch. * - * @param bool $timezone_mismatch User's browser timezone doesn't match the timezone from which the request was originally made. + * @param bool $timezone_mismatch the browser timezone doesn't match the timezone inferred from the request IP address * * @return $this */ - public function setTimezoneMismatch($timezone_mismatch) + public function setTimezoneMismatch(bool $timezone_mismatch): self { $this->container['timezone_mismatch'] = $timezone_mismatch; @@ -242,23 +245,21 @@ public function setTimezoneMismatch($timezone_mismatch) } /** - * Gets public_vpn - * - * @return bool + * Gets public_vpn. */ - public function getPublicVpn() + public function getPublicVpn(): bool { return $this->container['public_vpn']; } /** - * Sets public_vpn + * Sets public_vpn. * - * @param bool $public_vpn Request IP address is owned and used by a public VPN service provider. + * @param bool $public_vpn request IP address is owned and used by a public VPN service provider * * @return $this */ - public function setPublicVpn($public_vpn) + public function setPublicVpn(bool $public_vpn): self { $this->container['public_vpn'] = $public_vpn; @@ -266,37 +267,55 @@ public function setPublicVpn($public_vpn) } /** - * Gets auxiliary_mobile - * - * @return bool + * Gets auxiliary_mobile. */ - public function getAuxiliaryMobile() + public function getAuxiliaryMobile(): bool { return $this->container['auxiliary_mobile']; } /** - * Sets auxiliary_mobile + * Sets auxiliary_mobile. * * @param bool $auxiliary_mobile This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. * * @return $this */ - public function setAuxiliaryMobile($auxiliary_mobile) + public function setAuxiliaryMobile(bool $auxiliary_mobile): self { $this->container['auxiliary_mobile'] = $auxiliary_mobile; return $this; } + /** - * Returns true if offset exists. False otherwise. + * Gets os_mismatch. + */ + public function getOsMismatch(): bool + { + return $this->container['os_mismatch']; + } + + /** + * Sets os_mismatch. * - * @param integer $offset Offset + * @param bool $os_mismatch the browser runs on a different operating system than the operating system inferred from the request network signature * - * @return boolean + * @return $this */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function setOsMismatch(bool $os_mismatch): self + { + $this->container['os_mismatch'] = $os_mismatch; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -304,12 +323,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -317,13 +333,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -335,30 +348,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/Model/WebhookVisit.php b/src/Model/WebhookVisit.php index d073953a..585c084a 100644 --- a/src/Model/WebhookVisit.php +++ b/src/Model/WebhookVisit.php @@ -1,17 +1,16 @@ 'string', -'client_referrer' => 'string', -'user_agent' => 'string', -'bot' => '\Fingerprint\ServerAPI\Model\BotdDetectionResult', -'ip_info' => '\Fingerprint\ServerAPI\Model\IpInfoResult', -'incognito' => 'bool', -'root_apps' => '\Fingerprint\ServerAPI\Model\RootAppsResult', -'emulator' => '\Fingerprint\ServerAPI\Model\EmulatorResult', -'cloned_app' => '\Fingerprint\ServerAPI\Model\ClonedAppResult', -'factory_reset' => '\Fingerprint\ServerAPI\Model\FactoryResetResult', -'jailbroken' => '\Fingerprint\ServerAPI\Model\JailbrokenResult', -'frida' => '\Fingerprint\ServerAPI\Model\FridaResult', -'ip_blocklist' => '\Fingerprint\ServerAPI\Model\IpBlockListResult', -'tor' => '\Fingerprint\ServerAPI\Model\TorResult', -'privacy_settings' => '\Fingerprint\ServerAPI\Model\PrivacySettingsResult', -'virtual_machine' => '\Fingerprint\ServerAPI\Model\VirtualMachineResult', -'vpn' => '\Fingerprint\ServerAPI\Model\VpnResult', -'proxy' => '\Fingerprint\ServerAPI\Model\ProxyResult', -'tampering' => '\Fingerprint\ServerAPI\Model\TamperingResult', -'raw_device_attributes' => '\Fingerprint\ServerAPI\Model\RawDeviceAttributesResult', -'high_activity' => '\Fingerprint\ServerAPI\Model\HighActivityResult', -'location_spoofing' => '\Fingerprint\ServerAPI\Model\LocationSpoofingResult', -'suspect_score' => '\Fingerprint\ServerAPI\Model\SuspectScoreResult', -'request_id' => 'string', -'browser_details' => '\Fingerprint\ServerAPI\Model\BrowserDetails', -'ip' => 'string', -'ip_location' => '\Fingerprint\ServerAPI\Model\DeprecatedIPLocation', -'timestamp' => 'int', -'time' => '\DateTime', -'url' => 'string', -'tag' => 'map[string,object]', -'linked_id' => 'string', -'confidence' => '\Fingerprint\ServerAPI\Model\Confidence', -'visitor_found' => 'bool', -'first_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt', -'last_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'visitor_id' => null, -'client_referrer' => null, -'user_agent' => null, -'bot' => null, -'ip_info' => null, -'incognito' => null, -'root_apps' => null, -'emulator' => null, -'cloned_app' => null, -'factory_reset' => null, -'jailbroken' => null, -'frida' => null, -'ip_blocklist' => null, -'tor' => null, -'privacy_settings' => null, -'virtual_machine' => null, -'vpn' => null, -'proxy' => null, -'tampering' => null, -'raw_device_attributes' => null, -'high_activity' => null, -'location_spoofing' => null, -'suspect_score' => null, -'request_id' => null, -'browser_details' => null, -'ip' => 'ipv4', -'ip_location' => null, -'timestamp' => 'int64', -'time' => 'date-time', -'url' => null, -'tag' => null, -'linked_id' => null, -'confidence' => null, -'visitor_found' => null, -'first_seen_at' => null, -'last_seen_at' => null ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function swaggerTypes() - { - return self::$swaggerTypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization + 'client_referrer' => 'string', + 'user_agent' => 'string', + 'bot' => '\Fingerprint\ServerAPI\Model\BotdDetectionResult', + 'ip_info' => '\Fingerprint\ServerAPI\Model\IpInfoResult', + 'incognito' => 'bool', + 'root_apps' => '\Fingerprint\ServerAPI\Model\RootAppsResult', + 'emulator' => '\Fingerprint\ServerAPI\Model\EmulatorResult', + 'cloned_app' => '\Fingerprint\ServerAPI\Model\ClonedAppResult', + 'factory_reset' => '\Fingerprint\ServerAPI\Model\FactoryResetResult', + 'jailbroken' => '\Fingerprint\ServerAPI\Model\JailbrokenResult', + 'frida' => '\Fingerprint\ServerAPI\Model\FridaResult', + 'ip_blocklist' => '\Fingerprint\ServerAPI\Model\IpBlockListResult', + 'tor' => '\Fingerprint\ServerAPI\Model\TorResult', + 'privacy_settings' => '\Fingerprint\ServerAPI\Model\PrivacySettingsResult', + 'virtual_machine' => '\Fingerprint\ServerAPI\Model\VirtualMachineResult', + 'vpn' => '\Fingerprint\ServerAPI\Model\VpnResult', + 'proxy' => '\Fingerprint\ServerAPI\Model\ProxyResult', + 'tampering' => '\Fingerprint\ServerAPI\Model\TamperingResult', + 'raw_device_attributes' => '\Fingerprint\ServerAPI\Model\RawDeviceAttributesResult', + 'high_activity' => '\Fingerprint\ServerAPI\Model\HighActivityResult', + 'location_spoofing' => '\Fingerprint\ServerAPI\Model\LocationSpoofingResult', + 'suspect_score' => '\Fingerprint\ServerAPI\Model\SuspectScoreResult', + 'remote_control' => '\Fingerprint\ServerAPI\Model\RemoteControlResult', + 'velocity' => '\Fingerprint\ServerAPI\Model\VelocityResult', + 'developer_tools' => '\Fingerprint\ServerAPI\Model\DeveloperToolsResult', + 'request_id' => 'string', + 'browser_details' => '\Fingerprint\ServerAPI\Model\BrowserDetails', + 'ip' => 'string', + 'ip_location' => '\Fingerprint\ServerAPI\Model\DeprecatedIPLocation', + 'timestamp' => 'int', + 'time' => '\DateTime', + 'url' => 'string', + 'tag' => 'map[string,object]', + 'linked_id' => 'string', + 'confidence' => '\Fingerprint\ServerAPI\Model\Confidence', + 'visitor_found' => 'bool', + 'first_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt', + 'last_seen_at' => '\Fingerprint\ServerAPI\Model\SeenAt']; + + /** + * Array of property to format mappings. Used for (de)serialization. * - * @return array + * @var string[] */ - public static function swaggerFormats() - { - return self::$swaggerFormats; - } + protected static array $swaggerFormats = [ + 'visitor_id' => null, + 'client_referrer' => null, + 'user_agent' => null, + 'bot' => null, + 'ip_info' => null, + 'incognito' => null, + 'root_apps' => null, + 'emulator' => null, + 'cloned_app' => null, + 'factory_reset' => null, + 'jailbroken' => null, + 'frida' => null, + 'ip_blocklist' => null, + 'tor' => null, + 'privacy_settings' => null, + 'virtual_machine' => null, + 'vpn' => null, + 'proxy' => null, + 'tampering' => null, + 'raw_device_attributes' => null, + 'high_activity' => null, + 'location_spoofing' => null, + 'suspect_score' => null, + 'remote_control' => null, + 'velocity' => null, + 'developer_tools' => null, + 'request_id' => null, + 'browser_details' => null, + 'ip' => 'ipv4', + 'ip_location' => null, + 'timestamp' => 'int64', + 'time' => 'date-time', + 'url' => null, + 'tag' => null, + 'linked_id' => null, + 'confidence' => null, + 'visitor_found' => null, + 'first_seen_at' => null, + 'last_seen_at' => null]; /** * Array of attributes where the key is the local name, - * and the value is the original name + * and the value is the original name. * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ 'visitor_id' => 'visitorId', -'client_referrer' => 'clientReferrer', -'user_agent' => 'userAgent', -'bot' => 'bot', -'ip_info' => 'ipInfo', -'incognito' => 'incognito', -'root_apps' => 'rootApps', -'emulator' => 'emulator', -'cloned_app' => 'clonedApp', -'factory_reset' => 'factoryReset', -'jailbroken' => 'jailbroken', -'frida' => 'frida', -'ip_blocklist' => 'ipBlocklist', -'tor' => 'tor', -'privacy_settings' => 'privacySettings', -'virtual_machine' => 'virtualMachine', -'vpn' => 'vpn', -'proxy' => 'proxy', -'tampering' => 'tampering', -'raw_device_attributes' => 'rawDeviceAttributes', -'high_activity' => 'highActivity', -'location_spoofing' => 'locationSpoofing', -'suspect_score' => 'suspectScore', -'request_id' => 'requestId', -'browser_details' => 'browserDetails', -'ip' => 'ip', -'ip_location' => 'ipLocation', -'timestamp' => 'timestamp', -'time' => 'time', -'url' => 'url', -'tag' => 'tag', -'linked_id' => 'linkedId', -'confidence' => 'confidence', -'visitor_found' => 'visitorFound', -'first_seen_at' => 'firstSeenAt', -'last_seen_at' => 'lastSeenAt' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) + 'client_referrer' => 'clientReferrer', + 'user_agent' => 'userAgent', + 'bot' => 'bot', + 'ip_info' => 'ipInfo', + 'incognito' => 'incognito', + 'root_apps' => 'rootApps', + 'emulator' => 'emulator', + 'cloned_app' => 'clonedApp', + 'factory_reset' => 'factoryReset', + 'jailbroken' => 'jailbroken', + 'frida' => 'frida', + 'ip_blocklist' => 'ipBlocklist', + 'tor' => 'tor', + 'privacy_settings' => 'privacySettings', + 'virtual_machine' => 'virtualMachine', + 'vpn' => 'vpn', + 'proxy' => 'proxy', + 'tampering' => 'tampering', + 'raw_device_attributes' => 'rawDeviceAttributes', + 'high_activity' => 'highActivity', + 'location_spoofing' => 'locationSpoofing', + 'suspect_score' => 'suspectScore', + 'remote_control' => 'remoteControl', + 'velocity' => 'velocity', + 'developer_tools' => 'developerTools', + 'request_id' => 'requestId', + 'browser_details' => 'browserDetails', + 'ip' => 'ip', + 'ip_location' => 'ipLocation', + 'timestamp' => 'timestamp', + 'time' => 'time', + 'url' => 'url', + 'tag' => 'tag', + 'linked_id' => 'linkedId', + 'confidence' => 'confidence', + 'visitor_found' => 'visitorFound', + 'first_seen_at' => 'firstSeenAt', + 'last_seen_at' => 'lastSeenAt']; + + /** + * Array of attributes to setter functions (for deserialization of responses). * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ 'visitor_id' => 'setVisitorId', -'client_referrer' => 'setClientReferrer', -'user_agent' => 'setUserAgent', -'bot' => 'setBot', -'ip_info' => 'setIpInfo', -'incognito' => 'setIncognito', -'root_apps' => 'setRootApps', -'emulator' => 'setEmulator', -'cloned_app' => 'setClonedApp', -'factory_reset' => 'setFactoryReset', -'jailbroken' => 'setJailbroken', -'frida' => 'setFrida', -'ip_blocklist' => 'setIpBlocklist', -'tor' => 'setTor', -'privacy_settings' => 'setPrivacySettings', -'virtual_machine' => 'setVirtualMachine', -'vpn' => 'setVpn', -'proxy' => 'setProxy', -'tampering' => 'setTampering', -'raw_device_attributes' => 'setRawDeviceAttributes', -'high_activity' => 'setHighActivity', -'location_spoofing' => 'setLocationSpoofing', -'suspect_score' => 'setSuspectScore', -'request_id' => 'setRequestId', -'browser_details' => 'setBrowserDetails', -'ip' => 'setIp', -'ip_location' => 'setIpLocation', -'timestamp' => 'setTimestamp', -'time' => 'setTime', -'url' => 'setUrl', -'tag' => 'setTag', -'linked_id' => 'setLinkedId', -'confidence' => 'setConfidence', -'visitor_found' => 'setVisitorFound', -'first_seen_at' => 'setFirstSeenAt', -'last_seen_at' => 'setLastSeenAt' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) + 'client_referrer' => 'setClientReferrer', + 'user_agent' => 'setUserAgent', + 'bot' => 'setBot', + 'ip_info' => 'setIpInfo', + 'incognito' => 'setIncognito', + 'root_apps' => 'setRootApps', + 'emulator' => 'setEmulator', + 'cloned_app' => 'setClonedApp', + 'factory_reset' => 'setFactoryReset', + 'jailbroken' => 'setJailbroken', + 'frida' => 'setFrida', + 'ip_blocklist' => 'setIpBlocklist', + 'tor' => 'setTor', + 'privacy_settings' => 'setPrivacySettings', + 'virtual_machine' => 'setVirtualMachine', + 'vpn' => 'setVpn', + 'proxy' => 'setProxy', + 'tampering' => 'setTampering', + 'raw_device_attributes' => 'setRawDeviceAttributes', + 'high_activity' => 'setHighActivity', + 'location_spoofing' => 'setLocationSpoofing', + 'suspect_score' => 'setSuspectScore', + 'remote_control' => 'setRemoteControl', + 'velocity' => 'setVelocity', + 'developer_tools' => 'setDeveloperTools', + 'request_id' => 'setRequestId', + 'browser_details' => 'setBrowserDetails', + 'ip' => 'setIp', + 'ip_location' => 'setIpLocation', + 'timestamp' => 'setTimestamp', + 'time' => 'setTime', + 'url' => 'setUrl', + 'tag' => 'setTag', + 'linked_id' => 'setLinkedId', + 'confidence' => 'setConfidence', + 'visitor_found' => 'setVisitorFound', + 'first_seen_at' => 'setFirstSeenAt', + 'last_seen_at' => 'setLastSeenAt']; + + /** + * Array of attributes to getter functions (for serialization of requests). * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ 'visitor_id' => 'getVisitorId', -'client_referrer' => 'getClientReferrer', -'user_agent' => 'getUserAgent', -'bot' => 'getBot', -'ip_info' => 'getIpInfo', -'incognito' => 'getIncognito', -'root_apps' => 'getRootApps', -'emulator' => 'getEmulator', -'cloned_app' => 'getClonedApp', -'factory_reset' => 'getFactoryReset', -'jailbroken' => 'getJailbroken', -'frida' => 'getFrida', -'ip_blocklist' => 'getIpBlocklist', -'tor' => 'getTor', -'privacy_settings' => 'getPrivacySettings', -'virtual_machine' => 'getVirtualMachine', -'vpn' => 'getVpn', -'proxy' => 'getProxy', -'tampering' => 'getTampering', -'raw_device_attributes' => 'getRawDeviceAttributes', -'high_activity' => 'getHighActivity', -'location_spoofing' => 'getLocationSpoofing', -'suspect_score' => 'getSuspectScore', -'request_id' => 'getRequestId', -'browser_details' => 'getBrowserDetails', -'ip' => 'getIp', -'ip_location' => 'getIpLocation', -'timestamp' => 'getTimestamp', -'time' => 'getTime', -'url' => 'getUrl', -'tag' => 'getTag', -'linked_id' => 'getLinkedId', -'confidence' => 'getConfidence', -'visitor_found' => 'getVisitorFound', -'first_seen_at' => 'getFirstSeenAt', -'last_seen_at' => 'getLastSeenAt' ]; - - /** - * 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::$swaggerModelName; - } - - - - /** - * Associative array for storing property values + 'client_referrer' => 'getClientReferrer', + 'user_agent' => 'getUserAgent', + 'bot' => 'getBot', + 'ip_info' => 'getIpInfo', + 'incognito' => 'getIncognito', + 'root_apps' => 'getRootApps', + 'emulator' => 'getEmulator', + 'cloned_app' => 'getClonedApp', + 'factory_reset' => 'getFactoryReset', + 'jailbroken' => 'getJailbroken', + 'frida' => 'getFrida', + 'ip_blocklist' => 'getIpBlocklist', + 'tor' => 'getTor', + 'privacy_settings' => 'getPrivacySettings', + 'virtual_machine' => 'getVirtualMachine', + 'vpn' => 'getVpn', + 'proxy' => 'getProxy', + 'tampering' => 'getTampering', + 'raw_device_attributes' => 'getRawDeviceAttributes', + 'high_activity' => 'getHighActivity', + 'location_spoofing' => 'getLocationSpoofing', + 'suspect_score' => 'getSuspectScore', + 'remote_control' => 'getRemoteControl', + 'velocity' => 'getVelocity', + 'developer_tools' => 'getDeveloperTools', + 'request_id' => 'getRequestId', + 'browser_details' => 'getBrowserDetails', + 'ip' => 'getIp', + 'ip_location' => 'getIpLocation', + 'timestamp' => 'getTimestamp', + 'time' => 'getTime', + 'url' => 'getUrl', + 'tag' => 'getTag', + 'linked_id' => 'getLinkedId', + 'confidence' => 'getConfidence', + 'visitor_found' => 'getVisitorFound', + 'first_seen_at' => 'getFirstSeenAt', + 'last_seen_at' => 'getLastSeenAt']; + + /** + * Associative array for storing property values. * * @var mixed[] */ - protected $container = []; + protected array $container = []; /** - * Constructor + * Constructor. * * @param mixed[] $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->container['visitor_id'] = isset($data['visitor_id']) ? $data['visitor_id'] : null; $this->container['client_referrer'] = isset($data['client_referrer']) ? $data['client_referrer'] : null; @@ -367,6 +314,9 @@ public function __construct(array $data = null) $this->container['high_activity'] = isset($data['high_activity']) ? $data['high_activity'] : null; $this->container['location_spoofing'] = isset($data['location_spoofing']) ? $data['location_spoofing'] : null; $this->container['suspect_score'] = isset($data['suspect_score']) ? $data['suspect_score'] : null; + $this->container['remote_control'] = isset($data['remote_control']) ? $data['remote_control'] : null; + $this->container['velocity'] = isset($data['velocity']) ? $data['velocity'] : null; + $this->container['developer_tools'] = isset($data['developer_tools']) ? $data['developer_tools'] : null; $this->container['request_id'] = isset($data['request_id']) ? $data['request_id'] : null; $this->container['browser_details'] = isset($data['browser_details']) ? $data['browser_details'] : null; $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; @@ -382,84 +332,143 @@ public function __construct(array $data = null) $this->container['last_seen_at'] = isset($data['last_seen_at']) ? $data['last_seen_at'] : null; } + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + /** * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { $invalidProperties = []; - if ($this->container['visitor_id'] === null) { + if (null === $this->container['visitor_id']) { $invalidProperties[] = "'visitor_id' can't be null"; } - if ($this->container['incognito'] === null) { + if (null === $this->container['incognito']) { $invalidProperties[] = "'incognito' can't be null"; } - if ($this->container['request_id'] === null) { + if (null === $this->container['request_id']) { $invalidProperties[] = "'request_id' can't be null"; } - if ($this->container['browser_details'] === null) { + if (null === $this->container['browser_details']) { $invalidProperties[] = "'browser_details' can't be null"; } - if ($this->container['ip'] === null) { + if (null === $this->container['ip']) { $invalidProperties[] = "'ip' can't be null"; } - if ($this->container['timestamp'] === null) { + if (null === $this->container['timestamp']) { $invalidProperties[] = "'timestamp' can't be null"; } - if ($this->container['time'] === null) { + if (null === $this->container['time']) { $invalidProperties[] = "'time' can't be null"; } - if ($this->container['url'] === null) { + if (null === $this->container['url']) { $invalidProperties[] = "'url' can't be null"; } - if ($this->container['tag'] === null) { - $invalidProperties[] = "'tag' can't be null"; - } - if ($this->container['visitor_found'] === null) { + if (null === $this->container['visitor_found']) { $invalidProperties[] = "'visitor_found' can't be null"; } - if ($this->container['first_seen_at'] === null) { + if (null === $this->container['first_seen_at']) { $invalidProperties[] = "'first_seen_at' can't be null"; } - if ($this->container['last_seen_at'] === null) { + if (null === $this->container['last_seen_at']) { $invalidProperties[] = "'last_seen_at' can't be null"; } + return $invalidProperties; } /** * Validate all the properties in the model - * return true if all passed + * return true if all passed. * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { - return count($this->listInvalidProperties()) === 0; + return 0 === count($this->listInvalidProperties()); } - /** - * Gets visitor_id - * - * @return string + * Gets visitor_id. */ - public function getVisitorId() + public function getVisitorId(): string { return $this->container['visitor_id']; } /** - * Sets visitor_id + * Sets visitor_id. * * @param string $visitor_id visitor_id * * @return $this */ - public function setVisitorId($visitor_id) + public function setVisitorId(string $visitor_id): self { $this->container['visitor_id'] = $visitor_id; @@ -467,23 +476,23 @@ public function setVisitorId($visitor_id) } /** - * Gets client_referrer + * Gets client_referrer. * - * @return string + * @return ?string */ - public function getClientReferrer() + public function getClientReferrer(): ?string { return $this->container['client_referrer']; } /** - * Sets client_referrer + * Sets client_referrer. * - * @param string $client_referrer client_referrer + * @param ?string $client_referrer client_referrer * * @return $this */ - public function setClientReferrer($client_referrer) + public function setClientReferrer(?string $client_referrer): self { $this->container['client_referrer'] = $client_referrer; @@ -491,23 +500,23 @@ public function setClientReferrer($client_referrer) } /** - * Gets user_agent + * Gets user_agent. * - * @return string + * @return ?string */ - public function getUserAgent() + public function getUserAgent(): ?string { return $this->container['user_agent']; } /** - * Sets user_agent + * Sets user_agent. * - * @param string $user_agent user_agent + * @param ?string $user_agent user_agent * * @return $this */ - public function setUserAgent($user_agent) + public function setUserAgent(?string $user_agent): self { $this->container['user_agent'] = $user_agent; @@ -515,23 +524,23 @@ public function setUserAgent($user_agent) } /** - * Gets bot + * Gets bot. * - * @return \Fingerprint\ServerAPI\Model\BotdDetectionResult + * @return ?\Fingerprint\ServerAPI\Model\BotdDetectionResult */ - public function getBot() + public function getBot(): ?BotdDetectionResult { return $this->container['bot']; } /** - * Sets bot + * Sets bot. * - * @param \Fingerprint\ServerAPI\Model\BotdDetectionResult $bot bot + * @param ?\Fingerprint\ServerAPI\Model\BotdDetectionResult $bot bot * * @return $this */ - public function setBot($bot) + public function setBot(?BotdDetectionResult $bot): self { $this->container['bot'] = $bot; @@ -539,23 +548,23 @@ public function setBot($bot) } /** - * Gets ip_info + * Gets ip_info. * - * @return \Fingerprint\ServerAPI\Model\IpInfoResult + * @return ?\Fingerprint\ServerAPI\Model\IpInfoResult */ - public function getIpInfo() + public function getIpInfo(): ?IpInfoResult { return $this->container['ip_info']; } /** - * Sets ip_info + * Sets ip_info. * - * @param \Fingerprint\ServerAPI\Model\IpInfoResult $ip_info ip_info + * @param ?\Fingerprint\ServerAPI\Model\IpInfoResult $ip_info ip_info * * @return $this */ - public function setIpInfo($ip_info) + public function setIpInfo(?IpInfoResult $ip_info): self { $this->container['ip_info'] = $ip_info; @@ -563,23 +572,21 @@ public function setIpInfo($ip_info) } /** - * Gets incognito - * - * @return bool + * Gets incognito. */ - public function getIncognito() + public function getIncognito(): bool { return $this->container['incognito']; } /** - * Sets incognito + * Sets incognito. * - * @param bool $incognito Flag if user used incognito session. + * @param bool $incognito flag if user used incognito session * * @return $this */ - public function setIncognito($incognito) + public function setIncognito(bool $incognito): self { $this->container['incognito'] = $incognito; @@ -587,23 +594,23 @@ public function setIncognito($incognito) } /** - * Gets root_apps + * Gets root_apps. * - * @return \Fingerprint\ServerAPI\Model\RootAppsResult + * @return ?\Fingerprint\ServerAPI\Model\RootAppsResult */ - public function getRootApps() + public function getRootApps(): ?RootAppsResult { return $this->container['root_apps']; } /** - * Sets root_apps + * Sets root_apps. * - * @param \Fingerprint\ServerAPI\Model\RootAppsResult $root_apps root_apps + * @param ?\Fingerprint\ServerAPI\Model\RootAppsResult $root_apps root_apps * * @return $this */ - public function setRootApps($root_apps) + public function setRootApps(?RootAppsResult $root_apps): self { $this->container['root_apps'] = $root_apps; @@ -611,23 +618,23 @@ public function setRootApps($root_apps) } /** - * Gets emulator + * Gets emulator. * - * @return \Fingerprint\ServerAPI\Model\EmulatorResult + * @return ?\Fingerprint\ServerAPI\Model\EmulatorResult */ - public function getEmulator() + public function getEmulator(): ?EmulatorResult { return $this->container['emulator']; } /** - * Sets emulator + * Sets emulator. * - * @param \Fingerprint\ServerAPI\Model\EmulatorResult $emulator emulator + * @param ?\Fingerprint\ServerAPI\Model\EmulatorResult $emulator emulator * * @return $this */ - public function setEmulator($emulator) + public function setEmulator(?EmulatorResult $emulator): self { $this->container['emulator'] = $emulator; @@ -635,23 +642,23 @@ public function setEmulator($emulator) } /** - * Gets cloned_app + * Gets cloned_app. * - * @return \Fingerprint\ServerAPI\Model\ClonedAppResult + * @return ?\Fingerprint\ServerAPI\Model\ClonedAppResult */ - public function getClonedApp() + public function getClonedApp(): ?ClonedAppResult { return $this->container['cloned_app']; } /** - * Sets cloned_app + * Sets cloned_app. * - * @param \Fingerprint\ServerAPI\Model\ClonedAppResult $cloned_app cloned_app + * @param ?\Fingerprint\ServerAPI\Model\ClonedAppResult $cloned_app cloned_app * * @return $this */ - public function setClonedApp($cloned_app) + public function setClonedApp(?ClonedAppResult $cloned_app): self { $this->container['cloned_app'] = $cloned_app; @@ -659,23 +666,23 @@ public function setClonedApp($cloned_app) } /** - * Gets factory_reset + * Gets factory_reset. * - * @return \Fingerprint\ServerAPI\Model\FactoryResetResult + * @return ?\Fingerprint\ServerAPI\Model\FactoryResetResult */ - public function getFactoryReset() + public function getFactoryReset(): ?FactoryResetResult { return $this->container['factory_reset']; } /** - * Sets factory_reset + * Sets factory_reset. * - * @param \Fingerprint\ServerAPI\Model\FactoryResetResult $factory_reset factory_reset + * @param ?\Fingerprint\ServerAPI\Model\FactoryResetResult $factory_reset factory_reset * * @return $this */ - public function setFactoryReset($factory_reset) + public function setFactoryReset(?FactoryResetResult $factory_reset): self { $this->container['factory_reset'] = $factory_reset; @@ -683,23 +690,23 @@ public function setFactoryReset($factory_reset) } /** - * Gets jailbroken + * Gets jailbroken. * - * @return \Fingerprint\ServerAPI\Model\JailbrokenResult + * @return ?\Fingerprint\ServerAPI\Model\JailbrokenResult */ - public function getJailbroken() + public function getJailbroken(): ?JailbrokenResult { return $this->container['jailbroken']; } /** - * Sets jailbroken + * Sets jailbroken. * - * @param \Fingerprint\ServerAPI\Model\JailbrokenResult $jailbroken jailbroken + * @param ?\Fingerprint\ServerAPI\Model\JailbrokenResult $jailbroken jailbroken * * @return $this */ - public function setJailbroken($jailbroken) + public function setJailbroken(?JailbrokenResult $jailbroken): self { $this->container['jailbroken'] = $jailbroken; @@ -707,23 +714,23 @@ public function setJailbroken($jailbroken) } /** - * Gets frida + * Gets frida. * - * @return \Fingerprint\ServerAPI\Model\FridaResult + * @return ?\Fingerprint\ServerAPI\Model\FridaResult */ - public function getFrida() + public function getFrida(): ?FridaResult { return $this->container['frida']; } /** - * Sets frida + * Sets frida. * - * @param \Fingerprint\ServerAPI\Model\FridaResult $frida frida + * @param ?\Fingerprint\ServerAPI\Model\FridaResult $frida frida * * @return $this */ - public function setFrida($frida) + public function setFrida(?FridaResult $frida): self { $this->container['frida'] = $frida; @@ -731,23 +738,23 @@ public function setFrida($frida) } /** - * Gets ip_blocklist + * Gets ip_blocklist. * - * @return \Fingerprint\ServerAPI\Model\IpBlockListResult + * @return ?\Fingerprint\ServerAPI\Model\IpBlockListResult */ - public function getIpBlocklist() + public function getIpBlocklist(): ?IpBlockListResult { return $this->container['ip_blocklist']; } /** - * Sets ip_blocklist + * Sets ip_blocklist. * - * @param \Fingerprint\ServerAPI\Model\IpBlockListResult $ip_blocklist ip_blocklist + * @param ?\Fingerprint\ServerAPI\Model\IpBlockListResult $ip_blocklist ip_blocklist * * @return $this */ - public function setIpBlocklist($ip_blocklist) + public function setIpBlocklist(?IpBlockListResult $ip_blocklist): self { $this->container['ip_blocklist'] = $ip_blocklist; @@ -755,23 +762,23 @@ public function setIpBlocklist($ip_blocklist) } /** - * Gets tor + * Gets tor. * - * @return \Fingerprint\ServerAPI\Model\TorResult + * @return ?\Fingerprint\ServerAPI\Model\TorResult */ - public function getTor() + public function getTor(): ?TorResult { return $this->container['tor']; } /** - * Sets tor + * Sets tor. * - * @param \Fingerprint\ServerAPI\Model\TorResult $tor tor + * @param ?\Fingerprint\ServerAPI\Model\TorResult $tor tor * * @return $this */ - public function setTor($tor) + public function setTor(?TorResult $tor): self { $this->container['tor'] = $tor; @@ -779,23 +786,23 @@ public function setTor($tor) } /** - * Gets privacy_settings + * Gets privacy_settings. * - * @return \Fingerprint\ServerAPI\Model\PrivacySettingsResult + * @return ?\Fingerprint\ServerAPI\Model\PrivacySettingsResult */ - public function getPrivacySettings() + public function getPrivacySettings(): ?PrivacySettingsResult { return $this->container['privacy_settings']; } /** - * Sets privacy_settings + * Sets privacy_settings. * - * @param \Fingerprint\ServerAPI\Model\PrivacySettingsResult $privacy_settings privacy_settings + * @param ?\Fingerprint\ServerAPI\Model\PrivacySettingsResult $privacy_settings privacy_settings * * @return $this */ - public function setPrivacySettings($privacy_settings) + public function setPrivacySettings(?PrivacySettingsResult $privacy_settings): self { $this->container['privacy_settings'] = $privacy_settings; @@ -803,23 +810,23 @@ public function setPrivacySettings($privacy_settings) } /** - * Gets virtual_machine + * Gets virtual_machine. * - * @return \Fingerprint\ServerAPI\Model\VirtualMachineResult + * @return ?\Fingerprint\ServerAPI\Model\VirtualMachineResult */ - public function getVirtualMachine() + public function getVirtualMachine(): ?VirtualMachineResult { return $this->container['virtual_machine']; } /** - * Sets virtual_machine + * Sets virtual_machine. * - * @param \Fingerprint\ServerAPI\Model\VirtualMachineResult $virtual_machine virtual_machine + * @param ?\Fingerprint\ServerAPI\Model\VirtualMachineResult $virtual_machine virtual_machine * * @return $this */ - public function setVirtualMachine($virtual_machine) + public function setVirtualMachine(?VirtualMachineResult $virtual_machine): self { $this->container['virtual_machine'] = $virtual_machine; @@ -827,23 +834,23 @@ public function setVirtualMachine($virtual_machine) } /** - * Gets vpn + * Gets vpn. * - * @return \Fingerprint\ServerAPI\Model\VpnResult + * @return ?\Fingerprint\ServerAPI\Model\VpnResult */ - public function getVpn() + public function getVpn(): ?VpnResult { return $this->container['vpn']; } /** - * Sets vpn + * Sets vpn. * - * @param \Fingerprint\ServerAPI\Model\VpnResult $vpn vpn + * @param ?\Fingerprint\ServerAPI\Model\VpnResult $vpn vpn * * @return $this */ - public function setVpn($vpn) + public function setVpn(?VpnResult $vpn): self { $this->container['vpn'] = $vpn; @@ -851,23 +858,23 @@ public function setVpn($vpn) } /** - * Gets proxy + * Gets proxy. * - * @return \Fingerprint\ServerAPI\Model\ProxyResult + * @return ?\Fingerprint\ServerAPI\Model\ProxyResult */ - public function getProxy() + public function getProxy(): ?ProxyResult { return $this->container['proxy']; } /** - * Sets proxy + * Sets proxy. * - * @param \Fingerprint\ServerAPI\Model\ProxyResult $proxy proxy + * @param ?\Fingerprint\ServerAPI\Model\ProxyResult $proxy proxy * * @return $this */ - public function setProxy($proxy) + public function setProxy(?ProxyResult $proxy): self { $this->container['proxy'] = $proxy; @@ -875,23 +882,23 @@ public function setProxy($proxy) } /** - * Gets tampering + * Gets tampering. * - * @return \Fingerprint\ServerAPI\Model\TamperingResult + * @return ?\Fingerprint\ServerAPI\Model\TamperingResult */ - public function getTampering() + public function getTampering(): ?TamperingResult { return $this->container['tampering']; } /** - * Sets tampering + * Sets tampering. * - * @param \Fingerprint\ServerAPI\Model\TamperingResult $tampering tampering + * @param ?\Fingerprint\ServerAPI\Model\TamperingResult $tampering tampering * * @return $this */ - public function setTampering($tampering) + public function setTampering(?TamperingResult $tampering): self { $this->container['tampering'] = $tampering; @@ -899,23 +906,23 @@ public function setTampering($tampering) } /** - * Gets raw_device_attributes + * Gets raw_device_attributes. * - * @return \Fingerprint\ServerAPI\Model\RawDeviceAttributesResult + * @return ?\Fingerprint\ServerAPI\Model\RawDeviceAttributesResult */ - public function getRawDeviceAttributes() + public function getRawDeviceAttributes(): ?RawDeviceAttributesResult { return $this->container['raw_device_attributes']; } /** - * Sets raw_device_attributes + * Sets raw_device_attributes. * - * @param \Fingerprint\ServerAPI\Model\RawDeviceAttributesResult $raw_device_attributes raw_device_attributes + * @param ?\Fingerprint\ServerAPI\Model\RawDeviceAttributesResult $raw_device_attributes raw_device_attributes * * @return $this */ - public function setRawDeviceAttributes($raw_device_attributes) + public function setRawDeviceAttributes(?RawDeviceAttributesResult $raw_device_attributes): self { $this->container['raw_device_attributes'] = $raw_device_attributes; @@ -923,23 +930,23 @@ public function setRawDeviceAttributes($raw_device_attributes) } /** - * Gets high_activity + * Gets high_activity. * - * @return \Fingerprint\ServerAPI\Model\HighActivityResult + * @return ?\Fingerprint\ServerAPI\Model\HighActivityResult */ - public function getHighActivity() + public function getHighActivity(): ?HighActivityResult { return $this->container['high_activity']; } /** - * Sets high_activity + * Sets high_activity. * - * @param \Fingerprint\ServerAPI\Model\HighActivityResult $high_activity high_activity + * @param ?\Fingerprint\ServerAPI\Model\HighActivityResult $high_activity high_activity * * @return $this */ - public function setHighActivity($high_activity) + public function setHighActivity(?HighActivityResult $high_activity): self { $this->container['high_activity'] = $high_activity; @@ -947,23 +954,23 @@ public function setHighActivity($high_activity) } /** - * Gets location_spoofing + * Gets location_spoofing. * - * @return \Fingerprint\ServerAPI\Model\LocationSpoofingResult + * @return ?\Fingerprint\ServerAPI\Model\LocationSpoofingResult */ - public function getLocationSpoofing() + public function getLocationSpoofing(): ?LocationSpoofingResult { return $this->container['location_spoofing']; } /** - * Sets location_spoofing + * Sets location_spoofing. * - * @param \Fingerprint\ServerAPI\Model\LocationSpoofingResult $location_spoofing location_spoofing + * @param ?\Fingerprint\ServerAPI\Model\LocationSpoofingResult $location_spoofing location_spoofing * * @return $this */ - public function setLocationSpoofing($location_spoofing) + public function setLocationSpoofing(?LocationSpoofingResult $location_spoofing): self { $this->container['location_spoofing'] = $location_spoofing; @@ -971,23 +978,23 @@ public function setLocationSpoofing($location_spoofing) } /** - * Gets suspect_score + * Gets suspect_score. * - * @return \Fingerprint\ServerAPI\Model\SuspectScoreResult + * @return ?\Fingerprint\ServerAPI\Model\SuspectScoreResult */ - public function getSuspectScore() + public function getSuspectScore(): ?SuspectScoreResult { return $this->container['suspect_score']; } /** - * Sets suspect_score + * Sets suspect_score. * - * @param \Fingerprint\ServerAPI\Model\SuspectScoreResult $suspect_score suspect_score + * @param ?\Fingerprint\ServerAPI\Model\SuspectScoreResult $suspect_score suspect_score * * @return $this */ - public function setSuspectScore($suspect_score) + public function setSuspectScore(?SuspectScoreResult $suspect_score): self { $this->container['suspect_score'] = $suspect_score; @@ -995,23 +1002,93 @@ public function setSuspectScore($suspect_score) } /** - * Gets request_id + * Gets remote_control. + * + * @return ?\Fingerprint\ServerAPI\Model\RemoteControlResult + */ + public function getRemoteControl(): ?RemoteControlResult + { + return $this->container['remote_control']; + } + + /** + * Sets remote_control. + * + * @param ?\Fingerprint\ServerAPI\Model\RemoteControlResult $remote_control remote_control + * + * @return $this + */ + public function setRemoteControl(?RemoteControlResult $remote_control): self + { + $this->container['remote_control'] = $remote_control; + + return $this; + } + + /** + * Gets velocity. + * + * @return ?\Fingerprint\ServerAPI\Model\VelocityResult + */ + public function getVelocity(): ?VelocityResult + { + return $this->container['velocity']; + } + + /** + * Sets velocity. + * + * @param ?\Fingerprint\ServerAPI\Model\VelocityResult $velocity velocity + * + * @return $this + */ + public function setVelocity(?VelocityResult $velocity): self + { + $this->container['velocity'] = $velocity; + + return $this; + } + + /** + * Gets developer_tools. + * + * @return ?\Fingerprint\ServerAPI\Model\DeveloperToolsResult + */ + public function getDeveloperTools(): ?DeveloperToolsResult + { + return $this->container['developer_tools']; + } + + /** + * Sets developer_tools. + * + * @param ?\Fingerprint\ServerAPI\Model\DeveloperToolsResult $developer_tools developer_tools * - * @return string + * @return $this */ - public function getRequestId() + public function setDeveloperTools(?DeveloperToolsResult $developer_tools): self + { + $this->container['developer_tools'] = $developer_tools; + + return $this; + } + + /** + * Gets request_id. + */ + public function getRequestId(): string { return $this->container['request_id']; } /** - * Sets request_id + * Sets request_id. * - * @param string $request_id Unique identifier of the user's identification request. + * @param string $request_id unique identifier of the user's identification request * * @return $this */ - public function setRequestId($request_id) + public function setRequestId(string $request_id): self { $this->container['request_id'] = $request_id; @@ -1019,23 +1096,21 @@ public function setRequestId($request_id) } /** - * Gets browser_details - * - * @return \Fingerprint\ServerAPI\Model\BrowserDetails + * Gets browser_details. */ - public function getBrowserDetails() + public function getBrowserDetails(): BrowserDetails { return $this->container['browser_details']; } /** - * Sets browser_details + * Sets browser_details. * - * @param \Fingerprint\ServerAPI\Model\BrowserDetails $browser_details browser_details + * @param BrowserDetails $browser_details browser_details * * @return $this */ - public function setBrowserDetails($browser_details) + public function setBrowserDetails(BrowserDetails $browser_details): self { $this->container['browser_details'] = $browser_details; @@ -1043,23 +1118,21 @@ public function setBrowserDetails($browser_details) } /** - * Gets ip - * - * @return string + * Gets ip. */ - public function getIp() + public function getIp(): string { return $this->container['ip']; } /** - * Sets ip + * Sets ip. * * @param string $ip ip * * @return $this */ - public function setIp($ip) + public function setIp(string $ip): self { $this->container['ip'] = $ip; @@ -1067,23 +1140,23 @@ public function setIp($ip) } /** - * Gets ip_location + * Gets ip_location. * - * @return \Fingerprint\ServerAPI\Model\DeprecatedIPLocation + * @return ?\Fingerprint\ServerAPI\Model\DeprecatedIPLocation */ - public function getIpLocation() + public function getIpLocation(): ?DeprecatedIPLocation { return $this->container['ip_location']; } /** - * Sets ip_location + * Sets ip_location. * - * @param \Fingerprint\ServerAPI\Model\DeprecatedIPLocation $ip_location ip_location + * @param ?\Fingerprint\ServerAPI\Model\DeprecatedIPLocation $ip_location ip_location * * @return $this */ - public function setIpLocation($ip_location) + public function setIpLocation(?DeprecatedIPLocation $ip_location): self { $this->container['ip_location'] = $ip_location; @@ -1091,23 +1164,21 @@ public function setIpLocation($ip_location) } /** - * Gets timestamp - * - * @return int + * Gets timestamp. */ - public function getTimestamp() + public function getTimestamp(): int { return $this->container['timestamp']; } /** - * Sets timestamp + * Sets timestamp. * - * @param int $timestamp Timestamp of the event with millisecond precision in Unix time. + * @param int $timestamp timestamp of the event with millisecond precision in Unix time * * @return $this */ - public function setTimestamp($timestamp) + public function setTimestamp(int $timestamp): self { $this->container['timestamp'] = $timestamp; @@ -1115,23 +1186,21 @@ public function setTimestamp($timestamp) } /** - * Gets time - * - * @return \DateTime + * Gets time. */ - public function getTime() + public function getTime(): \DateTime { return $this->container['time']; } /** - * Sets time + * Sets time. * - * @param \DateTime $time Time expressed according to ISO 8601 in UTC format. + * @param \DateTime $time time expressed according to ISO 8601 in UTC format * * @return $this */ - public function setTime($time) + public function setTime(\DateTime $time): self { $this->container['time'] = $time; @@ -1139,23 +1208,21 @@ public function setTime($time) } /** - * Gets url - * - * @return string + * Gets url. */ - public function getUrl() + public function getUrl(): string { return $this->container['url']; } /** - * Sets url + * Sets url. * - * @param string $url Page URL from which the identification request was sent. + * @param string $url page URL from which the identification request was sent * * @return $this */ - public function setUrl($url) + public function setUrl(string $url): self { $this->container['url'] = $url; @@ -1163,23 +1230,23 @@ public function setUrl($url) } /** - * Gets tag + * Gets tag. * - * @return map[string,object] + * @return ?map[string,object] */ - public function getTag() + public function getTag(): ?array { return $this->container['tag']; } /** - * Sets tag + * Sets tag. * - * @param map[string,object] $tag A customer-provided value or an object that was sent with identification request. + * @param ?map[string,object] $tag A customer-provided value or an object that was sent with identification request * * @return $this */ - public function setTag($tag) + public function setTag(?array $tag): self { $this->container['tag'] = $tag; @@ -1187,23 +1254,23 @@ public function setTag($tag) } /** - * Gets linked_id + * Gets linked_id. * - * @return string + * @return ?string */ - public function getLinkedId() + public function getLinkedId(): ?string { return $this->container['linked_id']; } /** - * Sets linked_id + * Sets linked_id. * - * @param string $linked_id A customer-provided id that was sent with identification request. + * @param ?string $linked_id a customer-provided id that was sent with identification request * * @return $this */ - public function setLinkedId($linked_id) + public function setLinkedId(?string $linked_id): self { $this->container['linked_id'] = $linked_id; @@ -1211,23 +1278,23 @@ public function setLinkedId($linked_id) } /** - * Gets confidence + * Gets confidence. * - * @return \Fingerprint\ServerAPI\Model\Confidence + * @return ?\Fingerprint\ServerAPI\Model\Confidence */ - public function getConfidence() + public function getConfidence(): ?Confidence { return $this->container['confidence']; } /** - * Sets confidence + * Sets confidence. * - * @param \Fingerprint\ServerAPI\Model\Confidence $confidence confidence + * @param ?\Fingerprint\ServerAPI\Model\Confidence $confidence confidence * * @return $this */ - public function setConfidence($confidence) + public function setConfidence(?Confidence $confidence): self { $this->container['confidence'] = $confidence; @@ -1235,23 +1302,21 @@ public function setConfidence($confidence) } /** - * Gets visitor_found - * - * @return bool + * Gets visitor_found. */ - public function getVisitorFound() + public function getVisitorFound(): bool { return $this->container['visitor_found']; } /** - * Sets visitor_found + * Sets visitor_found. * - * @param bool $visitor_found Attribute represents if a visitor had been identified before. + * @param bool $visitor_found attribute represents if a visitor had been identified before * * @return $this */ - public function setVisitorFound($visitor_found) + public function setVisitorFound(bool $visitor_found): self { $this->container['visitor_found'] = $visitor_found; @@ -1259,23 +1324,21 @@ public function setVisitorFound($visitor_found) } /** - * Gets first_seen_at - * - * @return \Fingerprint\ServerAPI\Model\SeenAt + * Gets first_seen_at. */ - public function getFirstSeenAt() + public function getFirstSeenAt(): SeenAt { return $this->container['first_seen_at']; } /** - * Sets first_seen_at + * Sets first_seen_at. * - * @param \Fingerprint\ServerAPI\Model\SeenAt $first_seen_at first_seen_at + * @param SeenAt $first_seen_at first_seen_at * * @return $this */ - public function setFirstSeenAt($first_seen_at) + public function setFirstSeenAt(SeenAt $first_seen_at): self { $this->container['first_seen_at'] = $first_seen_at; @@ -1283,37 +1346,33 @@ public function setFirstSeenAt($first_seen_at) } /** - * Gets last_seen_at - * - * @return \Fingerprint\ServerAPI\Model\SeenAt + * Gets last_seen_at. */ - public function getLastSeenAt() + public function getLastSeenAt(): SeenAt { return $this->container['last_seen_at']; } /** - * Sets last_seen_at + * Sets last_seen_at. * - * @param \Fingerprint\ServerAPI\Model\SeenAt $last_seen_at last_seen_at + * @param SeenAt $last_seen_at last_seen_at * * @return $this */ - public function setLastSeenAt($last_seen_at) + public function setLastSeenAt(SeenAt $last_seen_at): self { $this->container['last_seen_at'] = $last_seen_at; return $this; } + /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset - * - * @return boolean + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1321,12 +1380,9 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset - * - * @return mixed + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -1334,13 +1390,10 @@ public function offsetGet($offset) /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void + * @param int $offset Offset + * @param mixed $value Value to be set */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1352,30 +1405,10 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset - * - * @return void + * @param int $offset Offset */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } } diff --git a/src/ObjectSerializer.php b/src/ObjectSerializer.php index cd6ecc02..6eaa1a32 100644 --- a/src/ObjectSerializer.php +++ b/src/ObjectSerializer.php @@ -1,17 +1,18 @@ format('Y-m-d') : $data->format(\DateTime::ATOM); - } elseif (is_array($data)) { + } + if ($data instanceof \DateTime) { + return ('date' === $format) ? $data->format('Y-m-d') : $data->format(\DateTime::ATOM); + } + if (is_array($data)) { foreach ($data as $property => $value) { $data[$property] = self::sanitizeForSerialization($value); } + return $data; - } elseif ($data instanceof \stdClass) { + } + if ($data instanceof \stdClass) { foreach ($data as $property => $value) { - $data->$property = self::sanitizeForSerialization($value); + $data->{$property} = self::sanitizeForSerialization($value); } + return $data; - } elseif (is_object($data)) { + } + if (is_object($data)) { $values = []; $formats = $data::swaggerFormats(); foreach ($data::swaggerTypes() as $property => $swaggerType) { $getter = $data::getters()[$property]; - $value = $data->$getter(); - if ($value !== null + $value = $data->{$getter}(); + if (null !== $value && !in_array($swaggerType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) && method_exists($swaggerType, 'getAllowableEnumValues') && !in_array($value, $swaggerType::getAllowableEnumValues())) { $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); + + throw new \InvalidArgumentException("Invalid value for enum '{$swaggerType}', must be one of: '{$imploded}'"); } - if ($value !== null) { + if (null !== $value) { $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $swaggerType, $formats[$property]); } } - return (object)$values; - } else { - return (string)$data; - } - } - /** - * Sanitize filename by removing path. - * e.g. ../../sun.gif becomes sun.gif - * - * @param string $filename filename to be sanitized - * - * @return string the sanitized filename - */ - public static function sanitizeFilename($filename) - { - if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { - return $match[1]; - } else { - return $filename; + return (object) $values; } + + return (string) $data; } /** @@ -110,7 +105,7 @@ public static function sanitizeFilename($filename) * * @return string the serialized object */ - public static function toPathValue($value) + public static function toPathValue(string $value): string { return rawurlencode(self::toString($value)); } @@ -121,142 +116,110 @@ public static function toPathValue($value) * If it's a string, pass through unchanged. It will be url-encoded * later. * - * @param string[]|string|\DateTime $object an object to be serialized to a string - * @param string|null $format the format of the parameter + * @param \DateTime|string|string[] $object an object to be serialized to a string + * @param null|string $format the format of the parameter * * @return string the serialized object */ - public static function toQueryValue($object, $format = null) + public static function toQueryValue(array|\DateTime|string $object, ?string $format = null): string { if (is_array($object)) { return implode(',', $object); - } else { - return self::toString($object, $format); } - } - /** - * Take value and turn it into a string suitable for inclusion in - * the header. If it's a string, pass through unchanged - * If it's a datetime object, format it in RFC3339 - * - * @param string $value a string which will be part of the header - * - * @return string the header string - */ - public static function toHeaderValue($value) - { - return self::toString($value); - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the http body (form parameter). If it's a string, pass through unchanged - * If it's a datetime object, format it in RFC3339 - * - * @param string|\SplFileObject $value the value of the form parameter - * - * @return string the form string - */ - public static function toFormValue($value) - { - if ($value instanceof \SplFileObject) { - return $value->getRealPath(); - } else { - return self::toString($value); - } + return self::toString($object, $format); } /** * Take value and turn it into a string suitable for inclusion in * the parameter. If it's a string, pass through unchanged * If it's a datetime object, format it in RFC3339 - * If it's a date, format it in Y-m-d + * If it's a date, format it in Y-m-d. * - * @param string|\DateTime $value the value of the parameter - * @param string|null $format the format of the parameter + * @param \DateTime|string $value the value of the parameter + * @param null|string $format the format of the parameter * * @return string the header string */ - public static function toString($value, $format = null) + public static function toString(\DateTime|string $value, ?string $format = null): string { if ($value instanceof \DateTime) { - return ($format === 'date') ? $value->format('Y-m-d') : $value->format(\DateTime::ATOM); - } else { - return $value; + return ('date' === $format) ? $value->format('Y-m-d') : $value->format(\DateTime::ATOM); } + + return $value; } /** - * Serialize an array to a string. + * Deserialize a JSON string into an object. * - * @param array $collection collection to serialize to a string - * @param string $collectionFormat the format use for serialization (csv, - * ssv, tsv, pipes, multi) - * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * @param string $class class name is passed as a string * - * @return string + * @throws \Exception */ - public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) + public static function deserialize(ResponseInterface $response, string $class): mixed { - if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { - // http_build_query() almost does the job for us. We just - // need to fix the result of multidimensional arrays. - return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); - } - switch ($collectionFormat) { - case 'pipes': - return implode('|', $collection); + $data = $response->getBody()->getContents(); + $response->getBody()->rewind(); - case 'tsv': - return implode("\t", $collection); + return self::mapToClass($data, $class, $response); + } - case 'ssv': - return implode(' ', $collection); + protected static function mapToClass(mixed $data, string $class, ResponseInterface $response): mixed + { + if ('string' === gettype($data)) { + $data = json_decode($data, false); + } + $instance = new $class(); + foreach ($instance::swaggerTypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { + continue; + } - case 'csv': - // Deliberate fall through. CSV is default format. - default: - return implode(',', $collection); + $propertyValue = $data->{$instance::attributeMap()[$property]}; + if (isset($propertyValue)) { + $instance->{$propertySetter}(self::castData($propertyValue, $type, $response)); + } } + + return $instance; } - /** - * Deserialize a JSON string into an object - * - * @param mixed $data object or primitive to be deserialized - * @param string $class class name is passed as a string - * @param string[] $httpHeaders HTTP headers - * @param string $discriminator discriminator if polymorphism is used - * - * @return object|array|null an single or an array of $class instances - */ - public static function deserialize($data, $class, $httpHeaders = null) + protected static function castData(mixed $data, string $class, ResponseInterface $response): mixed { if (null === $data) { return null; - } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] + } + if (str_starts_with($class, 'map[')) { // for associative array e.g. map[string,int] $inner = substr($class, 4, -1); $deserialized = []; - if (strrpos($inner, ",") !== false) { + if (false !== strrpos($inner, ',')) { $subClass_array = explode(',', $inner, 2); $subClass = $subClass_array[1]; foreach ($data as $key => $value) { - $deserialized[$key] = self::deserialize($value, $subClass, null); + $deserialized[$key] = self::castData($value, $subClass, $response); } } + return $deserialized; - } elseif (strcasecmp(substr($class, -2), '[]') === 0) { + } + if (0 === strcasecmp(substr($class, -2), '[]')) { $subClass = substr($class, 0, -2); $values = []; foreach ($data as $key => $value) { - $values[] = self::deserialize($value, $subClass, null); + $values[] = self::castData($value, $subClass, $response); } + return $values; - } elseif ($class === 'object' || $class === '\Fingerprint\ServerAPI\Model\RawDeviceAttributesResult') { + } + if ('object' === $class || '\Fingerprint\ServerAPI\Model\RawDeviceAttributesResult' === $class) { settype($data, 'array'); + return $data; - } elseif ($class === '\DateTime') { + } + if ('\DateTime' === $class) { // Some API's return an invalid, empty string as a // date-time property. DateTime::__construct() will return // the current time for empty input which is probably not @@ -265,59 +228,48 @@ public static function deserialize($data, $class, $httpHeaders = null) // this graceful. if (!empty($data)) { return new \DateTime($data); - } else { - return null; } - } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { - settype($data, $class); - return $data; - } elseif ($class === '\SplFileObject') { - /** @var \Psr\Http\Message\StreamInterface $data */ - - // determine file name - if (array_key_exists('Content-Disposition', $httpHeaders) && - preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { - $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); - } else { - $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + + return null; + } + if (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $originalData = $data; + $normalizedClass = strtolower($class); + + switch ($normalizedClass) { + case 'int': + $normalizedClass = 'integer'; + + break; + + case 'bool': + $normalizedClass = 'boolean'; + + break; + } + if ('float' === $normalizedClass && is_numeric($originalData)) { + return (float) $originalData; + } + if ('string' === $normalizedClass && is_object($data)) { + throw new SerializationException($response); } - $file = fopen($filename, 'w'); - while ($chunk = $data->read(200)) { - fwrite($file, $chunk); + settype($data, $class); + if (gettype($data) === $normalizedClass) { + return $data; } - fclose($file); - return new \SplFileObject($filename, 'r'); + throw new SerializationException($response); } elseif (method_exists($class, 'getAllowableEnumValues')) { if (!in_array($data, $class::getAllowableEnumValues())) { $imploded = implode("', '", $class::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); - } - return $data; - } else { - // If a discriminator is defined and points to a valid subclass, use it. - $discriminator = $class::DISCRIMINATOR; - if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { - $subclass = 'Fingerprint\ServerAPI\Model\\' . $data->{$discriminator}; - if (is_subclass_of($subclass, $class)) { - $class = $subclass; - } - } - $instance = new $class(); - foreach ($instance::swaggerTypes() as $property => $type) { - $propertySetter = $instance::setters()[$property]; - - if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { - continue; - } - $propertyValue = $data->{$instance::attributeMap()[$property]}; - if (isset($propertyValue)) { - $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); - } + throw new \InvalidArgumentException("Invalid value for enum '{$class}', must be one of: '{$imploded}'"); } - return $instance; + + return $data; } + + return self::mapToClass($data, $class, $response); } } diff --git a/src/Sealed/DecompressionException.php b/src/Sealed/DecompressionException.php index 1f5d6622..6f6d3763 100644 --- a/src/Sealed/DecompressionException.php +++ b/src/Sealed/DecompressionException.php @@ -2,12 +2,10 @@ namespace Fingerprint\ServerAPI\Sealed; -use Exception; - -class DecompressionException extends Exception +class DecompressionException extends \Exception { public function __construct() { - parent::__construct("Decompression failed"); + parent::__construct('Decompression failed'); } -} \ No newline at end of file +} diff --git a/src/Sealed/DecryptionAlgorithm.php b/src/Sealed/DecryptionAlgorithm.php index 766aebc6..80427cf9 100644 --- a/src/Sealed/DecryptionAlgorithm.php +++ b/src/Sealed/DecryptionAlgorithm.php @@ -4,5 +4,5 @@ class DecryptionAlgorithm { - const AES_256_GCM = 'aes-256-gcm'; -} \ No newline at end of file + public const AES_256_GCM = 'aes-256-gcm'; +} diff --git a/src/Sealed/DecryptionKey.php b/src/Sealed/DecryptionKey.php index 3135785f..98799a73 100644 --- a/src/Sealed/DecryptionKey.php +++ b/src/Sealed/DecryptionKey.php @@ -22,4 +22,4 @@ public function getAlgorithm() { return $this->algorithm; } -} \ No newline at end of file +} diff --git a/src/Sealed/InvalidSealedDataException.php b/src/Sealed/InvalidSealedDataException.php index 283857d1..809199f9 100644 --- a/src/Sealed/InvalidSealedDataException.php +++ b/src/Sealed/InvalidSealedDataException.php @@ -2,12 +2,10 @@ namespace Fingerprint\ServerAPI\Sealed; -use InvalidArgumentException; - -class InvalidSealedDataException extends InvalidArgumentException +class InvalidSealedDataException extends \InvalidArgumentException { public function __construct() { - parent::__construct("Invalid sealed data"); + parent::__construct('Invalid sealed data'); } -} \ No newline at end of file +} diff --git a/src/Sealed/InvalidSealedDataHeaderException.php b/src/Sealed/InvalidSealedDataHeaderException.php index ed72b610..9f4d70e9 100644 --- a/src/Sealed/InvalidSealedDataHeaderException.php +++ b/src/Sealed/InvalidSealedDataHeaderException.php @@ -2,12 +2,10 @@ namespace Fingerprint\ServerAPI\Sealed; -use InvalidArgumentException; - -class InvalidSealedDataHeaderException extends InvalidArgumentException +class InvalidSealedDataHeaderException extends \InvalidArgumentException { public function __construct() { - parent::__construct("Invalid sealed data header"); + parent::__construct('Invalid sealed data header'); } -} \ No newline at end of file +} diff --git a/src/Sealed/Sealed.php b/src/Sealed/Sealed.php index 909172fc..687910b3 100644 --- a/src/Sealed/Sealed.php +++ b/src/Sealed/Sealed.php @@ -2,22 +2,25 @@ namespace Fingerprint\ServerAPI\Sealed; -use Exception; use Fingerprint\ServerAPI\Model\EventResponse; -use InvalidArgumentException; +use Fingerprint\ServerAPI\ObjectSerializer; +use Fingerprint\ServerAPI\SerializationException; +use GuzzleHttp\Psr7\Response; -class Sealed { - private static $SEAL_HEADER = "\x9E\x85\xDC\xED"; +class Sealed +{ private const NONCE_LENGTH = 12; private const AUTH_TAG_LENGTH = 16; + private static $SEAL_HEADER = "\x9E\x85\xDC\xED"; /** - * @param string $sealed * @param DecryptionKey[] $keys - * @return EventResponse + * * @throws UnsealAggregateException + * @throws SerializationException */ - public static function unsealEventResponse(string $sealed, array $keys): EventResponse { + public static function unsealEventResponse(string $sealed, array $keys): EventResponse + { $unsealed = self::unseal($sealed, $keys); $data = json_decode($unsealed, true); @@ -26,15 +29,17 @@ public static function unsealEventResponse(string $sealed, array $keys): EventRe throw new InvalidSealedDataException(); } - return new EventResponse($data); + $response = new Response(200, [], $unsealed); + + return ObjectSerializer::deserialize($response, EventResponse::class); } /** * Decrypts the sealed response with the provided keys. * - * @param string $sealed Base64 encoded sealed data - * @param DecryptionKey[] $keys Decryption keys. The SDK will try to decrypt the result with each key until it succeeds. - * @return string + * @param string $sealed Base64 encoded sealed data + * @param DecryptionKey[] $keys Decryption keys. The SDK will try to decrypt the result with each key until it succeeds. + * * @throws UnsealAggregateException */ public static function unseal(string $sealed, array $keys): string @@ -50,18 +55,20 @@ public static function unseal(string $sealed, array $keys): string case DecryptionAlgorithm::AES_256_GCM: try { $data = substr($sealed, strlen(self::$SEAL_HEADER)); + return self::decryptAes256Gcm($data, $key->getKey()); - } catch (Exception $exception) { + } catch (\Exception $exception) { $aggregateException->addException(new UnsealException( - "Failed to decrypt", + 'Failed to decrypt', $exception, $key )); } + break; default: - throw new InvalidArgumentException("Invalid decryption algorithm"); + throw new \InvalidArgumentException('Invalid decryption algorithm'); } } @@ -69,7 +76,10 @@ public static function unseal(string $sealed, array $keys): string } /** - * @throws Exception + * @param mixed $sealedData + * @param mixed $decryptionKey + * + * @throws \Exception */ private static function decryptAes256Gcm($sealedData, $decryptionKey): string { @@ -81,24 +91,29 @@ private static function decryptAes256Gcm($sealedData, $decryptionKey): string $decryptedData = openssl_decrypt($ciphertext, 'aes-256-gcm', $decryptionKey, OPENSSL_RAW_DATA, $nonce, $tag); - if ($decryptedData === false) { - throw new Exception("Decryption failed"); + if (false === $decryptedData) { + throw new \Exception('Decryption failed'); } return self::decompress($decryptedData); } /** - * @throws Exception + * @param mixed $data + * + * @throws \Exception */ private static function decompress($data): string { - $inflated = gzinflate($data); + if (false === $data || 0 === strlen($data)) { + throw new DecompressionException(); + } + $inflated = @gzinflate($data); // Ignore warnings, because we check the decompressed data's validity and throw error if necessary - if ($inflated === false) { + if (false === $inflated) { throw new DecompressionException(); } return $inflated; } -} \ No newline at end of file +} diff --git a/src/Sealed/UnsealAggregateException.php b/src/Sealed/UnsealAggregateException.php index b465f91b..00f3969b 100644 --- a/src/Sealed/UnsealAggregateException.php +++ b/src/Sealed/UnsealAggregateException.php @@ -2,28 +2,25 @@ namespace Fingerprint\ServerAPI\Sealed; -use Exception; - -class UnsealAggregateException extends Exception +class UnsealAggregateException extends \Exception { /** - * @var Exception[] + * @var \Exception[] */ private $exceptions; public function __construct() { - parent::__construct("Failed to unseal with all decryption keys"); + parent::__construct('Failed to unseal with all decryption keys'); } - public function addException(Exception $exception) + public function addException(\Exception $exception) { $this->exceptions[] = $exception; } - public function getExceptions() { return $this->exceptions; } -} \ No newline at end of file +} diff --git a/src/Sealed/UnsealException.php b/src/Sealed/UnsealException.php index 6d35b563..16bbad3a 100644 --- a/src/Sealed/UnsealException.php +++ b/src/Sealed/UnsealException.php @@ -2,10 +2,7 @@ namespace Fingerprint\ServerAPI\Sealed; - -use Exception; - -class UnsealException extends Exception +class UnsealException extends \Exception { public $decryptionKeyDescription; @@ -17,10 +14,10 @@ public function __construct($message, $cause, $decryptionKey) public function __toString() { - return "UnsealException{" . - "decryptionKey=" . $this->decryptionKeyDescription . - ", message=" . $this->getMessage() . - ", cause=" . $this->getPrevious() . + return 'UnsealException{'. + 'decryptionKey='.$this->decryptionKeyDescription. + ', message='.$this->getMessage(). + ', cause='.$this->getPrevious(). '}'; } -} \ No newline at end of file +} diff --git a/src/SerializationException.php b/src/SerializationException.php new file mode 100644 index 00000000..51049575 --- /dev/null +++ b/src/SerializationException.php @@ -0,0 +1,26 @@ +getCode() : 0, $prev); + $this->response = $response; + } + + public function setResponse(ResponseInterface $response): void + { + $this->response = $response; + } + + public function getResponse(): ?ResponseInterface + { + return $this->response; + } +} diff --git a/src/Webhook/WebhookVerifier.php b/src/Webhook/WebhookVerifier.php new file mode 100644 index 00000000..f8bb89a7 --- /dev/null +++ b/src/Webhook/WebhookVerifier.php @@ -0,0 +1,29 @@ +partial_header}} +/** + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ + +namespace {{invokerPackage}}; + +use \Exception; +use Fingerprint\ServerAPI\Model\ModelInterface; +use Psr\Http\Message\ResponseInterface; + +/** + * ApiException Class Doc Comment + * + * @category Class + * @package {{invokerPackage}} + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class ApiException extends Exception +{ + protected ResponseInterface $responseObject; + protected ?ModelInterface $errorDetails = null; + protected ?int $retryAfter = null; + + public function __construct(?string $message = "", ?int $code = 0) + { + parent::__construct($message, $code); + } + + + /** + * Sets the deseralized response object (during deserialization) + */ + public function setResponseObject(ResponseInterface $obj): void + { + $this->responseObject = $obj; + } + + public function getResponseObject(): ResponseInterface + { + return $this->responseObject; + } + + public function getErrorDetails(): ModelInterface + { + return $this->errorDetails; + } + + public function setErrorDetails(ModelInterface $errorDetails): void + { + $this->errorDetails = $errorDetails; + } + + public function getRetryAfter(): ?int + { + return $this->retryAfter; + } + + public function setRetryAfter(?int $retryAfter): void + { + $this->retryAfter = $retryAfter; + } +} \ No newline at end of file diff --git a/template/Configuration.mustache b/template/Configuration.mustache index a4249245..f2690a18 100644 --- a/template/Configuration.mustache +++ b/template/Configuration.mustache @@ -39,74 +39,55 @@ class Configuration * * @var string[] */ - protected $apiKeys = []; + protected array $apiKeys = []; /** * Associate array to store API prefix (e.g. Bearer) * * @var string[] */ - protected $apiKeyPrefixes = []; + protected array $apiKeyPrefixes = []; /** * Access token for OAuth - * - * @var string */ - protected $accessToken = '{{#x-token-example}}{{x-token-example}}{{/x-token-example}}'; + protected string $accessToken = '{{#x-token-example}}{{x-token-example}}{{/x-token-example}}'; /** * Username for HTTP basic authentication - * - * @var string */ - protected $username = ''; + protected string $username = ''; /** * Password for HTTP basic authentication - * - * @var string */ - protected $password = ''; + protected string $password = ''; /** * The host - * - * @var string */ - protected $host = '{{basePath}}'; + protected string $host = '{{basePath}}'; /** * User agent of the HTTP request, set to "PHP-Swagger" by default - * - * @var string */ - protected $userAgent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{#artifactVersion}}{{{.}}}{{/artifactVersion}}{{^artifactVersion}}1.0.0{{/artifactVersion}}/php{{/httpUserAgent}}'; + protected string $userAgent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{#artifactVersion}}{{{.}}}{{/artifactVersion}}{{^artifactVersion}}1.0.0{{/artifactVersion}}/php{{/httpUserAgent}}'; /** * Debug switch (default set to false) - * - * @var bool */ - protected $debug = false; + protected bool $debug = false; /** * Debug file location (log to STDOUT by default) - * - * @var string */ - protected $debugFile = 'php://output'; + protected string $debugFile = 'php://output'; /** * Debug file location (log to STDOUT by default) - * - * @var string */ - protected $tempFolderPath; + protected string $tempFolderPath; - /** - * Constructor - */ public function __construct() { $this->tempFolderPath = sys_get_temp_dir(); @@ -120,7 +101,7 @@ class Configuration * * @return $this */ - public function setApiKey($apiKeyIdentifier, $key) + public function setApiKey(string $apiKeyIdentifier, string $key): self { $this->apiKeys[$apiKeyIdentifier] = $key; return $this; @@ -131,9 +112,9 @@ class Configuration * * @param string $apiKeyIdentifier API key identifier (authentication scheme) * - * @return string API key or token + * @return string|null API key or token */ - public function getApiKey($apiKeyIdentifier) + public function getApiKey(string $apiKeyIdentifier): ?string { return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; } @@ -146,7 +127,7 @@ class Configuration * * @return $this */ - public function setApiKeyPrefix($apiKeyIdentifier, $prefix) + public function setApiKeyPrefix(string $apiKeyIdentifier, string $prefix): self { $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; return $this; @@ -157,9 +138,9 @@ class Configuration * * @param string $apiKeyIdentifier API key identifier (authentication scheme) * - * @return string + * @return string|null */ - public function getApiKeyPrefix($apiKeyIdentifier) + public function getApiKeyPrefix(string $apiKeyIdentifier): ?string { return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; } @@ -171,7 +152,7 @@ class Configuration * * @return $this */ - public function setAccessToken($accessToken) + public function setAccessToken(string $accessToken): self { $this->accessToken = $accessToken; return $this; @@ -182,7 +163,7 @@ class Configuration * * @return string Access token for OAuth */ - public function getAccessToken() + public function getAccessToken(): string { return $this->accessToken; } @@ -194,7 +175,7 @@ class Configuration * * @return $this */ - public function setUsername($username) + public function setUsername(string $username): self { $this->username = $username; return $this; @@ -205,7 +186,7 @@ class Configuration * * @return string Username for HTTP basic authentication */ - public function getUsername() + public function getUsername(): string { return $this->username; } @@ -217,7 +198,7 @@ class Configuration * * @return $this */ - public function setPassword($password) + public function setPassword(string $password): self { $this->password = $password; return $this; @@ -228,7 +209,7 @@ class Configuration * * @return string Password for HTTP basic authentication */ - public function getPassword() + public function getPassword(): string { return $this->password; } @@ -240,7 +221,7 @@ class Configuration * * @return $this */ - public function setHost($host) + public function setHost(string $host): self { $this->host = $host; return $this; @@ -251,7 +232,7 @@ class Configuration * * @return string Host */ - public function getHost() + public function getHost(): string { return $this->host; } @@ -260,7 +241,7 @@ class Configuration * @param $region * @return $this */ - public function setRegion($region = self::REGION_GLOBAL) + public function setRegion(?string $region = self::REGION_GLOBAL): self { switch (trim(strtolower($region))) { case self::REGION_ASIA: @@ -291,7 +272,7 @@ class Configuration * @return $this * @throws \InvalidArgumentException */ - public function setUserAgent($userAgent) + public function setUserAgent(string $userAgent): self { if (!is_string($userAgent)) { throw new \InvalidArgumentException('User-agent must be a string.'); @@ -306,7 +287,7 @@ class Configuration * * @return string user agent */ - public function getUserAgent() + public function getUserAgent(): string { return $this->userAgent; } @@ -318,7 +299,7 @@ class Configuration * * @return $this */ - public function setDebug($debug) + public function setDebug(bool $debug): self { $this->debug = $debug; return $this; @@ -329,7 +310,7 @@ class Configuration * * @return bool */ - public function getDebug() + public function getDebug(): bool { return $this->debug; } @@ -341,7 +322,7 @@ class Configuration * * @return $this */ - public function setDebugFile($debugFile) + public function setDebugFile(string $debugFile): self { $this->debugFile = $debugFile; return $this; @@ -352,7 +333,7 @@ class Configuration * * @return string */ - public function getDebugFile() + public function getDebugFile(): string { return $this->debugFile; } @@ -364,7 +345,7 @@ class Configuration * * @return $this */ - public function setTempFolderPath($tempFolderPath) + public function setTempFolderPath(string $tempFolderPath): self { $this->tempFolderPath = $tempFolderPath; return $this; @@ -375,7 +356,7 @@ class Configuration * * @return string Temp folder path */ - public function getTempFolderPath() + public function getTempFolderPath(): string { return $this->tempFolderPath; } @@ -387,7 +368,7 @@ class Configuration * @param $region * @return Configuration */ - public static function getDefaultConfiguration($api_key = null, $region = self::REGION_GLOBAL) + public static function getDefaultConfiguration(?string $api_key = null, ?string $region = self::REGION_GLOBAL): self { if (self::$defaultConfiguration === null) { self::$defaultConfiguration = new Configuration(); @@ -406,7 +387,7 @@ class Configuration * * @return void */ - public static function setDefaultConfiguration(Configuration $config) + public static function setDefaultConfiguration(Configuration $config): void { self::$defaultConfiguration = $config; } @@ -416,7 +397,7 @@ class Configuration * * @return string The report for debugging */ - public static function toDebugReport() + public static function toDebugReport(): string { $report = 'PHP SDK ({{invokerPackage}}) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; @@ -435,9 +416,9 @@ class Configuration * * @param string $apiKeyIdentifier name of apikey * - * @return string API key with the prefix + * @return string|null API key with the prefix */ - public function getApiKeyWithPrefix($apiKeyIdentifier) + public function getApiKeyWithPrefix(string $apiKeyIdentifier): ?string { $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); $apiKey = $this->getApiKey($apiKeyIdentifier); diff --git a/template/ObjectSerializer.mustache b/template/ObjectSerializer.mustache deleted file mode 100644 index 89e95e21..00000000 --- a/template/ObjectSerializer.mustache +++ /dev/null @@ -1,314 +0,0 @@ -partial_header}} -/** - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen - * Do not edit the class manually. - */ - -namespace {{invokerPackage}}; - -/** - * ObjectSerializer Class Doc Comment - * - * @category Class - * @package {{invokerPackage}} - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen - */ -class ObjectSerializer -{ - /** - * Serialize data - * - * @param mixed $data the data to serialize - * @param string $format the format of the Swagger type of the data - * - * @return string|object serialized form of $data - */ - public static function sanitizeForSerialization($data, $format = null) - { - if (is_scalar($data) || null === $data) { - return $data; - } elseif ($data instanceof \DateTime) { - return ($format === 'date') ? $data->format('Y-m-d') : $data->format(\DateTime::ATOM); - } elseif (is_array($data)) { - foreach ($data as $property => $value) { - $data[$property] = self::sanitizeForSerialization($value); - } - return $data; - } elseif ($data instanceof \stdClass) { - foreach ($data as $property => $value) { - $data->$property = self::sanitizeForSerialization($value); - } - return $data; - } elseif (is_object($data)) { - $values = []; - $formats = $data::swaggerFormats(); - foreach ($data::swaggerTypes() as $property => $swaggerType) { - $getter = $data::getters()[$property]; - $value = $data->$getter(); - if ($value !== null - && !in_array($swaggerType, [{{&primitives}}], true) - && method_exists($swaggerType, 'getAllowableEnumValues') - && !in_array($value, $swaggerType::getAllowableEnumValues())) { - $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); - } - if ($value !== null) { - $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $swaggerType, $formats[$property]); - } - } - return (object)$values; - } else { - return (string)$data; - } - } - - /** - * Sanitize filename by removing path. - * e.g. ../../sun.gif becomes sun.gif - * - * @param string $filename filename to be sanitized - * - * @return string the sanitized filename - */ - public static function sanitizeFilename($filename) - { - if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { - return $match[1]; - } else { - return $filename; - } - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the path, by url-encoding. - * - * @param string $value a string which will be part of the path - * - * @return string the serialized object - */ - public static function toPathValue($value) - { - return rawurlencode(self::toString($value)); - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the query, by imploding comma-separated if it's an object. - * If it's a string, pass through unchanged. It will be url-encoded - * later. - * - * @param string[]|string|\DateTime $object an object to be serialized to a string - * @param string|null $format the format of the parameter - * - * @return string the serialized object - */ - public static function toQueryValue($object, $format = null) - { - if (is_array($object)) { - return implode(',', $object); - } else { - return self::toString($object, $format); - } - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the header. If it's a string, pass through unchanged - * If it's a datetime object, format it in RFC3339 - * - * @param string $value a string which will be part of the header - * - * @return string the header string - */ - public static function toHeaderValue($value) - { - return self::toString($value); - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the http body (form parameter). If it's a string, pass through unchanged - * If it's a datetime object, format it in RFC3339 - * - * @param string|\SplFileObject $value the value of the form parameter - * - * @return string the form string - */ - public static function toFormValue($value) - { - if ($value instanceof \SplFileObject) { - return $value->getRealPath(); - } else { - return self::toString($value); - } - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the parameter. If it's a string, pass through unchanged - * If it's a datetime object, format it in RFC3339 - * If it's a date, format it in Y-m-d - * - * @param string|\DateTime $value the value of the parameter - * @param string|null $format the format of the parameter - * - * @return string the header string - */ - public static function toString($value, $format = null) - { - if ($value instanceof \DateTime) { - return ($format === 'date') ? $value->format('Y-m-d') : $value->format(\DateTime::ATOM); - } else { - return $value; - } - } - - /** - * Serialize an array to a string. - * - * @param array $collection collection to serialize to a string - * @param string $collectionFormat the format use for serialization (csv, - * ssv, tsv, pipes, multi) - * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array - * - * @return string - */ - public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) - { - if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { - // http_build_query() almost does the job for us. We just - // need to fix the result of multidimensional arrays. - return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); - } - switch ($collectionFormat) { - case 'pipes': - return implode('|', $collection); - - case 'tsv': - return implode("\t", $collection); - - case 'ssv': - return implode(' ', $collection); - - case 'csv': - // Deliberate fall through. CSV is default format. - default: - return implode(',', $collection); - } - } - - /** - * Deserialize a JSON string into an object - * - * @param mixed $data object or primitive to be deserialized - * @param string $class class name is passed as a string - * @param string[] $httpHeaders HTTP headers - * @param string $discriminator discriminator if polymorphism is used - * - * @return object|array|null an single or an array of $class instances - */ - public static function deserialize($data, $class, $httpHeaders = null) - { - if (null === $data) { - return null; - } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] - $inner = substr($class, 4, -1); - $deserialized = []; - if (strrpos($inner, ",") !== false) { - $subClass_array = explode(',', $inner, 2); - $subClass = $subClass_array[1]; - foreach ($data as $key => $value) { - $deserialized[$key] = self::deserialize($value, $subClass, null); - } - } - return $deserialized; - } elseif (strcasecmp(substr($class, -2), '[]') === 0) { - $subClass = substr($class, 0, -2); - $values = []; - foreach ($data as $key => $value) { - $values[] = self::deserialize($value, $subClass, null); - } - return $values; - } elseif ($class === 'object' || $class === '\Fingerprint\ServerAPI\Model\RawDeviceAttributesResult') { - settype($data, 'array'); - return $data; - } elseif ($class === '\DateTime') { - // Some API's return an invalid, empty string as a - // date-time property. DateTime::__construct() will return - // the current time for empty input which is probably not - // what is meant. The invalid empty string is probably to - // be interpreted as a missing field/value. Let's handle - // this graceful. - if (!empty($data)) { - return new \DateTime($data); - } else { - return null; - } - } elseif (in_array($class, [{{&primitives}}], true)) { - settype($data, $class); - return $data; - } elseif ($class === '\SplFileObject') { - /** @var \Psr\Http\Message\StreamInterface $data */ - - // determine file name - if (array_key_exists('Content-Disposition', $httpHeaders) && - preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { - $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); - } else { - $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); - } - - $file = fopen($filename, 'w'); - while ($chunk = $data->read(200)) { - fwrite($file, $chunk); - } - fclose($file); - - return new \SplFileObject($filename, 'r'); - } elseif (method_exists($class, 'getAllowableEnumValues')) { - if (!in_array($data, $class::getAllowableEnumValues())) { - $imploded = implode("', '", $class::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); - } - return $data; - } else { - // If a discriminator is defined and points to a valid subclass, use it. - $discriminator = $class::DISCRIMINATOR; - if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { - $subclass = '{{invokerPackage}}\Model\\' . $data->{$discriminator}; - if (is_subclass_of($subclass, $class)) { - $class = $subclass; - } - } - $instance = new $class(); - foreach ($instance::swaggerTypes() as $property => $type) { - $propertySetter = $instance::setters()[$property]; - - if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { - continue; - } - - $propertyValue = $data->{$instance::attributeMap()[$property]}; - if (isset($propertyValue)) { - $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); - } - } - return $instance; - } - } -} diff --git a/template/README.mustache b/template/README.mustache index 367f7cc9..5934bfa3 100644 --- a/template/README.mustache +++ b/template/README.mustache @@ -10,6 +10,7 @@

CI badge CI badge +Unit Test Coverage CI badge Latest Stable Version on Packagist PHP Version Require @@ -94,6 +95,7 @@ const PAGINATION_KEY = "1683900801733.Ogvu1j"; // Import Fingerprint Pro Classes and Guzzle Http Client use Fingerprint\ServerAPI\Api\FingerprintApi; use Fingerprint\ServerAPI\Configuration; +use Fingerprint\ServerAPI\Model\EventUpdateRequest; use GuzzleHttp\Client; // Create a new Configuration instance with your Fingerprint Pro Server API Key and your Fingerprint Pro Server API Region. @@ -114,7 +116,7 @@ $client = new FingerprintApi( // Get an event with a given requestId try { // Fetch the event with a given requestId - $response = $client->getEvent(FPJS_REQUEST_ID); + list($model, $response) = $client->getEvent(FPJS_REQUEST_ID); echo "

" . $response->__toString() . "
"; } catch (Exception $e) { echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL; @@ -123,31 +125,56 @@ try { // Get a specific visitor's all visits try { // Fetch all visits with a given visitorId, with a page limit - $response = $client->getVisits(FPJS_VISITOR_ID, null, null, LIMIT); + list($model, $response) = $client->getVisits(FPJS_VISITOR_ID, null, null, LIMIT); echo "
" . $response->__toString() . "
"; } catch (Exception $e) { - echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FingerprintApi->getVisits: ', $e->getMessage(), PHP_EOL; } // Get a specific visitor's all visits with a linkedId try { // Fetch all visits with a given visitorId, with a page limit, skipping the first visit - $response = $client->getVisits(FPJS_VISITOR_ID, null, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY); + list($model, $response) = $client->getVisits(FPJS_VISITOR_ID, null, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY); echo "
" . $response->__toString() . "
"; } catch (Exception $e) { - echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FingerprintApi->getVisits: ', $e->getMessage(), PHP_EOL; } // Use all the parameters on getVisits try { // Fetch the visitor's all visits with a given requestId and linkedId with a page limit while skipping the first visit - $response = $client->getVisits(FPJS_VISITOR_ID, FPJS_REQUEST_ID, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY); + list($model, $response) = $client->getVisits(FPJS_VISITOR_ID, FPJS_REQUEST_ID, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY); echo "
" . $response->__toString() . "
"; } catch (Exception $e) { - echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FingerprintApi->getVisits: ', $e->getMessage(), PHP_EOL; +} + +// Update Event +try { + $body = new EventUpdateRequest([ + 'linked_id' => 'new linked id', + 'tag' => json_encode(['new_property' => 'new value']), + 'suspect' => true, + ]); + list($model, $response) = $client->updateEvent($body, FPJS_REQUEST_ID); + echo "
" . $response->__toString() . "
"; +} catch (Exception $e) { + echo 'Exception when calling FingerprintApi->updateEvent: ', $e->getMessage(), PHP_EOL; +} + +// Delete by visitor ID +try { + list($model, $response) = $client->deleteVisitorData(FPJS_VISITOR_ID); + echo "
" . $response->__toString() . "
"; +} catch (Exception $e) { + echo 'Exception when calling FingerprintApi->deleteVisitorData: ', $e->getMessage(), PHP_EOL; } ``` +> ⚠️ Warning It's not possible to update events older than 10 days. + +> ⚠️ If you are interested in using `deleteVisitorData` API, please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. + ## Sealed results This SDK provides utility methods for decoding [sealed results](https://dev.fingerprint.com/docs/sealed-client-results). @@ -184,6 +211,34 @@ All URIs are relative to your region's base URL. | Europe | https://eu.api.fpjs.io | | Asia | https://ap.api.fpjs.io | +## Webhook Signing + +This SDK provides utility method for verifying the HMAC signature of the incoming webhook request. +You can use below code to verify signature: + +```php +client = $client ?: new Client(); $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); } - /** - * @return Configuration - */ - public function getConfig() + public function getConfig(): Configuration { return $this->config; } {{#operation}} {{#contents}} - /** - * Operation {{{operationId}}} -{{#summary}} - * - * {{{summary}}} -{{/summary}} - * -{{#description}} - * {{.}} - * -{{/description}} -{{#parameters}} - * @param {{dataType}} ${{paramName}}{{#description}} {{{description}}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} -{{/parameters}} - * - * @throws {{backSlash}}{{invokerPackage}}\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} - */ - public function {{operationId}}({{#parameters}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/parameters}}) - { - {{#returnType}}list($response) = {{/returnType}}$this->{{operationId}}WithHttpInfo({{#parameters}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/parameters}});{{#returnType}} - return $response;{{/returnType}} - } /** - * Operation {{{operationId}}}WithHttpInfo + * Operation {{{operationId}}} {{#summary}} * * {{{summary}}} @@ -120,12 +75,13 @@ use {{invokerPackage}}\ObjectSerializer; {{#parameters}} * @param {{dataType}} ${{paramName}}{{#description}} {{{description}}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/parameters}} - * - * @throws {{backSlash}}{{invokerPackage}}\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}null{{/returnType}}, HTTP status code, HTTP response headers (array of strings) + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException + * @return array{ {{#returnType}}{{{returnType}}}|null{{/returnType}}{{^returnType}}null{{/returnType}}, \Psr\Http\Message\ResponseInterface } */ - public function {{operationId}}WithHttpInfo({{#parameters}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/parameters}}) + public function {{operationId}}({{#parameters}}{{dataType}} ${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/parameters}}): array { $returnType = '{{returnType}}'; $request = $this->{{operationId}}Request({{#parameters}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/parameters}}); @@ -135,112 +91,83 @@ use {{invokerPackage}}\ObjectSerializer; try { $response = $this->client->send($request, $options); } catch (RequestException $e) { - throw new ApiException( + $apiException = new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getCode() ); + $apiException->setResponseObject($e->getResponse()); + throw $apiException; } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( + $apiException = new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $request->getUri() ), - $statusCode, - $response->getHeaders(), - $response->getBody() + $statusCode ); + $apiException->setResponseObject($response); + throw $apiException; } {{#returnType}} - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if (!in_array($returnType, ['string','integer','bool'])) { - $content = json_decode($content); - } - } - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + $serialized = ObjectSerializer::deserialize($response, $returnType); + + return [$serialized, $response]; {{/returnType}} {{^returnType}} - return [null, $statusCode, $response->getHeaders()]; + return [null, $response]; {{/returnType}} } catch (ApiException $e) { + /** @var ResponseInterface $response */ + $response = $e->getResponseObject(); switch ($e->getCode()) { - {{#responses}} - {{#dataType}} - {{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '{{dataType}}', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - {{/dataType}} - {{/responses}} - } - throw $e; - } - } + {{#responses}} + {{#dataType}} + {{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} + $errorDetail = ObjectSerializer::deserialize($response, '{{dataType}}'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + break; + {{/dataType}} + {{/responses}} + } - /** - * Operation {{{operationId}}}Async - * - * {{{summary}}} - * -{{#description}} - * {{.}} - * -{{/description}} -{{#parameters}} - * @param {{dataType}} ${{paramName}}{{#description}} {{{description}}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} -{{/parameters}} - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function {{operationId}}Async({{#parameters}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/parameters}}) - { - return $this->{{operationId}}AsyncWithHttpInfo({{#parameters}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/parameters}}) - ->then( - function ($response) { - return $response[0]; + if ($e->getCode() === 429) { + $e->setRetryAfter(1); + if ($response->hasHeader('retry-after')) { + $e->setRetryAfter((int) $response->getHeader('retry-after')[0]); + } } - ); + + throw $e; + } } /** - * Operation {{{operationId}}}AsyncWithHttpInfo - * - * {{{summary}}} - * -{{#description}} - * {{.}} - * -{{/description}} -{{#parameters}} - * @param {{dataType}} ${{paramName}}{{#description}} {{{description}}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} -{{/parameters}} - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function {{operationId}}AsyncWithHttpInfo({{#parameters}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/parameters}}) + * Operation {{{operationId}}}Async + * + * {{{summary}}} + {{#description}} + * {{.}} + * + {{/description}} + {{#parameters}} + * @param {{dataType}} ${{paramName}}{{#description}} {{{description}}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + {{/parameters}} + * + * @throws \InvalidArgumentException + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException + */ + public function {{operationId}}Async({{#parameters}}{{dataType}} ${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/parameters}}): \GuzzleHttp\Promise\PromiseInterface { $returnType = '{{returnType}}'; $request = $this->{{operationId}}Request({{#parameters}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/parameters}}); @@ -248,41 +175,54 @@ use {{invokerPackage}}\ObjectSerializer; return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( - function ($response) use ($returnType) { - {{#returnType}} - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } + function ($response) use ($returnType, $request) { + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + $apiException = new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode + ); + $apiException->setResponseObject($response); + throw $apiException; } + {{#returnType}} - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - {{/returnType}} - {{^returnType}} - return [null, $response->getStatusCode(), $response->getHeaders()]; + $serialized = ObjectSerializer::deserialize($response, $returnType); + + return [$serialized, $response]; + {{/returnType}} + {{^returnType}} + return [null, $response]; {{/returnType}} }, - 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(), - $response->getBody() - ); + function ($e) { + /** @var ResponseInterface $response */ + $response = $e->getResponseObject(); + switch ($e->getCode()) { + {{#responses}} + {{#dataType}} + {{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} + $errorDetail = ObjectSerializer::deserialize($response, '{{dataType}}'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + break; + {{/dataType}} + {{/responses}} + } + + if ($e->getCode() === 429) { + $e->setRetryAfter(1); + if ($response->hasHeader('retry-after')) { + $e->setRetryAfter((int) $response->getHeader('retry-after')[0]); + } + } + + throw $e; } ); } @@ -290,14 +230,13 @@ use {{invokerPackage}}\ObjectSerializer; /** * Create request for operation '{{{operationId}}}' * -{{#parameters}} - * @param {{dataType}} ${{paramName}}{{#description}} {{{description}}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} -{{/parameters}} * * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException */ - protected function {{operationId}}Request({{#parameters}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/parameters}}) + protected function {{operationId}}Request({{#parameters}}{{dataType}}{{^required}}|null{{/required}} ${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/parameters}}): \GuzzleHttp\Psr7\Request { {{#parameters}} {{#required}} @@ -349,11 +288,10 @@ use {{invokerPackage}}\ObjectSerializer; {{/parameters}} $resourcePath = '{{{path}}}'; - $formParams = []; + $headers = []; $queryParams = ['ii' => $this->integration_info]; $headerParams = []; $httpBody = ''; - $multipart = false; {{#queryParams}} // query params @@ -394,65 +332,18 @@ use {{invokerPackage}}\ObjectSerializer; } {{/pathParams}} - {{#formParams}} - // form params - if (${{paramName}} !== null) { - {{#isBinary}} - $multipart = true; - $formParams['{{baseName}}'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue(${{paramName}}), 'rb'); - {{/isBinary}} - {{^isBinary}} - $formParams['{{baseName}}'] = ObjectSerializer::toFormValue(${{paramName}}); - {{/isBinary}} - } - {{/formParams}} + {{#bodyParams}} // body params $_tempBody = null; - {{#bodyParams}} if (isset(${{paramName}})) { $_tempBody = ${{paramName}}; } - {{/bodyParams}} - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}], - [{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}] - ); - } - // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present - $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - } elseif (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = http_build_query($formParams); - } + $httpBody = json_encode($_tempBody); } + {{/bodyParams}} {{#authMethods}} {{#isApiKey}} @@ -482,7 +373,10 @@ use {{invokerPackage}}\ObjectSerializer; {{/isOAuth}} {{/authMethods}} - $defaultHeaders = []; + $defaultHeaders = [ + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + ]; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } @@ -508,9 +402,8 @@ use {{invokerPackage}}\ObjectSerializer; * Create http client option * * @throws \RuntimeException on file opening failure - * @return array of http client options */ - protected function createHttpClientOption() + protected function createHttpClientOption(): array { $options = []; if ($this->config->getDebug()) { diff --git a/template/api_doc.mustache b/template/api_doc.mustache index 2b6c9f5b..f42a5e90 100644 --- a/template/api_doc.mustache +++ b/template/api_doc.mustache @@ -1,5 +1,5 @@ # {{invokerPackage}}\FingerprintApi{{#description}} -{{description}}{{/description}} + {{description}}{{/description}} All URIs are relative to *{{basePath}}* @@ -11,7 +11,7 @@ Method | HTTP request | Description {{#operations}} {{#operation}} # **{{{operationId}}}** -> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) +> {{#returnType}} [ {{{returnType}}}, \Psr\Http\Message\ResponseInterface ] {{/returnType}}{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {{{summary}}}{{#notes}} @@ -34,15 +34,15 @@ use GuzzleHttp\Client; $config = Configuration::getDefaultConfiguration(FPJS_API_SECRET, Configuration::REGION_EUROPE); $client = new FingerprintApi( new Client(), - $config +$config ); {{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} try { - {{#returnType}}$result = {{/returnType}}$client->{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} - echo "
" . $response->__toString() . "
";{{/returnType}} + {{#returnType}}list($model, $httpResponse) = {{/returnType}}$client->{{{operationId}}}({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} + echo "
" . $httpResponse->getBody()->getContents() . "
";{{/returnType}} } catch (Exception $e) { echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL; } @@ -58,7 +58,10 @@ Name | Type | Description | Notes ### Return type -{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**](../Model/{{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} +Array: +0. {{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**](../Model/{{returnBaseType}}.md) | null{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null{{/returnType}}, +1. \Psr\Http\Message\ResponseInterface + ### Authorization @@ -72,4 +75,4 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) {{/operation}} -{{/operations}} +{{/operations}} \ No newline at end of file diff --git a/template/composer.mustache b/template/composer.mustache index 397d75a8..02586ed0 100644 --- a/template/composer.mustache +++ b/template/composer.mustache @@ -41,9 +41,8 @@ "ext-openssl": "*" }, "require-dev": { - "phpunit/phpunit": "8.5.33", - "squizlabs/php_codesniffer": "~2.6", - "friendsofphp/php-cs-fixer": "~2.19" + "phpunit/phpunit": "9.3.0", + "vlucas/phpdotenv": "^5.6" }, "autoload": { "psr-4": { "{{escapedInvokerPackage}}\\" : "{{srcBasePath}}/src" } diff --git a/template/model.mustache b/template/model.mustache index e1a87299..bac220d1 100644 --- a/template/model.mustache +++ b/template/model.mustache @@ -4,12 +4,9 @@ /** * {{classname}} * - * PHP version 5 - * * @category Class - * @package {{invokerPackage}} * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen + * @see https://github.com/swagger-api/swagger-codegen */ {{>partial_header}} diff --git a/template/model_generic.mustache b/template/model_generic.mustache index 98959904..a0786595 100644 --- a/template/model_generic.mustache +++ b/template/model_generic.mustache @@ -1,20 +1,18 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^parentSchema}}implements ModelInterface, ArrayAccess{{/parentSchema}} { - const DISCRIMINATOR = {{#discriminator}}'{{discriminator}}'{{/discriminator}}{{^discriminator}}null{{/discriminator}}; - /** * The original name of the model. * * @var string */ - protected static $swaggerModelName = '{{name}}'; + protected static string $swaggerModelName = '{{name}}'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ - protected static $swaggerTypes = [ + protected static array $swaggerTypes = [ {{#vars}}'{{name}}' => '{{{datatype}}}'{{#hasMore}}, {{/hasMore}}{{/vars}} ]; @@ -24,27 +22,23 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa * * @var string[] */ - protected static $swaggerFormats = [ + protected static array $swaggerFormats = [ {{#vars}}'{{name}}' => {{#dataFormat}}'{{{dataFormat}}}'{{/dataFormat}}{{^dataFormat}}null{{/dataFormat}}{{#hasMore}}, {{/hasMore}}{{/vars}} ]; /** * Array of property to type mappings. Used for (de)serialization - * - * @return array */ - public static function swaggerTypes() + public static function swaggerTypes(): array { return self::$swaggerTypes{{#parentSchema}} + parent::swaggerTypes(){{/parentSchema}}; } /** * Array of property to format mappings. Used for (de)serialization - * - * @return array */ - public static function swaggerFormats() + public static function swaggerFormats(): array { return self::$swaggerFormats{{#parentSchema}} + parent::swaggerFormats(){{/parentSchema}}; } @@ -55,7 +49,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa * * @var string[] */ - protected static $attributeMap = [ + protected static array $attributeMap = [ {{#vars}}'{{name}}' => '{{baseName}}'{{#hasMore}}, {{/hasMore}}{{/vars}} ]; @@ -65,7 +59,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa * * @var string[] */ - protected static $setters = [ + protected static array $setters = [ {{#vars}}'{{name}}' => '{{setter}}'{{#hasMore}}, {{/hasMore}}{{/vars}} ]; @@ -75,7 +69,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa * * @var string[] */ - protected static $getters = [ + protected static array $getters = [ {{#vars}}'{{name}}' => '{{getter}}'{{#hasMore}}, {{/hasMore}}{{/vars}} ]; @@ -83,40 +77,32 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa /** * Array of attributes where the key is the local name, * and the value is the original name - * - * @return array */ - public static function attributeMap() + public static function attributeMap(): array { return {{#parentSchema}}parent::attributeMap() + {{/parentSchema}}self::$attributeMap; } /** * Array of attributes to setter functions (for deserialization of responses) - * - * @return array */ - public static function setters() + public static function setters(): array { return {{#parentSchema}}parent::setters() + {{/parentSchema}}self::$setters; } /** * Array of attributes to getter functions (for serialization of requests) - * - * @return array */ - public static function getters() + public static function getters(): array { return {{#parentSchema}}parent::getters() + {{/parentSchema}}self::$getters; } /** * The original name of the model. - * - * @return string */ - public function getModelName() + public function getModelName(): string { return self::$swaggerModelName; } @@ -130,7 +116,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa * * @return string[] */ - public function {{getter}}AllowableValues() + public function {{getter}}AllowableValues(): array { return [ {{#allowableValues}}{{#enumVars}}self::{{enumName}}_{{{name}}},{{^@last}} @@ -145,7 +131,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa * * @var mixed[] */ - protected $container = []; + protected array $container = []; {{/parentSchema}} /** @@ -163,12 +149,6 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa {{#vars}} $this->container['{{name}}'] = isset($data['{{name}}']) ? $data['{{name}}'] : {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}; {{/vars}} - {{#discriminator}} - - // Initialize discriminator property with the model name. - $discriminator = array_search('{{discriminator}}', self::$attributeMap, true); - $this->container[$discriminator] = static::$swaggerModelName; - {{/discriminator}} } /** @@ -176,14 +156,14 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa * * @return array invalid properties with reasons */ - public function listInvalidProperties() + public function listInvalidProperties(): array { - {{#parent}} + {{#parentSchema}} $invalidProperties = parent::listInvalidProperties(); - {{/parent}} - {{^parent}} + {{/parentSchema}} + {{^parentSchema}} $invalidProperties = []; - {{/parent}} + {{/parentSchema}} {{#vars}} {{#required}} @@ -257,7 +237,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa * * @return bool True if all properties are valid */ - public function valid() + public function valid(): bool { return count($this->listInvalidProperties()) === 0; } @@ -266,10 +246,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa /** * Gets {{name}} - * - * @return {{datatype}} + * @return {{^required}}?{{/required}}{{datatype}} */ - public function {{getter}}() + public function {{getter}}(): {{^required}}?{{/required}}{{^isListContainer}}{{^isMapContainer}}{{^isDouble}}{{datatype}}{{/isDouble}}{{/isMapContainer}}{{/isListContainer}}{{#isListContainer}}array{{/isListContainer}}{{#isMapContainer}}array{{/isMapContainer}}{{#isDouble}}float{{/isDouble}} { return $this->container['{{name}}']; } @@ -277,11 +256,11 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa /** * Sets {{name}} * - * @param {{datatype}} ${{name}}{{#description}} {{{description}}}{{/description}}{{^description}} {{{name}}}{{/description}} + * @param {{^required}}?{{/required}}{{datatype}} ${{name}}{{#description}} {{{description}}}{{/description}}{{^description}} {{{name}}}{{/description}} * * @return $this */ - public function {{setter}}(${{name}}) + public function {{setter}}({{^required}}?{{/required}}{{^isListContainer}}{{^isMapContainer}}{{^isDouble}}{{datatype}}{{/isDouble}}{{/isMapContainer}}{{/isListContainer}}{{#isListContainer}}array{{/isListContainer}}{{#isMapContainer}}array{{/isMapContainer}}{{#isDouble}}float{{/isDouble}} ${{name}}): self { {{#isEnum}} $allowedValues = $this->{{getter}}AllowableValues(); @@ -350,11 +329,8 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa * Returns true if offset exists. False otherwise. * * @param integer $offset Offset - * - * @return boolean */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -363,11 +339,8 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa * Gets offset. * * @param integer $offset Offset - * - * @return mixed */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -377,11 +350,8 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa * * @param integer $offset Offset * @param mixed $value Value to be set - * - * @return void */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, mixed $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -394,11 +364,8 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa * Unsets offset. * * @param integer $offset Offset - * - * @return void */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -408,7 +375,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa * * @return string */ - public function __toString() + public function __toString(): string { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode( diff --git a/test/FingerprintApiTest.php b/test/FingerprintApiTest.php index 788f87f9..b1f7e580 100644 --- a/test/FingerprintApiTest.php +++ b/test/FingerprintApiTest.php @@ -3,94 +3,173 @@ namespace Fingerprint\ServerAPI; use Fingerprint\ServerAPI\Api\FingerprintApi; -use Fingerprint\ServerAPI\Model\EventResponse; +use Fingerprint\ServerAPI\Model\ErrorCommon403Response; +use Fingerprint\ServerAPI\Model\ErrorCommon429Response; +use Fingerprint\ServerAPI\Model\ErrorEvent404Response; +use Fingerprint\ServerAPI\Model\ErrorUpdateEvent400Response; +use Fingerprint\ServerAPI\Model\ErrorUpdateEvent409Response; +use Fingerprint\ServerAPI\Model\ErrorVisitor400Response; +use Fingerprint\ServerAPI\Model\ErrorVisitor404Response; +use Fingerprint\ServerAPI\Model\ErrorVisits403; +use Fingerprint\ServerAPI\Model\EventUpdateRequest; use Fingerprint\ServerAPI\Model\IdentificationError; use Fingerprint\ServerAPI\Model\ProductError; -use Fingerprint\ServerAPI\Model\Response; +use Fingerprint\ServerAPI\Model\TooManyRequestsResponse; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\GuzzleException; +use GuzzleHttp\Handler\MockHandler; +use GuzzleHttp\HandlerStack; +use GuzzleHttp\Psr7\Response; use PHPUnit\Framework\TestCase; -use ReflectionClass; class FingerprintApiTest extends TestCase { /** @var FingerprintApi */ protected $fingerprint_api; - const MOCK_REQUEST_ID = '1708102555327.NLOjmg'; - const MOCK_EXTRA_FIELDS_REQUEST_ID = '0KSh65EnVoB85JBmloQK'; - const MOCK_REQUEST_ALL_ERRORS = 'ALL_ERRORS'; - const MOCK_REQUEST_EXTRA_FIELDS = 'EXTRA_FIELDS'; - const MOCK_VISITOR_ID = 'AcxioeQKffpXF8iGQK3P'; - const MOCK_VISITOR_REQUEST_ID = '1655373780901.HhjRFX'; + public const MOCK_REQUEST_ID = '1708102555327.NLOjmg'; + public const MOCK_REQUEST_ID_WITH_UNKNOWN = 'UNKNOWN_FIELD_REQUEST_ID'; + public const MOCK_REQUEST_ID_WITH_BROKEN = 'BROKEN_FIELD_REQUEST_ID'; + public const MOCK_EXTRA_FIELDS_REQUEST_ID = '0KSh65EnVoB85JBmloQK'; + public const MOCK_REQUEST_ALL_ERRORS = 'ALL_ERRORS'; + public const MOCK_REQUEST_EXTRA_FIELDS = 'EXTRA_FIELDS'; + public const MOCK_VISITOR_ID = 'AcxioeQKffpXF8iGQK3P'; + public const MOCK_VISITOR_REQUEST_ID = '1655373780901.HhjRFX'; + public const MOCK_VISITOR_ID_403_ERROR = 'VISITOR_ID_403_ERROR'; + public const MOCK_VISITOR_ID_429_ERROR = 'VISITOR_ID_429_ERROR'; + public const MOCK_EVENT_ID_403_ERROR = 'EVENT_ID_403_ERROR'; + public const MOCK_EVENT_ID_404_ERROR = 'EVENT_ID_404_ERROR'; + public const MOCK_VISITOR_ID_400_ERROR = 'VISITOR_ID_400_ERROR'; + public const MOCK_VISITOR_ID_404_ERROR = 'VISITOR_ID_404_ERROR'; + public const MOCK_EVENT_ID_409_ERROR = 'EVENT_ID_409_ERROR'; + public const MOCK_EVENT_ID = 'MOCK_EVENT_ID'; + public const MOCK_EVENT_ID_400_ERROR = 'EVENT_ID_400_ERROR'; - protected function getMethod($method_name) - { - $class = new ReflectionClass(FingerprintApi::class); - $get_event_request_method = $class->getMethod($method_name); - $get_event_request_method->setAccessible(true); - return $get_event_request_method; - } + protected ClientInterface $client; + protected MockHandler $mockHandler; protected function getVersion() { - $config_file = file_get_contents(__DIR__ . '/../config.json'); + $config_file = file_get_contents(__DIR__ . '/../composer.json'); $config = json_decode($config_file, true); - return $config['artifactVersion']; + return $config['version']; } public function setUp(): void { - $config = new Configuration(); - $config->setHost(getenv('FP_API_HOST')); - $config->setApiKey('api_key', getenv('FP_PRIVATE_API_KEY')); - $this->fingerprint_api = $this->getMockBuilder(FingerprintApi::class) - ->getMock(); - - $this->fingerprint_api->method('getEvent')->will($this->returnCallback([$this, 'getEventMock'])); - $this->fingerprint_api->method('getVisits')->will($this->returnCallback([$this, 'getVisitsMock'])); - } - - public function getEventMock($request_id) - { - $event_request_method = $this->getMethod('getEventRequest'); - /** @var \GuzzleHttp\Psr7\Request $event_request */ - $event_request = $event_request_method->invokeArgs($this->fingerprint_api, [self::MOCK_REQUEST_ID]); - $query = $event_request->getUri()->getQuery(); - $this->assertStringContainsString("ii=" . urlencode("fingerprint-pro-server-php-sdk/" . $this->getVersion()), $query); - $mock_name = ''; - switch ($request_id) { - case self::MOCK_REQUEST_ID: - $mock_name = 'get_event_200.json'; - break; - case self::MOCK_REQUEST_ALL_ERRORS: - $mock_name = 'get_event_200_all_errors.json'; - break; - case self::MOCK_REQUEST_EXTRA_FIELDS: - $mock_name = 'get_event_200_extra_fields.json'; - break; - } - $events_mock_data = \GuzzleHttp\json_decode(file_get_contents(__DIR__ . "/mocks/$mock_name")); - return ObjectSerializer::deserialize($events_mock_data, EventResponse::class); - } - - public function getVisitsMock($visitor_id, $request_id = null, $linked_id = null, $limit = null, $before = null) - { - $visits_mock_data = \GuzzleHttp\json_decode(file_get_contents(__DIR__ . '/mocks/get_visits_200_limit_500.json')); - if ($request_id) { - $visits_mock_data->visits = array_filter($visits_mock_data->visits, function ($item) use ($request_id) { - return $item->requestId = $request_id; - }); + $this->mockHandler = new MockHandler(); + $this->client = new Client(['handler' => HandlerStack::create($this->mockHandler)]); + $this->fingerprint_api = new FingerprintApi($this->client); + } + + protected function getMockResponse(string $mockId, string $method = "GET", ?string $operationId = null): Response + { + $mock_name = ""; + $status = 200; + $headers = [ + 'Content-Type' => 'application/json', + ]; + + if ($method === "GET" || $method === "DELETE") { + switch ($mockId) { + case self::MOCK_REQUEST_ID: + $mock_name = 'get_event_200.json'; + break; + case self::MOCK_REQUEST_ALL_ERRORS: + $mock_name = 'get_event_200_all_errors.json'; + break; + case self::MOCK_REQUEST_EXTRA_FIELDS: + $mock_name = 'get_event_200_extra_fields.json'; + break; + case self::MOCK_REQUEST_ID_WITH_UNKNOWN: + $mock_name = 'get_event_200_with_unknown_field.json'; + break; + case self::MOCK_REQUEST_ID_WITH_BROKEN: + $mock_name = 'get_event_200_with_broken_format.json'; + break; + case self::MOCK_EVENT_ID_403_ERROR: + $mock_name = 'get_event_403_error.json'; + $status = 403; + break; + case self::MOCK_EVENT_ID_404_ERROR: + $mock_name = 'get_event_404_error.json'; + $status = 404; + break; + case self::MOCK_EVENT_ID_400_ERROR: + $mock_name = 'update_event_400_error.json'; + $status = 400; + break; + case self::MOCK_VISITOR_ID: + $mock_name = 'get_visits_200_limit_500.json'; + break; + case self::MOCK_VISITOR_REQUEST_ID: + $mock_name = "get_visits_200_limit_1.json"; + break; + case self::MOCK_VISITOR_ID_403_ERROR: + $mock_name = 'get_visits_403_error.json'; + $status = 403; + break; + case self::MOCK_VISITOR_ID_429_ERROR: + $mock_name = 'get_visits_429_too_many_requests_error.json'; + $status = 429; + $headers['retry-after'] = 30; + break; + case self::MOCK_VISITOR_ID_400_ERROR: + $mock_name = "400_error_incorrect_visitor_id.json"; + $status = 400; + break; + case self::MOCK_VISITOR_ID_404_ERROR: + $mock_name = "404_error_visitor_not_found.json"; + $status = 404; + break; + } } - if ($limit && is_numeric($limit)) { - $visits_mock_data->visits = array_slice($visits_mock_data->visits, 0, $limit); + if ($method === "PUT") { + switch ($mockId) { + case self::MOCK_EVENT_ID: + default: + $mock_name = "update_event.json"; + break; + case self::MOCK_EVENT_ID_409_ERROR: + $status = 409; + $mock_name = "update_event_409_error.json"; + break; + case self::MOCK_EVENT_ID_404_ERROR: + $status = 404; + $mock_name = "update_event_404_error.json"; + break; + case self::MOCK_EVENT_ID_403_ERROR: + $status = 403; + $mock_name = "update_event_403_error.json"; + break; + case self::MOCK_EVENT_ID_400_ERROR: + $status = 400; + $mock_name = "update_event_400_error.json"; + break; + } } - return ObjectSerializer::deserialize($visits_mock_data, Response::class); + + $contents = file_get_contents(__DIR__ . "/mocks/$mock_name"); + if ($operationId) { + $visits_mock_data = json_decode($contents); + $visits_mock_data->visits = array_filter($visits_mock_data->visits, function ($item) use ($operationId) { + return isset($item->requestId) && $item->requestId === $operationId; + }); + $contents = json_encode($visits_mock_data); + } + + return new Response($status, $headers, $contents); } public function testGetEvent() { - $event = $this->fingerprint_api->getEvent(self::MOCK_REQUEST_ID); + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_REQUEST_ID)); + + list($event, $response) = $this->fingerprint_api->getEvent(self::MOCK_REQUEST_ID); $products = $event->getProducts(); $identification_product = $products->getIdentification(); $botd_product = $products->getBotd(); @@ -104,9 +183,8 @@ public function testGetEvent() $virtual_machine_product = $products->getVirtualMachine(); $request_id = $identification_product->getData()->getRequestId(); $this->assertEquals(self::MOCK_REQUEST_ID, $request_id); - var_dump($botd_product->getData()->getBot()->getResult()); $this->assertEquals('notDetected', $botd_product->getData()->getBot()->getResult()); - $this->assertFalse( $vpn_product->getData()->getMethods()->getPublicVpn()); + $this->assertFalse($vpn_product->getData()->getMethods()->getPublicVpn()); $this->assertEquals('94.142.239.124', $ip_info_product->getData()->getV4()->getAddress()); $this->assertFalse($cloned_app_product->getData()->getResult()); $this->assertEquals(new \DateTime('1970-01-01T00:00:00Z'), $factory_reset_product->getData()->getTime()); @@ -120,18 +198,21 @@ public function testGetEvent() $this->assertEquals(35.73832903057337, $raw_device_attributes['audio']->value); $this->assertEquals('4dce9d6017c3e0c052a77252f29f2b1c', $raw_device_attributes['canvas']->value->Geometry); $this->assertEquals('p3', $raw_device_attributes['colorGamut']->value); - $this->assertTrue( $raw_device_attributes['cookiesEnabled']->value); + $this->assertTrue($raw_device_attributes['cookiesEnabled']->value); $location_spuffing = $products->getLocationSpoofing()->getData(); - $this->assertFalse( $location_spuffing->getResult()); + $this->assertFalse($location_spuffing->getResult()); $high_activity = $products->getHighActivity()->getData(); - $this->assertFalse( $high_activity->getResult()); + $this->assertFalse($high_activity->getResult()); } public function testGetEventWithExtraFields() { - $event = $this->fingerprint_api->getEvent(self::MOCK_REQUEST_EXTRA_FIELDS); + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_REQUEST_EXTRA_FIELDS)); + + list($event, $response) = $this->fingerprint_api->getEvent(self::MOCK_REQUEST_EXTRA_FIELDS); $products = $event->getProducts(); $identification_product = $products->getIdentification(); $request_id = $identification_product->getData()->getRequestId(); @@ -140,7 +221,10 @@ public function testGetEventWithExtraFields() public function testGetEventWithAllErrors() { - $event = $this->fingerprint_api->getEvent(self::MOCK_REQUEST_ALL_ERRORS); + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_REQUEST_ALL_ERRORS)); + + list($event, $response) = $this->fingerprint_api->getEvent(self::MOCK_REQUEST_ALL_ERRORS); $products = $event->getProducts(); $identification_error = $products->getIdentification()->getError(); $botd_error = $products->getBotd()->getError(); @@ -184,23 +268,307 @@ public function testGetEventWithAllErrors() public function testGetVisits() { - $visits = $this->fingerprint_api->getVisits(self::MOCK_VISITOR_ID); + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID)); + + list($visits, $response) = $this->fingerprint_api->getVisits(self::MOCK_VISITOR_ID); $this->assertEquals($visits->getVisitorId(), self::MOCK_VISITOR_ID); } public function testGetVisitsByRequestId() { - $visits = $this->fingerprint_api->getVisits(self::MOCK_VISITOR_ID, self::MOCK_VISITOR_REQUEST_ID); + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID, "GET", self::MOCK_VISITOR_REQUEST_ID)); + + list($visits, $response) = $this->fingerprint_api->getVisits(self::MOCK_VISITOR_ID, self::MOCK_VISITOR_REQUEST_ID); foreach ($visits->getVisits() as $visit) { - $this->assertEquals(self::MOCK_VISITOR_REQUEST_ID, $visit->getRequestId()); + $this->assertEquals($visit->getRequestId(), self::MOCK_VISITOR_REQUEST_ID); } } public function testGetVisitsWithLimit() { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID)); + $limit = 100; - $visits = $this->fingerprint_api->getVisits(self::MOCK_VISITOR_ID, null, $limit); + list($visits, $response) = $this->fingerprint_api->getVisits(self::MOCK_VISITOR_ID, null, $limit); $count = count($visits->getVisits()); $this->assertLessThanOrEqual($limit, $count); } + + public function testGetEventRawResponse() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_REQUEST_ID)); + + list($event, $response) = $this->fingerprint_api->getEvent(self::MOCK_REQUEST_ID); + $mockedResult = \GuzzleHttp\json_decode(file_get_contents(__DIR__ . "/mocks/get_event_200.json")); + $this->assertEquals($mockedResult, \GuzzleHttp\json_decode($response->getBody()->getContents())); + } + + public function testGetVisitsRawResponse() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID)); + + list($visits, $response) = $this->fingerprint_api->getVisits(self::MOCK_VISITOR_ID); + $mockedResult = \GuzzleHttp\json_decode(file_get_contents(__DIR__ . "/mocks/get_visits_200_limit_500.json")); + $this->assertEquals($mockedResult, \GuzzleHttp\json_decode($response->getBody()->getContents())); + } + + public function testGetEventParsedModelWithUnknownField() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_REQUEST_ID_WITH_UNKNOWN)); + + list($event, $response) = $this->fingerprint_api->getEvent(self::MOCK_REQUEST_ID_WITH_UNKNOWN); + $this->assertEquals(false, $event->getProducts()->getIncognito()->getData()->getResult()); + } + + public function testGetUnknownFieldFromEvent() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_REQUEST_ID_WITH_UNKNOWN)); + + list($event, $response) = $this->fingerprint_api->getEvent(self::MOCK_REQUEST_ID_WITH_UNKNOWN); + $responseBody = \GuzzleHttp\json_decode($response->getBody()->getContents()); + $this->assertEquals("field", $responseBody->unknown); + $this->assertEquals("field", $responseBody->products->unknown); + $this->assertEquals("field", $responseBody->products->identification->unknown); + $this->assertEquals("field", $responseBody->products->identification->data->unknown); + } + + public function testGetBrokenFormatEvent() + { + $event = null; + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_REQUEST_ID_WITH_BROKEN)); + + try { + list($event, $response) = $this->fingerprint_api->getEvent(self::MOCK_REQUEST_ID_WITH_BROKEN); + } catch (SerializationException $exception) { + $response = $exception->getResponse(); + } + $responseBody = \GuzzleHttp\json_decode($response->getBody()->getContents()); + + $this->assertNull($event); + $this->assertNotNull($responseBody); + $this->assertEquals("format", $responseBody->products->identification->data->linkedId->broken); + } + + public function testDeleteVisitorData() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID, "DELETE")); + + list($result, $response) = $this->fingerprint_api->deleteVisitorData(self::MOCK_VISITOR_ID); + $this->assertEquals(200, $response->getStatusCode()); + } + + public function testGetVisits403Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID_403_ERROR)); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(403); + + try { + $this->fingerprint_api->getVisits(self::MOCK_VISITOR_ID_403_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorVisits403::class, get_class($e->getErrorDetails())); + throw $e; + } + } + + public function testGetVisits429Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID_429_ERROR)); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(429); + + try { + $this->fingerprint_api->getVisits(self::MOCK_VISITOR_ID_429_ERROR); + } catch (ApiException $e) { + $this->assertEquals(TooManyRequestsResponse::class, get_class($e->getErrorDetails())); + $this->assertEquals(30, $e->getRetryAfter()); + throw $e; + } + } + + public function testGetEvent403Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_EVENT_ID_403_ERROR)); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(403); + + try { + $this->fingerprint_api->getEvent(self::MOCK_EVENT_ID_403_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorCommon403Response::class, get_class($e->getErrorDetails())); + throw $e; + } + } + + public function testGetEvent404Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_EVENT_ID_404_ERROR)); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(404); + + try { + $this->fingerprint_api->getEvent(self::MOCK_EVENT_ID_404_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorEvent404Response::class, get_class($e->getErrorDetails())); + $this->assertEquals("request id is not found", $e->getErrorDetails()->getError()->getMessage()); + $this->assertEquals("RequestNotFound", $e->getErrorDetails()->getError()->getCode()); + throw $e; + } + } + + public function testDeleteVisitorData400Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID_400_ERROR, "DELETE")); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(400); + + try { + + $this->fingerprint_api->deleteVisitorData(self::MOCK_VISITOR_ID_400_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorVisitor400Response::class, get_class($e->getErrorDetails())); + $this->assertEquals("invalid visitor id", $e->getErrorDetails()->getError()->getMessage()); + $this->assertEquals("RequestCannotBeParsed", $e->getErrorDetails()->getError()->getCode()); + throw $e; + } + } + + public function testDeleteVisitorData403Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID_403_ERROR, "DELETE")); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(403); + + try { + $this->fingerprint_api->deleteVisitorData(self::MOCK_VISITOR_ID_403_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorCommon403Response::class, get_class($e->getErrorDetails())); + throw $e; + } + } + + public function testDeleteVisitorData404Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID_404_ERROR, "DELETE")); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(404); + + try { + $this->fingerprint_api->deleteVisitorData(self::MOCK_VISITOR_ID_404_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorVisitor404Response::class, get_class($e->getErrorDetails())); + $this->assertEquals("VisitorNotFound", $e->getErrorDetails()->getError()->getCode()); + + throw $e; + } + } + + public function testDeleteVisitorData429Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID_429_ERROR, "DELETE")); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(429); + + try { + $this->fingerprint_api->deleteVisitorData(self::MOCK_VISITOR_ID_429_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorCommon429Response::class, get_class($e->getErrorDetails())); + $this->assertEquals(30, $e->getRetryAfter()); + throw $e; + } + } + + public function testUpdateEvent400Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_EVENT_ID_400_ERROR, "PUT")); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(400); + + try { + $this->fingerprint_api->updateEvent(new EventUpdateRequest([]), self::MOCK_EVENT_ID_400_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorUpdateEvent400Response::class, get_class($e->getErrorDetails())); + $this->assertEquals("RequestCannotBeParsed", $e->getErrorDetails()->getError()->getCode()); + throw $e; + } + } + + public function testUpdateEvent403Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_EVENT_ID_403_ERROR, "PUT")); + + + $this->expectException(ApiException::class); + $this->expectExceptionCode(403); + + try { + $this->fingerprint_api->updateEvent(new EventUpdateRequest([]), self::MOCK_EVENT_ID_403_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorCommon403Response::class, get_class($e->getErrorDetails())); + $this->assertEquals("TokenRequired", $e->getErrorDetails()->getError()->getCode()); + throw $e; + } + } + + public function testUpdateEvent404Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_EVENT_ID_404_ERROR, "PUT")); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(404); + + try { + $this->fingerprint_api->updateEvent(new EventUpdateRequest([]), self::MOCK_EVENT_ID_404_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorEvent404Response::class, get_class($e->getErrorDetails())); + $this->assertEquals("RequestNotFound", $e->getErrorDetails()->getError()->getCode()); + throw $e; + } + } + + public function testUpdateEvent409Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_EVENT_ID_409_ERROR, "PUT")); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(409); + + try { + $this->fingerprint_api->updateEvent(new EventUpdateRequest([]), self::MOCK_EVENT_ID_409_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorUpdateEvent409Response::class, get_class($e->getErrorDetails())); + $this->assertEquals("StateNotReady", $e->getErrorDetails()->getError()->getCode()); + throw $e; + } + } } diff --git a/test/Sealed/SealedTest.php b/test/Sealed/SealedTest.php index 608394de..6c9dedb7 100644 --- a/test/Sealed/SealedTest.php +++ b/test/Sealed/SealedTest.php @@ -2,11 +2,21 @@ namespace Fingerprint\ServerAPI\Sealed; +use DateTime; +use Fingerprint\ServerAPI\Model\BotdDetectionResult; +use Fingerprint\ServerAPI\Model\BrowserDetails; +use Fingerprint\ServerAPI\Model\Confidence; +use Fingerprint\ServerAPI\Model\DeprecatedIPLocation; use Fingerprint\ServerAPI\Model\EventResponse; +use Fingerprint\ServerAPI\ObjectSerializer; +use GuzzleHttp\Psr7\Response; use PHPUnit\Framework\TestCase; class SealedTest extends TestCase { + public const VALID_KEY = "p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="; + public const INVALID_KEY = "p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="; + public const SEALED_RESULT = "noXc7SXO+mqeAGrvBMgObi/S0fXTpP3zupk8qFqsO/1zdtWCD169iLA3VkkZh9ICHpZ0oWRzqG0M9/TnCeKFohgBLqDp6O0zEfXOv6i5q++aucItznQdLwrKLP+O0blfb4dWVI8/aSbd4ELAZuJJxj9bCoVZ1vk+ShbUXCRZTD30OIEAr3eiG9aw00y1UZIqMgX6CkFlU9L9OnKLsNsyomPIaRHTmgVTI5kNhrnVNyNsnzt9rY7fUD52DQxJILVPrUJ1Q+qW7VyNslzGYBPG0DyYlKbRAomKJDQIkdj/Uwa6bhSTq4XYNVvbk5AJ/dGwvsVdOnkMT2Ipd67KwbKfw5bqQj/cw6bj8Cp2FD4Dy4Ud4daBpPRsCyxBM2jOjVz1B/lAyrOp8BweXOXYugwdPyEn38MBZ5oL4D38jIwR/QiVnMHpERh93jtgwh9Abza6i4/zZaDAbPhtZLXSM5ztdctv8bAb63CppLU541Kf4OaLO3QLvfLRXK2n8bwEwzVAqQ22dyzt6/vPiRbZ5akh8JB6QFXG0QJF9DejsIspKF3JvOKjG2edmC9o+GfL3hwDBiihYXCGY9lElZICAdt+7rZm5UxMx7STrVKy81xcvfaIp1BwGh/HyMsJnkE8IczzRFpLlHGYuNDxdLoBjiifrmHvOCUDcV8UvhSV+UAZtAVejdNGo5G/bz0NF21HUO4pVRPu6RqZIs/aX4hlm6iO/0Ru00ct8pfadUIgRcephTuFC2fHyZxNBC6NApRtLSNLfzYTTo/uSjgcu6rLWiNo5G7yfrM45RXjalFEFzk75Z/fu9lCJJa5uLFgDNKlU+IaFjArfXJCll3apbZp4/LNKiU35ZlB7ZmjDTrji1wLep8iRVVEGht/DW00MTok7Zn7Fv+MlxgWmbZB3BuezwTmXb/fNw=="; /** * @var string */ @@ -24,8 +34,8 @@ class SealedTest extends TestCase protected function setUp(): void { - $this->validKey = base64_decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); - $this->invalidKey = base64_decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="); + $this->validKey = base64_decode(self::VALID_KEY); + $this->invalidKey = base64_decode(self::INVALID_KEY); $this->keys = [ new DecryptionKey($this->invalidKey, DecryptionAlgorithm::AES_256_GCM), @@ -35,9 +45,11 @@ protected function setUp(): void public function testUnsealEventResponse() { - $sealedResult = base64_decode("noXc7SXO+mqeAGrvBMgObi/S0fXTpP3zupk8qFqsO/1zdtWCD169iLA3VkkZh9ICHpZ0oWRzqG0M9/TnCeKFohgBLqDp6O0zEfXOv6i5q++aucItznQdLwrKLP+O0blfb4dWVI8/aSbd4ELAZuJJxj9bCoVZ1vk+ShbUXCRZTD30OIEAr3eiG9aw00y1UZIqMgX6CkFlU9L9OnKLsNsyomPIaRHTmgVTI5kNhrnVNyNsnzt9rY7fUD52DQxJILVPrUJ1Q+qW7VyNslzGYBPG0DyYlKbRAomKJDQIkdj/Uwa6bhSTq4XYNVvbk5AJ/dGwvsVdOnkMT2Ipd67KwbKfw5bqQj/cw6bj8Cp2FD4Dy4Ud4daBpPRsCyxBM2jOjVz1B/lAyrOp8BweXOXYugwdPyEn38MBZ5oL4D38jIwR/QiVnMHpERh93jtgwh9Abza6i4/zZaDAbPhtZLXSM5ztdctv8bAb63CppLU541Kf4OaLO3QLvfLRXK2n8bwEwzVAqQ22dyzt6/vPiRbZ5akh8JB6QFXG0QJF9DejsIspKF3JvOKjG2edmC9o+GfL3hwDBiihYXCGY9lElZICAdt+7rZm5UxMx7STrVKy81xcvfaIp1BwGh/HyMsJnkE8IczzRFpLlHGYuNDxdLoBjiifrmHvOCUDcV8UvhSV+UAZtAVejdNGo5G/bz0NF21HUO4pVRPu6RqZIs/aX4hlm6iO/0Ru00ct8pfadUIgRcephTuFC2fHyZxNBC6NApRtLSNLfzYTTo/uSjgcu6rLWiNo5G7yfrM45RXjalFEFzk75Z/fu9lCJJa5uLFgDNKlU+IaFjArfXJCll3apbZp4/LNKiU35ZlB7ZmjDTrji1wLep8iRVVEGht/DW00MTok7Zn7Fv+MlxgWmbZB3BuezwTmXb/fNw=="); + $sealedResult = base64_decode(self::SEALED_RESULT); + + $response = new Response(200, [], "{\"products\":{\"identification\":{\"data\":{\"visitorId\":\"2ZEDCZEfOfXjEmMuE3tq\",\"requestId\":\"1703067132750.Z5hutJ\",\"browserDetails\":{\"browserName\":\"Safari\",\"browserMajorVersion\":\"17\",\"browserFullVersion\":\"17.3\",\"os\":\"Mac OS X\",\"osVersion\":\"10.15.7\",\"device\":\"Other\",\"userAgent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Safari/605.1.15\"},\"incognito\":false,\"ip\":\"::1\",\"ipLocation\":{\"accuracyRadius\":1000,\"latitude\":59.3241,\"longitude\":18.0517,\"postalCode\":\"100 05\",\"timezone\":\"Europe/Stockholm\",\"city\":{\"name\":\"Stockholm\"},\"country\":{\"code\":\"SE\",\"name\":\"Sweden\"},\"continent\":{\"code\":\"EU\",\"name\":\"Europe\"},\"subdivisions\":[{\"isoCode\":\"AB\",\"name\":\"Stockholm County\"}]},\"timestamp\":1703067136286,\"time\":\"2023-12-20T10:12:16Z\",\"url\":\"http://localhost:8080/\",\"tag\":{\"foo\":\"bar\"},\"confidence\":{\"score\":1},\"visitorFound\":true,\"firstSeenAt\":{\"global\":\"2023-12-15T12:13:55.103Z\",\"subscription\":\"2023-12-15T12:13:55.103Z\"},\"lastSeenAt\":{\"global\":\"2023-12-19T11:39:51.52Z\",\"subscription\":\"2023-12-19T11:39:51.52Z\"}}},\"botd\":{\"data\":{\"bot\":{\"result\":\"notDetected\"},\"meta\":{\"foo\":\"bar\"},\"url\":\"http://localhost:8080/\",\"ip\":\"::1\",\"time\":\"2023-12-20T10:12:13.894Z\",\"userAgent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Safari/605.1.15\",\"requestId\":\"1703067132750.Z5hutJ\"}}}}"); - $expectedResponse = new EventResponse(json_decode("{\"products\":{\"identification\":{\"data\":{\"visitorId\":\"2ZEDCZEfOfXjEmMuE3tq\",\"requestId\":\"1703067132750.Z5hutJ\",\"browserDetails\":{\"browserName\":\"Safari\",\"browserMajorVersion\":\"17\",\"browserFullVersion\":\"17.3\",\"os\":\"Mac OS X\",\"osVersion\":\"10.15.7\",\"device\":\"Other\",\"userAgent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Safari/605.1.15\"},\"incognito\":false,\"ip\":\"::1\",\"ipLocation\":{\"accuracyRadius\":1000,\"latitude\":59.3241,\"longitude\":18.0517,\"postalCode\":\"100 05\",\"timezone\":\"Europe/Stockholm\",\"city\":{\"name\":\"Stockholm\"},\"country\":{\"code\":\"SE\",\"name\":\"Sweden\"},\"continent\":{\"code\":\"EU\",\"name\":\"Europe\"},\"subdivisions\":[{\"isoCode\":\"AB\",\"name\":\"Stockholm County\"}]},\"timestamp\":1703067136286,\"time\":\"2023-12-20T10:12:16Z\",\"url\":\"http://localhost:8080/\",\"tag\":{\"foo\":\"bar\"},\"confidence\":{\"score\":1},\"visitorFound\":true,\"firstSeenAt\":{\"global\":\"2023-12-15T12:13:55.103Z\",\"subscription\":\"2023-12-15T12:13:55.103Z\"},\"lastSeenAt\":{\"global\":\"2023-12-19T11:39:51.52Z\",\"subscription\":\"2023-12-19T11:39:51.52Z\"}}},\"botd\":{\"data\":{\"bot\":{\"result\":\"notDetected\"},\"meta\":{\"foo\":\"bar\"},\"url\":\"http://localhost:8080/\",\"ip\":\"::1\",\"time\":\"2023-12-20T10:12:13.894Z\",\"userAgent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Safari/605.1.15\",\"requestId\":\"1703067132750.Z5hutJ\"}}}}", true)); + $expectedResponse = ObjectSerializer::deserialize($response, EventResponse::class); $eventResponse = Sealed::unsealEventResponse( $sealedResult, @@ -140,4 +152,22 @@ public function testUnsealEventResponseWithInvalidNonce() $this->keys ); } + + public function testTypesAreDefinedCorrect() + { + $sealed = base64_decode(self::SEALED_RESULT); + $unsealed = Sealed::unsealEventResponse($sealed, $this->keys); + $ipLocation = $unsealed->getProducts()->getIdentification()->getData()->getIpLocation(); + $identificationTime = $unsealed->getProducts()->getIdentification()->getData()->getTime(); + $botTime = $unsealed->getProducts()->getBotd()->getData()->getTime(); + $browserDetails = $unsealed->getProducts()->getIdentification()->getData()->getBrowserDetails(); + $confidence = $unsealed->getProducts()->getIdentification()->getData()->getConfidence(); + $botResult = $unsealed->getProducts()->getBotd()->getData()->getBot(); + $this->assertEquals(DeprecatedIPLocation::class, get_class($ipLocation)); + $this->assertEquals(DateTime::class, get_class($identificationTime)); + $this->assertEquals(DateTime::class, get_class($botTime)); + $this->assertEquals(BrowserDetails::class, get_class($browserDetails)); + $this->assertEquals(Confidence::class, get_class($confidence)); + $this->assertEquals(BotdDetectionResult::class, get_class($botResult)); + } } diff --git a/test/WebhookVerifierTest.php b/test/WebhookVerifierTest.php new file mode 100644 index 00000000..3c963bc1 --- /dev/null +++ b/test/WebhookVerifierTest.php @@ -0,0 +1,51 @@ +data, $this->secret); + $this->assertTrue($result, "With valid signature"); + } + + public function testWithInvalidHeader() + { + $result = WebhookVerifier::IsValidWebhookSignature("v2=invalid", $this->data, $this->secret); + $this->assertFalse($result, "With invalid header"); + } + + public function testWithHeaderWithoutVersion() + { + $result = WebhookVerifier::IsValidWebhookSignature("invalid", $this->data, $this->secret); + $this->assertFalse($result, "With header without version"); + } + + public function testWithEmptyHeader() + { + $result = WebhookVerifier::IsValidWebhookSignature("", $this->data, $this->secret); + $this->assertFalse($result, "With empty header"); + } + + public function testWithEmptySecret() + { + $validHeader = "v1=1b2c16b75bd2a870c114153ccda5bcfca63314bc722fa160d690de133ccbb9db"; + $result = WebhookVerifier::IsValidWebhookSignature($validHeader, $this->data, ""); + $this->assertFalse($result, "With empty secret"); + } + + public function testWithEmptyData() + { + $validHeader = "v1=1b2c16b75bd2a870c114153ccda5bcfca63314bc722fa160d690de133ccbb9db"; + $result = WebhookVerifier::IsValidWebhookSignature($validHeader, "", $this->secret); + $this->assertFalse($result, "With empty data"); + } +} \ No newline at end of file diff --git a/test/mocks/400_error_empty_visitor_id.json b/test/mocks/400_error_empty_visitor_id.json new file mode 100644 index 00000000..6c5801a0 --- /dev/null +++ b/test/mocks/400_error_empty_visitor_id.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "RequestCannotBeParsed", + "message": "visitor id is required" + } +} diff --git a/test/mocks/400_error_incorrect_visitor_id.json b/test/mocks/400_error_incorrect_visitor_id.json new file mode 100644 index 00000000..c204c568 --- /dev/null +++ b/test/mocks/400_error_incorrect_visitor_id.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "RequestCannotBeParsed", + "message": "invalid visitor id" + } +} diff --git a/test/mocks/403_error_feature_not_enabled.json b/test/mocks/403_error_feature_not_enabled.json new file mode 100644 index 00000000..9820a568 --- /dev/null +++ b/test/mocks/403_error_feature_not_enabled.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "FeatureNotEnabled", + "message": "feature not enabled" + } +} diff --git a/test/mocks/403_error_token_not_found.json b/test/mocks/403_error_token_not_found.json new file mode 100644 index 00000000..3936b530 --- /dev/null +++ b/test/mocks/403_error_token_not_found.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "TokenNotFound", + "message": "secret key is not found" + } +} diff --git a/test/mocks/403_error_token_required.json b/test/mocks/403_error_token_required.json new file mode 100644 index 00000000..544d8714 --- /dev/null +++ b/test/mocks/403_error_token_required.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "TokenRequired", + "message": "secret key is required" + } +} diff --git a/test/mocks/403_error_wrong_region.json b/test/mocks/403_error_wrong_region.json new file mode 100644 index 00000000..8acc9e01 --- /dev/null +++ b/test/mocks/403_error_wrong_region.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "WrongRegion", + "message": "wrong region" + } +} diff --git a/test/mocks/404_error_visitor_not_found.json b/test/mocks/404_error_visitor_not_found.json new file mode 100644 index 00000000..11da4f3d --- /dev/null +++ b/test/mocks/404_error_visitor_not_found.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "VisitorNotFound", + "message": "visitor not found" + } +} diff --git a/test/mocks/429_error_too_many_requests.json b/test/mocks/429_error_too_many_requests.json new file mode 100644 index 00000000..e38639aa --- /dev/null +++ b/test/mocks/429_error_too_many_requests.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } +} diff --git a/test/mocks/get_event_200.json b/test/mocks/get_event_200.json index 06333763..6361db17 100644 --- a/test/mocks/get_event_200.json +++ b/test/mocks/get_event_200.json @@ -178,7 +178,8 @@ "methods": { "timezoneMismatch": false, "publicVPN": false, - "auxiliaryMobile": false + "auxiliaryMobile": false, + "osMismatch": false } } }, @@ -258,12 +259,7 @@ }, "cpuClass": {}, "fonts": { - "value": [ - "Arial Unicode MS", - "Gill Sans", - "Helvetica Neue", - "Menlo" - ] + "value": ["Arial Unicode MS", "Gill Sans", "Helvetica Neue", "Menlo"] } } }, @@ -276,6 +272,42 @@ "data": { "result": false } + }, + "remoteControl": { + "data": { + "result": false + } + }, + "velocity": { + "data": { + "distinctIp": { + "intervals": { + "5m": 1, + "1h": 1, + "24h": 1 + } + }, + "distinctLinkedId": {}, + "distinctCountry": { + "intervals": { + "5m": 1, + "1h": 2, + "24h": 2 + } + }, + "events": { + "intervals": { + "5m": 1, + "1h": 5, + "24h": 5 + } + } + } + }, + "developerTools": { + "data": { + "result": false + } } } } diff --git a/test/mocks/get_event_200_all_errors.json b/test/mocks/get_event_200_all_errors.json index 8245e5d2..2fe90ccb 100644 --- a/test/mocks/get_event_200_all_errors.json +++ b/test/mocks/get_event_200_all_errors.json @@ -135,6 +135,24 @@ "code": "Failed", "message": "internal server error" } + }, + "remoteControl": { + "error": { + "code": "Failed", + "message": "internal server error" + } + }, + "velocity": { + "error": { + "code": "Failed", + "message": "internal server error" + } + }, + "developerTools": { + "error": { + "code": "Failed", + "message": "internal server error" + } } } } diff --git a/test/mocks/get_event_200_botd_failed_error.json b/test/mocks/get_event_200_botd_failed_error.json new file mode 100644 index 00000000..f142f7b3 --- /dev/null +++ b/test/mocks/get_event_200_botd_failed_error.json @@ -0,0 +1,68 @@ +{ + "products": { + "identification": { + "data": { + "visitorId": "Ibk1527CUFmcnjLwIs4A9", + "requestId": "0KSh65EnVoB85JBmloQK", + "incognito": true, + "linkedId": "somelinkedId", + "time": "2019-05-21T16:40:13Z", + "tag": {}, + "timestamp": 1582299576512, + "url": "https://www.example.com/login", + "ip": "61.127.217.15", + "ipLocation": { + "accuracyRadius": 10, + "latitude": 49.982, + "longitude": 36.2566, + "postalCode": "61202", + "timezone": "Europe/Dusseldorf", + "city": { + "name": "Dusseldorf" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "country": { + "code": "DE", + "name": "Germany" + }, + "subdivisions": [ + { + "isoCode": "63", + "name": "North Rhine-Westphalia" + } + ] + }, + "browserDetails": { + "browserName": "Chrome", + "browserMajorVersion": "74", + "browserFullVersion": "74.0.3729", + "os": "Windows", + "osVersion": "7", + "device": "Other", + "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." + }, + "confidence": { + "score": 0.97 + }, + "visitorFound": true, + "firstSeenAt": { + "global": "2022-03-16T11:26:45.362Z", + "subscription": "2022-03-16T11:31:01.101Z" + }, + "lastSeenAt": { + "global": "2022-03-16T11:28:34.023Z", + "subscription": null + } + } + }, + "botd": { + "error": { + "code": "Failed", + "message": "internal server error" + } + } + } +} diff --git a/test/mocks/get_event_200_botd_too_many_requests_error.json b/test/mocks/get_event_200_botd_too_many_requests_error.json new file mode 100644 index 00000000..79288281 --- /dev/null +++ b/test/mocks/get_event_200_botd_too_many_requests_error.json @@ -0,0 +1,68 @@ +{ + "products": { + "identification": { + "data": { + "visitorId": "Ibk1527CUFmcnjLwIs4A9", + "requestId": "0KSh65EnVoB85JBmloQK", + "incognito": true, + "linkedId": "somelinkedId", + "tag": {}, + "time": "2019-05-21T16:40:13Z", + "timestamp": 1582299576512, + "url": "https://www.example.com/login", + "ip": "61.127.217.15", + "ipLocation": { + "accuracyRadius": 10, + "latitude": 49.982, + "longitude": 36.2566, + "postalCode": "61202", + "timezone": "Europe/Dusseldorf", + "city": { + "name": "Dusseldorf" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "country": { + "code": "DE", + "name": "Germany" + }, + "subdivisions": [ + { + "isoCode": "63", + "name": "North Rhine-Westphalia" + } + ] + }, + "browserDetails": { + "browserName": "Chrome", + "browserMajorVersion": "74", + "browserFullVersion": "74.0.3729", + "os": "Windows", + "osVersion": "7", + "device": "Other", + "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." + }, + "confidence": { + "score": 0.97 + }, + "visitorFound": true, + "firstSeenAt": { + "global": "2022-03-16T11:26:45.362Z", + "subscription": "2022-03-16T11:31:01.101Z" + }, + "lastSeenAt": { + "global": "2022-03-16T11:28:34.023Z", + "subscription": null + } + } + }, + "botd": { + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } + } + } +} diff --git a/test/mocks/get_event_200_extra_fields.json b/test/mocks/get_event_200_extra_fields.json index 03e50c01..c15eb568 100644 --- a/test/mocks/get_event_200_extra_fields.json +++ b/test/mocks/get_event_200_extra_fields.json @@ -6,6 +6,7 @@ "requestId": "0KSh65EnVoB85JBmloQK", "incognito": true, "linkedId": "somelinkedId", + "tag": {}, "time": "2019-05-21T16:40:13Z", "timestamp": 1582299576512, "url": "https://www.example.com/login", @@ -44,7 +45,8 @@ "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." }, "confidence": { - "score": 0.97 + "score": 0.97, + "revision": "v1.1" }, "visitorFound": true, "firstSeenAt": { @@ -59,6 +61,8 @@ }, "botd": { "data": { + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36", + "requestId": "1708102555327.NLOjmg", "bot": { "result": "notDetected" }, diff --git a/test/mocks/get_event_200_identification_failed_error.json b/test/mocks/get_event_200_identification_failed_error.json new file mode 100644 index 00000000..5b42c579 --- /dev/null +++ b/test/mocks/get_event_200_identification_failed_error.json @@ -0,0 +1,23 @@ +{ + "products": { + "identification": { + "error": { + "code": "Failed", + "message": "failed" + } + }, + "botd": { + "data": { + "bot": { + "result": "bad", + "type": "headlessChrome" + }, + "url": "https://example.com/login", + "ip": "94.60.143.223", + "time": "2024-02-23T10:20:25.287Z", + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/121.0.6167.57 Safari/537.36", + "requestId": "1708683625245.tuJ4nD" + } + } + } +} diff --git a/test/mocks/get_event_200_identification_too_many_requests_error.json b/test/mocks/get_event_200_identification_too_many_requests_error.json new file mode 100644 index 00000000..deacdcad --- /dev/null +++ b/test/mocks/get_event_200_identification_too_many_requests_error.json @@ -0,0 +1,23 @@ +{ + "products": { + "identification": { + "error": { + "code": "429 Too Many Requests", + "message": "too many requests" + } + }, + "botd": { + "data": { + "bot": { + "result": "bad", + "type": "headlessChrome" + }, + "url": "https://example.com/login", + "ip": "94.60.143.223", + "time": "2024-02-23T10:20:25.287Z", + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/121.0.6167.57 Safari/537.36", + "requestId": "1708683625245.tuJ4nD" + } + } + } +} diff --git a/test/mocks/get_event_200_with_broken_format.json b/test/mocks/get_event_200_with_broken_format.json new file mode 100644 index 00000000..4ac8b6f5 --- /dev/null +++ b/test/mocks/get_event_200_with_broken_format.json @@ -0,0 +1,283 @@ +{ + "products": { + "identification": { + "data": { + "visitorId": "Ibk1527CUFmcnjLwIs4A9", + "requestId": "1708102555327.NLOjmg", + "incognito": true, + "linkedId": { + "broken": "format" + }, + "tag": {}, + "time": "2019-05-21T16:40:13Z", + "timestamp": 1582299576512, + "url": "https://www.example.com/login?hope{this{works[!", + "ip": "61.127.217.15", + "ipLocation": { + "accuracyRadius": 10, + "latitude": 49.982, + "longitude": 36.2566, + "postalCode": "61202", + "timezone": "Europe/Dusseldorf", + "city": { + "name": "Dusseldorf" + }, + "country": { + "code": "DE", + "name": "Germany" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "subdivisions": [ + { + "isoCode": "63", + "name": "North Rhine-Westphalia" + } + ] + }, + "browserDetails": { + "browserName": "Chrome", + "browserMajorVersion": "74", + "browserFullVersion": "74.0.3729", + "os": "Windows", + "osVersion": "7", + "device": "Other", + "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." + }, + "confidence": { + "score": 0.97 + }, + "visitorFound": false, + "firstSeenAt": { + "global": "2022-03-16T11:26:45.362Z", + "subscription": "2022-03-16T11:31:01.101Z" + }, + "lastSeenAt": { + "global": null, + "subscription": null + } + } + }, + "botd": { + "data": { + "bot": { + "result": "notDetected" + }, + "url": "https://www.example.com/login?hope{this{works}[!", + "ip": "61.127.217.15", + "time": "2019-05-21T16:40:13Z", + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36", + "requestId": "1708102555327.NLOjmg" + } + }, + "rootApps": { + "data": { + "result": false + } + }, + "emulator": { + "data": { + "result": false + } + }, + "ipInfo": { + "data": { + "v4": { + "address": "94.142.239.124", + "geolocation": { + "accuracyRadius": 20, + "latitude": 50.05, + "longitude": 14.4, + "postalCode": "150 00", + "timezone": "Europe/Prague", + "city": { + "name": "Prague" + }, + "country": { + "code": "CZ", + "name": "Czechia" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "subdivisions": [ + { + "isoCode": "10", + "name": "Hlavni mesto Praha" + } + ] + }, + "asn": { + "asn": "7922", + "name": "COMCAST-7922", + "network": "73.136.0.0/13" + }, + "datacenter": { + "result": true, + "name": "DediPath" + } + }, + "v6": { + "address": "2001:db8:3333:4444:5555:6666:7777:8888", + "geolocation": { + "accuracyRadius": 5, + "latitude": 49.982, + "longitude": 36.2566, + "postalCode": "10112", + "timezone": "Europe/Berlin", + "city": { + "name": "Berlin" + }, + "country": { + "code": "DE", + "name": "Germany" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "subdivisions": [ + { + "isoCode": "BE", + "name": "Land Berlin" + } + ] + }, + "asn": { + "asn": "6805", + "name": "Telefonica Germany", + "network": "2a02:3100::/24" + }, + "datacenter": { + "result": false, + "name": "" + } + } + } + }, + "ipBlocklist": { + "data": { + "result": false, + "details": { + "emailSpam": false, + "attackSource": false + } + } + }, + "tor": { + "data": { + "result": false + } + }, + "vpn": { + "data": { + "result": false, + "originTimezone": "Europe/Berlin", + "originCountry": "unknown", + "methods": { + "timezoneMismatch": false, + "publicVPN": false, + "auxiliaryMobile": false + } + } + }, + "proxy": { + "data": { + "result": false + } + }, + "incognito": { + "data": { + "result": false + } + }, + "tampering": { + "data": { + "result": false, + "anomalyScore": 0.1955 + } + }, + "clonedApp": { + "data": { + "result": false + } + }, + "factoryReset": { + "data": { + "time": "1970-01-01T00:00:00Z", + "timestamp": 0 + } + }, + "jailbroken": { + "data": { + "result": false + } + }, + "frida": { + "data": { + "result": false + } + }, + "privacySettings": { + "data": { + "result": false + } + }, + "virtualMachine": { + "data": { + "result": false + } + }, + "rawDeviceAttributes": { + "data": { + "architecture": { + "value": 127 + }, + "audio": { + "value": 35.73832903057337 + }, + "canvas": { + "value": { + "Winding": true, + "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", + "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" + } + }, + "colorDepth": { + "value": 30 + }, + "colorGamut": { + "value": "p3" + }, + "contrast": { + "value": 0 + }, + "cookiesEnabled": { + "value": true + }, + "cpuClass": {}, + "fonts": { + "value": [ + "Arial Unicode MS", + "Gill Sans", + "Helvetica Neue", + "Menlo" + ] + } + } + }, + "highActivity": { + "data": { + "result": false + } + }, + "locationSpoofing": { + "data": { + "result": false + } + } + } +} diff --git a/test/mocks/get_event_200_with_unknown_field.json b/test/mocks/get_event_200_with_unknown_field.json new file mode 100644 index 00000000..eba63e09 --- /dev/null +++ b/test/mocks/get_event_200_with_unknown_field.json @@ -0,0 +1,285 @@ +{ + "unknown": "field", + "products": { + "unknown": "field", + "identification": { + "unknown": "field", + "data": { + "unknown": "field", + "visitorId": "Ibk1527CUFmcnjLwIs4A9", + "requestId": "1708102555327.NLOjmg", + "incognito": true, + "linkedId": "somelinkedId", + "tag": {}, + "time": "2019-05-21T16:40:13Z", + "timestamp": 1582299576512, + "url": "https://www.example.com/login?hope{this{works[!", + "ip": "61.127.217.15", + "ipLocation": { + "accuracyRadius": 10, + "latitude": 49.982, + "longitude": 36.2566, + "postalCode": "61202", + "timezone": "Europe/Dusseldorf", + "city": { + "name": "Dusseldorf" + }, + "country": { + "code": "DE", + "name": "Germany" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "subdivisions": [ + { + "isoCode": "63", + "name": "North Rhine-Westphalia" + } + ] + }, + "browserDetails": { + "browserName": "Chrome", + "browserMajorVersion": "74", + "browserFullVersion": "74.0.3729", + "os": "Windows", + "osVersion": "7", + "device": "Other", + "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." + }, + "confidence": { + "score": 0.97 + }, + "visitorFound": false, + "firstSeenAt": { + "global": "2022-03-16T11:26:45.362Z", + "subscription": "2022-03-16T11:31:01.101Z" + }, + "lastSeenAt": { + "global": null, + "subscription": null + } + } + }, + "botd": { + "data": { + "bot": { + "result": "notDetected" + }, + "url": "https://www.example.com/login?hope{this{works}[!", + "ip": "61.127.217.15", + "time": "2019-05-21T16:40:13Z", + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36", + "requestId": "1708102555327.NLOjmg" + } + }, + "rootApps": { + "data": { + "result": false + } + }, + "emulator": { + "data": { + "result": false + } + }, + "ipInfo": { + "data": { + "v4": { + "address": "94.142.239.124", + "geolocation": { + "accuracyRadius": 20, + "latitude": 50.05, + "longitude": 14.4, + "postalCode": "150 00", + "timezone": "Europe/Prague", + "city": { + "name": "Prague" + }, + "country": { + "code": "CZ", + "name": "Czechia" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "subdivisions": [ + { + "isoCode": "10", + "name": "Hlavni mesto Praha" + } + ] + }, + "asn": { + "asn": "7922", + "name": "COMCAST-7922", + "network": "73.136.0.0/13" + }, + "datacenter": { + "result": true, + "name": "DediPath" + } + }, + "v6": { + "address": "2001:db8:3333:4444:5555:6666:7777:8888", + "geolocation": { + "accuracyRadius": 5, + "latitude": 49.982, + "longitude": 36.2566, + "postalCode": "10112", + "timezone": "Europe/Berlin", + "city": { + "name": "Berlin" + }, + "country": { + "code": "DE", + "name": "Germany" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "subdivisions": [ + { + "isoCode": "BE", + "name": "Land Berlin" + } + ] + }, + "asn": { + "asn": "6805", + "name": "Telefonica Germany", + "network": "2a02:3100::/24" + }, + "datacenter": { + "result": false, + "name": "" + } + } + } + }, + "ipBlocklist": { + "data": { + "result": false, + "details": { + "emailSpam": false, + "attackSource": false + } + } + }, + "tor": { + "data": { + "result": false + } + }, + "vpn": { + "data": { + "result": false, + "originTimezone": "Europe/Berlin", + "originCountry": "unknown", + "methods": { + "timezoneMismatch": false, + "publicVPN": false, + "auxiliaryMobile": false + } + } + }, + "proxy": { + "data": { + "result": false + } + }, + "incognito": { + "data": { + "result": false + } + }, + "tampering": { + "data": { + "result": false, + "anomalyScore": 0.1955 + } + }, + "clonedApp": { + "data": { + "result": false + } + }, + "factoryReset": { + "data": { + "time": "1970-01-01T00:00:00Z", + "timestamp": 0 + } + }, + "jailbroken": { + "data": { + "result": false + } + }, + "frida": { + "data": { + "result": false + } + }, + "privacySettings": { + "data": { + "result": false + } + }, + "virtualMachine": { + "data": { + "result": false + } + }, + "rawDeviceAttributes": { + "data": { + "architecture": { + "value": 127 + }, + "audio": { + "value": 35.73832903057337 + }, + "canvas": { + "value": { + "Winding": true, + "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", + "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" + } + }, + "colorDepth": { + "value": 30 + }, + "colorGamut": { + "value": "p3" + }, + "contrast": { + "value": 0 + }, + "cookiesEnabled": { + "value": true + }, + "cpuClass": {}, + "fonts": { + "value": [ + "Arial Unicode MS", + "Gill Sans", + "Helvetica Neue", + "Menlo" + ] + } + } + }, + "highActivity": { + "data": { + "result": false + } + }, + "locationSpoofing": { + "data": { + "result": false + } + } + } +} diff --git a/test/mocks/get_event_403_error.json b/test/mocks/get_event_403_error.json new file mode 100644 index 00000000..544d8714 --- /dev/null +++ b/test/mocks/get_event_403_error.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "TokenRequired", + "message": "secret key is required" + } +} diff --git a/test/mocks/get_event_404_error.json b/test/mocks/get_event_404_error.json new file mode 100644 index 00000000..389b351c --- /dev/null +++ b/test/mocks/get_event_404_error.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "RequestNotFound", + "message": "request id is not found" + } +} diff --git a/test/mocks/get_visits_200_limit_1.json b/test/mocks/get_visits_200_limit_1.json new file mode 100644 index 00000000..c5bbeedf --- /dev/null +++ b/test/mocks/get_visits_200_limit_1.json @@ -0,0 +1,62 @@ +{ + "visitorId": "AcxioeQKffpXF8iGQK3P", + "visits": [ + { + "requestId": "1655373953086.DDlfmP", + "browserDetails": { + "browserName": "Chrome", + "browserMajorVersion": "102", + "browserFullVersion": "102.0.5005", + "os": "Mac OS X", + "osVersion": "10.15.7", + "device": "Other", + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36", + "botProbability": 0 + }, + "incognito": false, + "ip": "82.118.30.68", + "ipLocation": { + "accuracyRadius": 1000, + "latitude": 50.0805, + "longitude": 14.467, + "postalCode": "130 00", + "timezone": "Europe/Prague", + "city": { + "name": "Prague" + }, + "country": { + "code": "CZ", + "name": "Czechia" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "subdivisions": [ + { + "isoCode": "10", + "name": "Hlavni mesto Praha" + } + ] + }, + "timestamp": 1655373953094, + "time": "2022-06-16T10:05:53Z", + "url": "https://dashboard.fingerprint.com/", + "tag": {}, + "confidence": { + "score": 1 + }, + "visitorFound": true, + "firstSeenAt": { + "global": "2022-02-04T11:31:20Z", + "subscription": "2022-02-04T11:31:20Z" + }, + "lastSeenAt": { + "global": "2022-06-16T10:03:00.912Z", + "subscription": "2022-06-16T10:03:00.912Z" + } + } + ], + "lastTimestamp": 1655373953086, + "paginationKey": "1655373953086.DDlfmP" +} diff --git a/test/mocks/get_visits_403_error.json b/test/mocks/get_visits_403_error.json new file mode 100644 index 00000000..8a886d18 --- /dev/null +++ b/test/mocks/get_visits_403_error.json @@ -0,0 +1,3 @@ +{ + "error": "Forbidden (HTTP 403)" +} diff --git a/test/mocks/get_visits_429_too_many_requests_error.json b/test/mocks/get_visits_429_too_many_requests_error.json new file mode 100644 index 00000000..00d00f2e --- /dev/null +++ b/test/mocks/get_visits_429_too_many_requests_error.json @@ -0,0 +1,3 @@ +{ + "error": "too many requests" +} diff --git a/test/mocks/update_event_400_error.json b/test/mocks/update_event_400_error.json new file mode 100644 index 00000000..78568329 --- /dev/null +++ b/test/mocks/update_event_400_error.json @@ -0,0 +1,6 @@ +{ + "error": { + "code":"RequestCannotBeParsed", + "message":"request body is not valid" + } +} diff --git a/test/mocks/update_event_403_error.json b/test/mocks/update_event_403_error.json new file mode 100644 index 00000000..544d8714 --- /dev/null +++ b/test/mocks/update_event_403_error.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "TokenRequired", + "message": "secret key is required" + } +} diff --git a/test/mocks/update_event_404_error.json b/test/mocks/update_event_404_error.json new file mode 100644 index 00000000..389b351c --- /dev/null +++ b/test/mocks/update_event_404_error.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "RequestNotFound", + "message": "request id is not found" + } +} diff --git a/test/mocks/update_event_409_error.json b/test/mocks/update_event_409_error.json new file mode 100644 index 00000000..16ad29ae --- /dev/null +++ b/test/mocks/update_event_409_error.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "StateNotReady", + "message": "resource is not mutable yet, try again" + } +} diff --git a/test/mocks/webhook.json b/test/mocks/webhook.json new file mode 100644 index 00000000..15332a06 --- /dev/null +++ b/test/mocks/webhook.json @@ -0,0 +1,222 @@ +{ + "requestId": "Px6VxbRC6WBkA39yeNH3", + "tag": { + "requestType": "signup", + "yourCustomId": 45321 + }, + "linkedId": "any-string", + "visitorId": "3HNey93AkBW6CRbxV6xP", + "visitorFound": true, + "timestamp": 1554910997788, + "time": "2019-10-12T07:20:50.52Z", + "incognito": false, + "url": "https://banking.example.com/signup", + "clientReferrer": "https://google.com?search=banking+services", + "ip": "216.3.128.12", + "ipLocation": { + "accuracyRadius": 1, + "city": { + "name": "Bolingbrook" + }, + "continent": { + "code": "NA", + "name": "North America" + }, + "country": { + "code": "US", + "name": "United States" + }, + "latitude": 41.12933, + "longitude": -88.9954, + "postalCode": "60547", + "subdivisions": [ + { + "isoCode": "IL", + "name": "Illinois" + } + ], + "timezone": "America/Chicago" + }, + "browserDetails": { + "browserName": "Chrome", + "browserFullVersion": "73.0.3683.86", + "browserMajorVersion": "73", + "os": "Mac OS X", + "osVersion": "10.14.3", + "device": "Other", + "userAgent": "(Macintosh; Intel Mac OS X 10_14_3) Chrome/73.0.3683.86" + }, + "confidence": { + "score": 0.97 + }, + "firstSeenAt": { + "global": "2022-03-16T11:26:45.362Z", + "subscription": "2022-03-16T11:31:01.101Z" + }, + "lastSeenAt": { + "global": "2022-03-16T11:28:34.023Z", + "subscription": null + }, + "bot": { + "result": "bad", + "type": "selenium" + }, + "userAgent": "(Macintosh; Intel Mac OS X 10_14_3) Chrome/73.0.3683.86", + "ipInfo": { + "v4": { + "address": "94.142.239.124", + "geolocation": { + "accuracyRadius": 20, + "latitude": 50.05, + "longitude": 14.4, + "postalCode": "150 00", + "timezone": "Europe/Prague", + "city": { + "name": "Prague" + }, + "country": { + "code": "CZ", + "name": "Czechia" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "subdivisions": [ + { + "isoCode": "10", + "name": "Hlavni mesto Praha" + } + ] + }, + "asn": { + "asn": "7922", + "name": "COMCAST-7922", + "network": "73.136.0.0/13" + }, + "datacenter": { + "result": true, + "name": "DediPath" + } + } + }, + "rootApps": { + "result": false + }, + "emulator": { + "result": false + }, + "ipBlocklist": { + "result": false, + "details": { + "emailSpam": false, + "attackSource": false + } + }, + "tor": { + "result": false + }, + "vpn": { + "result": false, + "originTimezone": "Europe/Berlin", + "originCountry": "unknown", + "methods": { + "timezoneMismatch": false, + "publicVPN": false, + "auxiliaryMobile": false, + "osMismatch": false + } + }, + "proxy": { + "result": false + }, + "tampering": { + "result": false, + "anomalyScore": 0 + }, + "clonedApp": { + "result": false + }, + "factoryReset": { + "time": "1970-01-01T00:00:00Z", + "timestamp": 0 + }, + "jailbroken": { + "result": false + }, + "frida": { + "result": false + }, + "privacySettings": { + "result": false + }, + "virtualMachine": { + "result": false + }, + "rawDeviceAttributes": { + "architecture": { + "value": 127 + }, + "audio": { + "value": 35.73832903057337 + }, + "canvas": { + "value": { + "Winding": true, + "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", + "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" + } + }, + "colorDepth": { + "value": 30 + }, + "colorGamut": { + "value": "srgb" + }, + "contrast": { + "value": 0 + }, + "cookiesEnabled": { + "value": true + } + }, + "highActivity": { + "result": false + }, + "locationSpoofing": { + "result": true + }, + "suspectScore": { + "result": 0 + }, + "remoteControl": { + "result": false + }, + "velocity": { + "distinctIp": { + "intervals": { + "5m": 1, + "1h": 1, + "24h": 1 + } + }, + "distinctLinkedId": {}, + "distinctCountry": { + "intervals": { + "5m": 1, + "1h": 2, + "24h": 2 + } + }, + "events": { + "intervals": { + "5m": 1, + "1h": 5, + "24h": 5 + } + } + }, + "developerTools": { + "result": false + } +}