From 258edf4f2e30b4a1d77b55639c753fcab1613087 Mon Sep 17 00:00:00 2001 From: Jonathan Wenger Date: Fri, 16 Feb 2024 08:51:35 -0800 Subject: [PATCH] initial seed for php-sdk --- .github/workflows/packagist-publish.yml | 37 + .github/workflows/test.yml | 36 + .gitignore | 19 + .openapi-generator-ignore | 24 + .openapi-generator/FILES | 30 + .openapi-generator/VERSION | 1 + .php_cs | 23 + .travis.yml | 9 + .vscode/launch.json | 63 + README.md | 241 + composer.json | 46 + composer.lock | 4849 +++++++++++++++++ docs/EInvoicing/BadDownloadRequest.md | 11 + docs/EInvoicing/BadRequest.md | 10 + docs/EInvoicing/ConditionalForField.md | 10 + docs/EInvoicing/DataInputField.md | 23 + docs/EInvoicing/DataInputFieldNotUsedFor.md | 9 + docs/EInvoicing/DataInputFieldOptionalFor.md | 9 + docs/EInvoicing/DataInputFieldRequiredFor.md | 9 + docs/EInvoicing/DataInputFieldsResponse.md | 11 + docs/EInvoicing/DocumentListResponse.md | 11 + docs/EInvoicing/DocumentStatusResponse.md | 11 + docs/EInvoicing/DocumentSubmissionError.md | 10 + docs/EInvoicing/DocumentSubmitResponse.md | 9 + docs/EInvoicing/DocumentSummary.md | 20 + docs/EInvoicing/ForbiddenError.md | 9 + docs/EInvoicing/InputDataFormats.md | 10 + docs/EInvoicing/InternalServerError.md | 10 + docs/EInvoicing/Mandate.md | 16 + docs/EInvoicing/MandatesResponse.md | 11 + docs/EInvoicing/NotFoundError.md | 10 + docs/EInvoicing/NotUsedForField.md | 9 + docs/EInvoicing/RequiredWhenField.md | 9 + docs/EInvoicing/StatusEvent.md | 10 + docs/EInvoicing/SubmitDocumentData.md | 9 + docs/EInvoicing/SubmitDocumentMetadata.md | 13 + docs/EInvoicing/V1/DataInputFieldsApi.md | 81 + docs/EInvoicing/V1/DocumentsApi.md | 289 + docs/EInvoicing/V1/MandatesApi.md | 81 + docs/EInvoicing/WorkflowIds.md | 10 + git_push.sh | 57 + index.php | 79 + lib/API/EInvoicing/V1/DataInputFieldsApi.php | 604 ++ lib/API/EInvoicing/V1/DocumentsApi.php | 1937 +++++++ lib/API/EInvoicing/V1/MandatesApi.php | 625 +++ lib/ApiClient.php | 285 + lib/ApiException.php | 120 + lib/Auth/DeviceAuthorizationResponse.php | 58 + lib/Auth/OAuthHelper.php | 62 + lib/Auth/TokenResponse.php | 63 + lib/Configuration.php | 800 +++ lib/HeaderSelector.php | 108 + .../EInvoicing/V1/BadDownloadRequest.php | 394 ++ lib/Model/EInvoicing/V1/BadRequest.php | 364 ++ .../EInvoicing/V1/ConditionalForField.php | 364 ++ lib/Model/EInvoicing/V1/DataInputField.php | 754 +++ .../V1/DataInputFieldNotUsedFor.php | 334 ++ .../V1/DataInputFieldOptionalFor.php | 334 ++ .../V1/DataInputFieldRequiredFor.php | 334 ++ .../EInvoicing/V1/DataInputFieldsResponse.php | 393 ++ .../EInvoicing/V1/DocumentListResponse.php | 397 ++ .../EInvoicing/V1/DocumentStatusResponse.php | 394 ++ .../EInvoicing/V1/DocumentSubmissionError.php | 364 ++ .../EInvoicing/V1/DocumentSubmitResponse.php | 334 ++ lib/Model/EInvoicing/V1/DocumentSummary.php | 664 +++ lib/Model/EInvoicing/V1/ForbiddenError.php | 334 ++ lib/Model/EInvoicing/V1/InputDataFormats.php | 364 ++ .../EInvoicing/V1/InternalServerError.php | 364 ++ lib/Model/EInvoicing/V1/Mandate.php | 543 ++ lib/Model/EInvoicing/V1/MandatesResponse.php | 394 ++ lib/Model/EInvoicing/V1/ModelInterface.php | 124 + lib/Model/EInvoicing/V1/NotFoundError.php | 364 ++ lib/Model/EInvoicing/V1/NotUsedForField.php | 334 ++ lib/Model/EInvoicing/V1/RequiredWhenField.php | 333 ++ lib/Model/EInvoicing/V1/StatusEvent.php | 364 ++ .../EInvoicing/V1/SubmitDocumentData.php | 334 ++ .../EInvoicing/V1/SubmitDocumentMetadata.php | 469 ++ lib/Model/EInvoicing/V1/WorkflowIds.php | 364 ++ lib/Model/ModelInterface.php | 108 + lib/ObjectSerializer.php | 394 ++ lib/TokenMetadata.php | 26 + lib/Utils/BaseLogger.php | 9 + lib/Utils/LogObject.php | 72 + lib/Utils/LogOptions.php | 19 + openapitools.json | 7 + phpunit.xml.dist | 19 + test/Auth/OAuthHelperTest.php | 43 + test/Integration/DocumentsApiTest.php | 71 + 88 files changed, 21783 insertions(+) create mode 100644 .github/workflows/packagist-publish.yml create mode 100644 .github/workflows/test.yml create mode 100644 .gitignore create mode 100644 .openapi-generator-ignore create mode 100644 .openapi-generator/FILES create mode 100644 .openapi-generator/VERSION create mode 100644 .php_cs create mode 100644 .travis.yml create mode 100644 .vscode/launch.json create mode 100644 README.md create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 docs/EInvoicing/BadDownloadRequest.md create mode 100644 docs/EInvoicing/BadRequest.md create mode 100644 docs/EInvoicing/ConditionalForField.md create mode 100644 docs/EInvoicing/DataInputField.md create mode 100644 docs/EInvoicing/DataInputFieldNotUsedFor.md create mode 100644 docs/EInvoicing/DataInputFieldOptionalFor.md create mode 100644 docs/EInvoicing/DataInputFieldRequiredFor.md create mode 100644 docs/EInvoicing/DataInputFieldsResponse.md create mode 100644 docs/EInvoicing/DocumentListResponse.md create mode 100644 docs/EInvoicing/DocumentStatusResponse.md create mode 100644 docs/EInvoicing/DocumentSubmissionError.md create mode 100644 docs/EInvoicing/DocumentSubmitResponse.md create mode 100644 docs/EInvoicing/DocumentSummary.md create mode 100644 docs/EInvoicing/ForbiddenError.md create mode 100644 docs/EInvoicing/InputDataFormats.md create mode 100644 docs/EInvoicing/InternalServerError.md create mode 100644 docs/EInvoicing/Mandate.md create mode 100644 docs/EInvoicing/MandatesResponse.md create mode 100644 docs/EInvoicing/NotFoundError.md create mode 100644 docs/EInvoicing/NotUsedForField.md create mode 100644 docs/EInvoicing/RequiredWhenField.md create mode 100644 docs/EInvoicing/StatusEvent.md create mode 100644 docs/EInvoicing/SubmitDocumentData.md create mode 100644 docs/EInvoicing/SubmitDocumentMetadata.md create mode 100644 docs/EInvoicing/V1/DataInputFieldsApi.md create mode 100644 docs/EInvoicing/V1/DocumentsApi.md create mode 100644 docs/EInvoicing/V1/MandatesApi.md create mode 100644 docs/EInvoicing/WorkflowIds.md create mode 100644 git_push.sh create mode 100644 index.php create mode 100644 lib/API/EInvoicing/V1/DataInputFieldsApi.php create mode 100644 lib/API/EInvoicing/V1/DocumentsApi.php create mode 100644 lib/API/EInvoicing/V1/MandatesApi.php create mode 100644 lib/ApiClient.php create mode 100644 lib/ApiException.php create mode 100644 lib/Auth/DeviceAuthorizationResponse.php create mode 100644 lib/Auth/OAuthHelper.php create mode 100644 lib/Auth/TokenResponse.php create mode 100644 lib/Configuration.php create mode 100644 lib/HeaderSelector.php create mode 100644 lib/Model/EInvoicing/V1/BadDownloadRequest.php create mode 100644 lib/Model/EInvoicing/V1/BadRequest.php create mode 100644 lib/Model/EInvoicing/V1/ConditionalForField.php create mode 100644 lib/Model/EInvoicing/V1/DataInputField.php create mode 100644 lib/Model/EInvoicing/V1/DataInputFieldNotUsedFor.php create mode 100644 lib/Model/EInvoicing/V1/DataInputFieldOptionalFor.php create mode 100644 lib/Model/EInvoicing/V1/DataInputFieldRequiredFor.php create mode 100644 lib/Model/EInvoicing/V1/DataInputFieldsResponse.php create mode 100644 lib/Model/EInvoicing/V1/DocumentListResponse.php create mode 100644 lib/Model/EInvoicing/V1/DocumentStatusResponse.php create mode 100644 lib/Model/EInvoicing/V1/DocumentSubmissionError.php create mode 100644 lib/Model/EInvoicing/V1/DocumentSubmitResponse.php create mode 100644 lib/Model/EInvoicing/V1/DocumentSummary.php create mode 100644 lib/Model/EInvoicing/V1/ForbiddenError.php create mode 100644 lib/Model/EInvoicing/V1/InputDataFormats.php create mode 100644 lib/Model/EInvoicing/V1/InternalServerError.php create mode 100644 lib/Model/EInvoicing/V1/Mandate.php create mode 100644 lib/Model/EInvoicing/V1/MandatesResponse.php create mode 100644 lib/Model/EInvoicing/V1/ModelInterface.php create mode 100644 lib/Model/EInvoicing/V1/NotFoundError.php create mode 100644 lib/Model/EInvoicing/V1/NotUsedForField.php create mode 100644 lib/Model/EInvoicing/V1/RequiredWhenField.php create mode 100644 lib/Model/EInvoicing/V1/StatusEvent.php create mode 100644 lib/Model/EInvoicing/V1/SubmitDocumentData.php create mode 100644 lib/Model/EInvoicing/V1/SubmitDocumentMetadata.php create mode 100644 lib/Model/EInvoicing/V1/WorkflowIds.php create mode 100644 lib/Model/ModelInterface.php create mode 100644 lib/ObjectSerializer.php create mode 100644 lib/TokenMetadata.php create mode 100644 lib/Utils/BaseLogger.php create mode 100644 lib/Utils/LogObject.php create mode 100644 lib/Utils/LogOptions.php create mode 100644 openapitools.json create mode 100644 phpunit.xml.dist create mode 100644 test/Auth/OAuthHelperTest.php create mode 100644 test/Integration/DocumentsApiTest.php diff --git a/.github/workflows/packagist-publish.yml b/.github/workflows/packagist-publish.yml new file mode 100644 index 0000000..301fceb --- /dev/null +++ b/.github/workflows/packagist-publish.yml @@ -0,0 +1,37 @@ +name: PHP Composer + +on: + release: + types: [published] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Update Composer.json + run: composer update + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run test suite + run: USERNAME="${{ secrets.API_USERNAME }}" PASSWORD="${{ secrets.API_PASSWORD }}" composer run-script test + + - name: Publish Package + run: curl -XPOST -H'content-type:application/json' 'https://packagist.org/api/update-package?username=jwenger100&apiToken=${{ secrets.PACKAGIST_API_TOKEN }}' -d'{"repository":{"url":"https://github.com/avasachinbaijal/AvaTax-REST-V3-PHP-SDK"}}' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..9a6ac16 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,36 @@ +name: PHP Composer + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Update Composer.json + run: composer update + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run test suite + run: USERNAME="${{ secrets.API_USERNAME }}" PASSWORD="${{ secrets.API_PASSWORD }}" composer run-script test diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..27b6c1b --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore + +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock + +# php-cs-fixer cache +.php_cs.cache + +# PHPUnit cache +.phpunit.result.cache + +# Environment variables +.env + +app.log \ No newline at end of file diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000..b396265 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,24 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs +lib/*.php +test/** +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..869256a --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,30 @@ +.gitignore +.php_cs +.travis.yml +README.md +composer.json +docs/Api/AgeVerificationApi.md +docs/Api/ShippingVerificationApi.md +docs/Model/AgeVerifyFailureCode.md +docs/Model/AgeVerifyRequest.md +docs/Model/AgeVerifyRequestAddress.md +docs/Model/AgeVerifyResult.md +docs/Model/ErrorDetails.md +docs/Model/ErrorDetailsError.md +docs/Model/ErrorDetailsErrorDetails.md +docs/Model/ShippingVerifyResult.md +docs/Model/ShippingVerifyResultLines.md +git_push.sh +lib/API/AgeVerificationApi.php +lib/API/ShippingVerificationApi.php +lib/Model/AgeVerifyFailureCode.php +lib/Model/AgeVerifyRequest.php +lib/Model/AgeVerifyRequestAddress.php +lib/Model/AgeVerifyResult.php +lib/Model/ErrorDetails.php +lib/Model/ErrorDetailsError.php +lib/Model/ErrorDetailsErrorDetails.php +lib/Model/ModelInterface.php +lib/Model/ShippingVerifyResult.php +lib/Model/ShippingVerifyResultLines.php +phpunit.xml.dist diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..7d3cdbf --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.3.1 \ No newline at end of file diff --git a/.php_cs b/.php_cs new file mode 100644 index 0000000..d93eb06 --- /dev/null +++ b/.php_cs @@ -0,0 +1,23 @@ +setUsingCache(true) + ->setRules([ + '@PSR2' => true, + 'ordered_imports' => true, + 'phpdoc_order' => true, + 'array_syntax' => [ 'syntax' => 'short' ], + 'strict_comparison' => true, + 'strict_param' => true, + 'no_trailing_whitespace' => false, + 'no_trailing_whitespace_in_comment' => false, + 'braces' => false, + 'single_blank_line_at_eof' => false, + 'blank_line_after_namespace' => false, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->exclude('test') + ->exclude('tests') + ->in(__DIR__) + ); diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..bcfc1dc --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: php +# Bionic environment has preinstalled PHP from 7.1 to 7.4 +# https://docs.travis-ci.com/user/reference/bionic/#php-support +dist: bionic +php: + - 7.3 + - 7.4 +before_install: "composer install" +script: "vendor/bin/phpunit" diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..66a69d8 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,63 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Listen for Xdebug", + "type": "php", + "request": "launch", + "port": 9003 + }, + { + "name": "Launch currently open script", + "type": "php", + "request": "launch", + "program": "${file}", + "cwd": "${fileDirname}", + "port": 0, + "runtimeArgs": [ + "-dxdebug.start_with_request=yes" + ], + "env": { + "XDEBUG_MODE": "debug,develop", + "XDEBUG_CONFIG": "client_port=${port}" + } + }, + { + "name": "Launch Built-in web server", + "type": "php", + "request": "launch", + "runtimeArgs": [ + "-dxdebug.mode=debug", + "-dxdebug.start_with_request=yes", + "-S", + "localhost:0" + ], + "program": "", + "cwd": "${workspaceRoot}", + "port": 9003, + "serverReadyAction": { + "pattern": "Development Server \\(http://localhost:([0-9]+)\\) started", + "uriFormat": "http://localhost:%s", + "action": "openExternally" + } + }, + { + "name": "Launch Unit Tests", + "type": "php", + "request": "launch", + "program": "${workspaceFolder}/vendor/bin/phpunit", + "cwd": "${workspaceFolder}", + "env": { + "XDEBUG_CONFIG": "idekey=VSCODE remote_enable=1 profile_enable=1" + }, + "args": [ + // "--filter", + // "testCanCreateValid" + ], + "port": 9000 + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..2c93221 --- /dev/null +++ b/README.md @@ -0,0 +1,241 @@ +# OpenAPIClient-php + +API for evaluating transactions against direct-to-consumer Beverage Alcohol shipping regulations. + +This API is currently in beta. + + + +## Installation & Usage + +### Requirements + +PHP 7.3 and later. +Should also work with PHP 8.0 but has not been tested. + +### Composer + +To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`: + +```json +{ + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" + } + ], + "require": { + "GIT_USER_ID/GIT_REPO_ID": "*@dev" + } +} +``` + +Then run `composer install` + +### Manual Installation + +Download the files and include `autoload.php`: + +```php +setBearerToken('YOUR_JWT_ACCESS_TOKEN'); +$config->setAppName('YOUR_APP_NAME'); +$config->setEnvironment('sandbox'); +$config->setMachineName('YOUR_MACHINE_NAME'); +$config->setAppVersion('YOUR_APP_VERSION'); + +$client = new \Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\\SDK\Api\AddressesApi($client); + +$x_avalara_client = 'Swagger UI; 22.7.0; Custom; 1.0'; // string | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . +$body = new \Avalara\\SDK\Model\\Avatax\AddressValidationInfo(); // \Avalara\\SDK\Model\\Avatax\AddressValidationInfo | The address to resolve + +try { + $result = $apiInstance->resolveAddressPost($x_avalara_client, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AddressesApi->resolveAddressPost: ', $e->getMessage(), PHP_EOL; +} + +``` + +## Documentation for Authorization + +Authentication schemes defined for the API: + +### OAuth Client Credentials + +- **Type**: OAuth +- **Flow**: client_credentials +- **Scopes**: + - avatax_api: avatax_api scope. + +```php +setClientId('YOUR_CLIENT_ID'); +$config->setClientSecret('YOUR_CLIENT_SECRET'); +$config->setAppName('YOUR_APP_NAME'); +$config->setEnvironment('sandbox'); +$config->setMachineName('YOUR_MACHINE_NAME'); +$config->setAppVersion('YOUR_APP_VERSION'); + +$client = new \Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\\SDK\Api\AddressesApi($client); + +$x_avalara_client = 'Swagger UI; 22.7.0; Custom; 1.0'; // string | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . +$body = new \Avalara\\SDK\Model\\Avatax\AddressValidationInfo(); // \Avalara\\SDK\Model\\Avatax\AddressValidationInfo | The address to resolve + +try { + $result = $apiInstance->resolveAddressPost($x_avalara_client, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AddressesApi->resolveAddressPost: ', $e->getMessage(), PHP_EOL; +} +``` + + +### OAuth Device Code + +- **Type**: OAuth +- **Flow**: device_code +- **Scopes**: + - avatax_api: avatax_api scope. + +```php +setClientId('YOUR_CLIENT_ID'); +$config->setAppName('YOUR_APP_NAME'); +$config->setEnvironment('sandbox'); +$config->setMachineName('YOUR_MACHINE_NAME'); +$config->setAppVersion('YOUR_APP_VERSION'); + +// Fetch Device Code +$result = \Avalara\SDK\Auth\OAuthHelper::initiateDeviceAuthorizationFlow('avatax_api', $config); +// User Interaction needs to happen here - some polling logic is needed to wait for offline user to authenticate to verification_uri through browser +$tokenResult = \Avalara\SDK\Auth\OAuthHelper::getAccessTokenForDeviceFlow($result->deviceCode, $config); +// Once user authenticates, tokenResult will contain Bearer token. +$config->setBearerToken($tokenResult->accessToken); + +$client = new \Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\\SDK\Api\AddressesApi($client); + +$x_avalara_client = 'Swagger UI; 22.7.0; Custom; 1.0'; // string | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . +$body = new \Avalara\\SDK\Model\\Avatax\AddressValidationInfo(); // \Avalara\\SDK\Model\\Avatax\AddressValidationInfo | The address to resolve + +try { + $result = $apiInstance->resolveAddressPost($x_avalara_client, $body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AddressesApi->resolveAddressPost: ', $e->getMessage(), PHP_EOL; +} +``` + +## Tests + +To run the tests, use: + +```bash +composer install +vendor/bin/phpunit +``` + +## Logging + +All [PSR-3 compatible](https://www.php-fig.org/psr/psr-3/) loggers are supported by the SDK. + +### Usage + +Declare whichever PSR-3 logger that you desire and pass it in via the configuration object. The example below uses [Monolog](https://github.com/Seldaek/monolog) + +```php +use Monolog\Logger; +use Monolog\Handler\StreamHandler; + +$config = new \Avalara\SDK\Configuration(); +// Configure logger +$logger = new Logger('AddressLogger'); +$logger->pushHandler(new StreamHandler(__DIR__ . '/../../app.log', Logger::DEBUG)); +// Setup log options , first parameter is logRequestAndResponseBody, which can be true|false. Second parameter is the PSR-3 compatible logger. +$logOptions = new \Avalara\SDK\Utils\LogOptions(true, $logger); +$config->setLogOptions($logOptions); +$client = new \Avalara\SDK\ApiClient($config); +``` +## About this package + +This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: `v2` + - Package version: `2.5.0` +- Build package: `org.openapitools.codegen.languages.PhpClientCodegen` + + +## Documentation for API Endpoints + + +### EInvoicing V1 API Documentation + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DataInputFieldsApi* | [**getDataInputFields**](docs/EInvoicing/V1/DataInputFieldsApi.md#getdatainputfields) | **GET** /data-input-fields | Returns the mandatory and conditional invoice or creditnote input fields for different country mandates +*DocumentsApi* | [**downloadDocument**](docs/EInvoicing/V1/DocumentsApi.md#downloaddocument) | **GET** /documents/{documentId}/$download | Returns a copy of the document +*DocumentsApi* | [**getDocumentList**](docs/EInvoicing/V1/DocumentsApi.md#getdocumentlist) | **GET** /documents | Returns a summary of documents for a date range +*DocumentsApi* | [**getDocumentStatus**](docs/EInvoicing/V1/DocumentsApi.md#getdocumentstatus) | **GET** /document/{documentId}/status | Checks the status of a document +*DocumentsApi* | [**submitDocument**](docs/EInvoicing/V1/DocumentsApi.md#submitdocument) | **POST** /documents | Submits a document to Avalara E-Invoicing API +*MandatesApi* | [**getMandates**](docs/EInvoicing/V1/MandatesApi.md#getmandates) | **GET** /mandates | List country mandates that are supported by the Avalara E-Invoicing platform + + +## Documentation for Models + + +### EInvoicing V1 Model Documentation + + - [Avalara\SDK\Model\EInvoicing\V1\BadDownloadRequest](docs/EInvoicing/V1/BadDownloadRequest.md) + - [Avalara\SDK\Model\EInvoicing\V1\BadRequest](docs/EInvoicing/V1/BadRequest.md) + - [Avalara\SDK\Model\EInvoicing\V1\ConditionalForField](docs/EInvoicing/V1/ConditionalForField.md) + - [Avalara\SDK\Model\EInvoicing\V1\DataInputField](docs/EInvoicing/V1/DataInputField.md) + - [Avalara\SDK\Model\EInvoicing\V1\DataInputFieldNotUsedFor](docs/EInvoicing/V1/DataInputFieldNotUsedFor.md) + - [Avalara\SDK\Model\EInvoicing\V1\DataInputFieldOptionalFor](docs/EInvoicing/V1/DataInputFieldOptionalFor.md) + - [Avalara\SDK\Model\EInvoicing\V1\DataInputFieldRequiredFor](docs/EInvoicing/V1/DataInputFieldRequiredFor.md) + - [Avalara\SDK\Model\EInvoicing\V1\DataInputFieldsResponse](docs/EInvoicing/V1/DataInputFieldsResponse.md) + - [Avalara\SDK\Model\EInvoicing\V1\DocumentListResponse](docs/EInvoicing/V1/DocumentListResponse.md) + - [Avalara\SDK\Model\EInvoicing\V1\DocumentStatusResponse](docs/EInvoicing/V1/DocumentStatusResponse.md) + - [Avalara\SDK\Model\EInvoicing\V1\DocumentSubmissionError](docs/EInvoicing/V1/DocumentSubmissionError.md) + - [Avalara\SDK\Model\EInvoicing\V1\DocumentSubmitResponse](docs/EInvoicing/V1/DocumentSubmitResponse.md) + - [Avalara\SDK\Model\EInvoicing\V1\DocumentSummary](docs/EInvoicing/V1/DocumentSummary.md) + - [Avalara\SDK\Model\EInvoicing\V1\ForbiddenError](docs/EInvoicing/V1/ForbiddenError.md) + - [Avalara\SDK\Model\EInvoicing\V1\InputDataFormats](docs/EInvoicing/V1/InputDataFormats.md) + - [Avalara\SDK\Model\EInvoicing\V1\InternalServerError](docs/EInvoicing/V1/InternalServerError.md) + - [Avalara\SDK\Model\EInvoicing\V1\Mandate](docs/EInvoicing/V1/Mandate.md) + - [Avalara\SDK\Model\EInvoicing\V1\MandatesResponse](docs/EInvoicing/V1/MandatesResponse.md) + - [Avalara\SDK\Model\EInvoicing\V1\NotFoundError](docs/EInvoicing/V1/NotFoundError.md) + - [Avalara\SDK\Model\EInvoicing\V1\NotUsedForField](docs/EInvoicing/V1/NotUsedForField.md) + - [Avalara\SDK\Model\EInvoicing\V1\RequiredWhenField](docs/EInvoicing/V1/RequiredWhenField.md) + - [Avalara\SDK\Model\EInvoicing\V1\StatusEvent](docs/EInvoicing/V1/StatusEvent.md) + - [Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentData](docs/EInvoicing/V1/SubmitDocumentData.md) + - [Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentMetadata](docs/EInvoicing/V1/SubmitDocumentMetadata.md) + - [Avalara\SDK\Model\EInvoicing\V1\WorkflowIds](docs/EInvoicing/V1/WorkflowIds.md) diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..64e3066 --- /dev/null +++ b/composer.json @@ -0,0 +1,46 @@ +{ + "name": "avalaratest/avalara_test_sdk", + "description": "API for evaluating transactions against direct-to-consumer Beverage Alcohol shipping regulations. This API is currently in beta.", + "keywords": [ + "openapitools", + "openapi-generator", + "openapi", + "php", + "sdk", + "rest", + "api" + ], + "homepage": "https://openapi-generator.tech", + "license": "unlicense", + "authors": [ + { + "name": "OpenAPI-Generator contributors", + "homepage": "https://openapi-generator.tech" + } + ], + "require": { + "php": "^7.3 || ^8.0", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^7.3", + "guzzlehttp/psr7": "^1.7 || ^2.0", + "php-ds/php-ds": "^1.4", + "psr/log": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0 || ^9.0", + "friendsofphp/php-cs-fixer": "^2.12", + "vlucas/phpdotenv": "^5.4", + "monolog/monolog": "^3.2" + }, + "autoload": { + "psr-4": { "Avalara\\SDK\\" : "lib/" } + }, + "autoload-dev": { + "psr-4": { "Avalara\\SDK\\Test\\" : "test/" } + }, + "scripts": { + "test": "php -d xdebug.profiler_enable=on vendor/bin/phpunit" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..c043507 --- /dev/null +++ b/composer.lock @@ -0,0 +1,4849 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "cbac101495022ce891b6b01731f12893", + "packages": [ + { + "name": "guzzlehttp/guzzle", + "version": "7.5.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b50a2a1251152e43f6a37f0fa053e730a67d25ba", + "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5", + "guzzlehttp/psr7": "^1.9 || ^2.4", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", + "ext-curl": "*", + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.5.29 || ^9.5.23", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, + "branch-alias": { + "dev-master": "7.5-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.5.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2022-08-28T15:39:27+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "1.5.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "b94b2807d85443f9719887892882d0329d1e2598" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598", + "reference": "b94b2807d85443f9719887892882d0329d1e2598", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.2" + }, + "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": "2022-08-28T14:55:35+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.4.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "67c26b443f348a51926030c83481b85718457d3d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/67c26b443f348a51926030c83481b85718457d3d", + "reference": "67c26b443f348a51926030c83481b85718457d3d", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "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" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.4.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2022-10-26T14:07:24+00:00" + }, + { + "name": "php-ds/php-ds", + "version": "v1.4.1", + "source": { + "type": "git", + "url": "https://github.com/php-ds/polyfill.git", + "reference": "43d2df301a9e2017f67b8c11d94a5222f9c00fd1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-ds/polyfill/zipball/43d2df301a9e2017f67b8c11d94a5222f9c00fd1", + "reference": "43d2df301a9e2017f67b8c11d94a5222f9c00fd1", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=7.0" + }, + "provide": { + "ext-ds": "1.3.0" + }, + "require-dev": { + "php-ds/tests": "^1.3" + }, + "suggest": { + "ext-ds": "to improve performance and reduce memory usage" + }, + "type": "library", + "autoload": { + "psr-4": { + "Ds\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Rudi Theunissen", + "email": "rudolf.theunissen@gmail.com" + } + ], + "keywords": [ + "data structures", + "ds", + "php", + "polyfill" + ], + "support": { + "issues": "https://github.com/php-ds/polyfill/issues", + "source": "https://github.com/php-ds/polyfill/tree/v1.4.1" + }, + "time": "2022-03-09T20:39:30+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client/tree/master" + }, + "time": "2020-06-29T06:28:15+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, + "time": "2019-04-30T12:38:16+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.0" + }, + "time": "2021-07-14T16:46:02+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.1.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "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": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.1" + }, + "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": "2022-02-25T11:15:52+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" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/1.0.1" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "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" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.3.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "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" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/2.0.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-02-24T20:20:32+00:00" + }, + { + "name": "doctrine/annotations", + "version": "1.13.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "648b0343343565c4a056bfc8392201385e8d89f0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/648b0343343565c4a056bfc8392201385e8d89f0", + "reference": "648b0343343565c4a056bfc8392201385e8d89f0", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "ext-tokenizer": "*", + "php": "^7.1 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" + }, + "require-dev": { + "doctrine/cache": "^1.11 || ^2.0", + "doctrine/coding-standard": "^6.0 || ^8.1", + "phpstan/phpstan": "^1.4.10 || ^1.8.0", + "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", + "symfony/cache": "^4.4 || ^5.2", + "vimeo/psalm": "^4.10" + }, + "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" + ], + "support": { + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/1.13.3" + }, + "time": "2022-07-02T10:48:51+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.22" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "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" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-03-03T08:28:38+00:00" + }, + { + "name": "doctrine/lexer", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", + "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9.0", + "phpstan/phpstan": "^1.3", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + } + }, + "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" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/1.2.3" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2022-02-28T11:07:21+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", + "support": { + "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.3" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2021-11-15T17:17:55+00:00" + }, + { + "name": "graham-campbell/result-type", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/a878d45c1914464426dc94da61c9e1d36ae262a8", + "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.28 || ^9.5.21" + }, + "type": "library", + "autoload": { + "psr-4": { + "GrahamCampbell\\ResultType\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "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.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", + "type": "tidelift" + } + ], + "time": "2022-07-30T15:56:11+00:00" + }, + { + "name": "monolog/monolog", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "305444bc6fb6c89e490f4b34fa6e979584d7fa81" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/305444bc6fb6c89e490f4b34fa6e979584d7fa81", + "reference": "305444bc6fb6c89e490f4b34fa6e979584d7fa81", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/log": "^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7 || ^8", + "ext-json": "*", + "graylog2/gelf-php": "^1.4.2", + "guzzlehttp/guzzle": "^7.4", + "guzzlehttp/psr7": "^2.2", + "mongodb/mongodb": "^1.8", + "php-amqplib/php-amqplib": "~2.4 || ^3", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^9.5.16", + "predis/predis": "^1.1", + "ruflin/elastica": "^7", + "symfony/mailer": "^5.4 || ^6", + "symfony/mime": "^5.4 || ^6" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2022-07-24T12:00: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" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2022-03-03T13:19:32+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.15.1", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", + "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1" + }, + "time": "2022-09-04T07:30:47+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": [ + { + "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": "Developer" + } + ], + "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.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "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" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "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": "php-cs-fixer/diff", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/diff.git", + "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", + "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", + "symfony/process": "^3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "SpacePossum" + } + ], + "description": "sebastian/diff v2 backport support for PHP5.6", + "homepage": "https://github.com/PHP-CS-Fixer", + "keywords": [ + "diff" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/diff/issues", + "source": "https://github.com/PHP-CS-Fixer/diff/tree/v1.3.1" + }, + "abandoned": true, + "time": "2020-10-14T08:39:05+00:00" + }, + { + "name": "phpoption/phpoption", + "version": "1.9.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", + "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8", + "phpunit/phpunit": "^8.5.28 || ^9.5.21" + }, + "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.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", + "type": "tidelift" + } + ], + "time": "2022-07-30T15:51:26+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.18", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/12fddc491826940cf9b7e88ad9664cf51f0f6d0a", + "reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.14", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.18" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-10-27T13:35:33+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "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": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "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": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "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": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "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-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.5.25", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d", + "reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d", + "shasum": "" + }, + "require": { + "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.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.13", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.8", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.5", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^3.2", + "sebastian/version": "^3.0.2" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.5-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "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.5.25" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2022-09-25T03:44:45+00:00" + }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" + }, + "time": "2021-11-05T16:50:12+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "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" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "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": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "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/comparator", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "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" + } + ], + "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/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "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.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "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.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "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.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-04-03T09:37:03+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "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": "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.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T06:03:37+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-02-14T08:28:10+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "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.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "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": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "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": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "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": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "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/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-12T14:47:03+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "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": "2020-09-28T06:39:44+00:00" + }, + { + "name": "symfony/console", + "version": "v5.2.11", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "2f93c8c64295e029b7ff4d68b9a59c5ad8b7e24a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/2f93c8c64295e029b7ff4d68b9a59c5ad8b7e24a", + "reference": "2f93c8c64295e029b7ff4d68b9a59c5ad8b7e24a", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1|^2", + "symfony/string": "^5.1" + }, + "conflict": { + "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" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.2.11" + }, + "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": "2021-06-06T09:50:27+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v5.4.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", + "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc", + "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" + }, + "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": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.9" + }, + "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": "2022-05-05T16:45:39+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.1.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "02ff5eea2f453731cfbc6bc215e456b781480448" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/02ff5eea2f453731cfbc6bc215e456b781480448", + "reference": "02ff5eea2f453731cfbc6bc215e456b781480448", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "suggest": { + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "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": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.1.1" + }, + "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": "2022-02-25T11:15:52+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v5.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "ac09569844a9109a5966b9438fc29113ce77cf51" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/ac09569844a9109a5966b9438fc29113ce77cf51", + "reference": "ac09569844a9109a5966b9438fc29113ce77cf51", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.13" + }, + "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": "2022-09-21T19:53:16+00:00" + }, + { + "name": "symfony/finder", + "version": "v5.4.11", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/7872a66f57caffa2916a584db1aa7f12adc76f8c", + "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.4.11" + }, + "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": "2022-07-29T07:37:50+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v5.4.11", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "54f14e36aa73cb8f7261d7686691fd4d75ea2690" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/54f14e36aa73cb8f7261d7686691fd4d75ea2690", + "reference": "54f14e36aa73cb8f7261d7686691fd4d75ea2690", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php73": "~1.0", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v5.4.11" + }, + "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": "2022-07-20T13:00:38+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.26.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "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" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.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": "2022-05-24T11:49:31+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.26.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "433d05519ce6990bf3530fba6957499d327395c2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", + "reference": "433d05519ce6990bf3530fba6957499d327395c2", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "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 intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.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": "2022-05-24T11:49:31+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.26.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "219aa369ceff116e673852dce47c3a41794c14bd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", + "reference": "219aa369ceff116e673852dce47c3a41794c14bd", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "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 intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.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": "2022-05-24T11:49:31+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.26.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.26-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" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.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": "2022-05-24T11:49:31+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" + }, + "type": "metapackage", + "extra": { + "branch-alias": { + "dev-main": "1.20-dev" + }, + "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" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php70/tree/v1.20.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": "2020-10-23T14:02:19+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.26.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/bf44a9fd41feaac72b074de600314a93e2ae78e2", + "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + } + }, + "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 backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.26.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": "2022-05-24T11:49:31+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.26.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85", + "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "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 backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.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": "2022-05-24T11:49:31+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.26.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.26-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" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.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": "2022-05-10T07:21:04+00:00" + }, + { + "name": "symfony/process", + "version": "v5.4.11", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/6e75fe6874cbc7e4773d049616ab450eff537bf1", + "reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v5.4.11" + }, + "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": "2022-06-27T16:58:25+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.5.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "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": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" + }, + "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": "2022-05-30T19:17:29+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v5.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "6df7a3effde34d81717bbef4591e5ffe32226d69" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/6df7a3effde34d81717bbef4591e5ffe32226d69", + "reference": "6df7a3effde34d81717bbef4591e5ffe32226d69", + "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" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v5.4.13" + }, + "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": "2022-09-28T13:19:49+00:00" + }, + { + "name": "symfony/string", + "version": "v5.4.14", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "089e7237497fae7a9c404d0c3aeb8db3254733e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/089e7237497fae7a9c404d0c3aeb8db3254733e4", + "reference": "089e7237497fae7a9c404d0c3aeb8db3254733e4", + "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" + }, + "conflict": { + "symfony/translation-contracts": ">=3.0" + }, + "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" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "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": "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", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.4.14" + }, + "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": "2022-10-05T15:16:54+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" + } + ], + "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.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+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" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^7.3 || ^8.0", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*" + }, + "platform-dev": [], + "plugin-api-version": "2.2.0" +} diff --git a/docs/EInvoicing/BadDownloadRequest.md b/docs/EInvoicing/BadDownloadRequest.md new file mode 100644 index 0000000..54612f6 --- /dev/null +++ b/docs/EInvoicing/BadDownloadRequest.md @@ -0,0 +1,11 @@ +# # BadDownloadRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **string** | The three-digit HTTP error code for the bad request | [optional] +**message** | **string** | A message explaining the bad request | [optional] +**supported_accept_headers** | **object** | A message explaining the bad request | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/BadRequest.md b/docs/EInvoicing/BadRequest.md new file mode 100644 index 0000000..8e8c1bc --- /dev/null +++ b/docs/EInvoicing/BadRequest.md @@ -0,0 +1,10 @@ +# # BadRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **string** | The three-digit HTTP error code for the bad request | [optional] +**message** | **string** | A message explaining the bad request | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/ConditionalForField.md b/docs/EInvoicing/ConditionalForField.md new file mode 100644 index 0000000..d1dd310 --- /dev/null +++ b/docs/EInvoicing/ConditionalForField.md @@ -0,0 +1,10 @@ +# # ConditionalForField + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country_mandate** | **string** | | [optional] +**required_when** | [**\Avalara\SDK\Model\EInvoicing\V1\RequiredWhenField[]**](RequiredWhenField.md) | Array of scenarios which describe when a particular field is conditional for a country mandate | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DataInputField.md b/docs/EInvoicing/DataInputField.md new file mode 100644 index 0000000..8c0616d --- /dev/null +++ b/docs/EInvoicing/DataInputField.md @@ -0,0 +1,23 @@ +# # DataInputField + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Field UUID | [optional] +**field_id** | **string** | Field ID | [optional] +**applicable_document_roots** | **object[]** | | [optional] +**path** | **string** | Path to this field | [optional] +**name_space** | **string** | Namespace of this field | [optional] +**field_name** | **string** | Field name | [optional] +**example_or_fixed_value** | **string** | An example of the content for this field | [optional] +**accepted_values** | **object** | An object representing the acceptable values for this field | [optional] +**documentation_link** | **string** | An example of the content for this field | [optional] +**description** | **string** | A description of this field | [optional] +**is_segment** | **bool** | Is this a segment of the schema | [optional] +**required_for** | [**\Avalara\SDK\Model\EInvoicing\V1\DataInputFieldRequiredFor**](DataInputFieldRequiredFor.md) | | [optional] +**conditional_for** | [**\Avalara\SDK\Model\EInvoicing\V1\ConditionalForField[]**](ConditionalForField.md) | | [optional] +**not_used_for** | [**\Avalara\SDK\Model\EInvoicing\V1\DataInputFieldNotUsedFor**](DataInputFieldNotUsedFor.md) | | [optional] +**optional_for** | [**\Avalara\SDK\Model\EInvoicing\V1\DataInputFieldOptionalFor**](DataInputFieldOptionalFor.md) | | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DataInputFieldNotUsedFor.md b/docs/EInvoicing/DataInputFieldNotUsedFor.md new file mode 100644 index 0000000..fc7caa8 --- /dev/null +++ b/docs/EInvoicing/DataInputFieldNotUsedFor.md @@ -0,0 +1,9 @@ +# # DataInputFieldNotUsedFor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country_mandate** | **string** | | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DataInputFieldOptionalFor.md b/docs/EInvoicing/DataInputFieldOptionalFor.md new file mode 100644 index 0000000..6a53481 --- /dev/null +++ b/docs/EInvoicing/DataInputFieldOptionalFor.md @@ -0,0 +1,9 @@ +# # DataInputFieldOptionalFor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country_mandate** | **string** | | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DataInputFieldRequiredFor.md b/docs/EInvoicing/DataInputFieldRequiredFor.md new file mode 100644 index 0000000..c81d83c --- /dev/null +++ b/docs/EInvoicing/DataInputFieldRequiredFor.md @@ -0,0 +1,9 @@ +# # DataInputFieldRequiredFor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country_mandate** | **string** | | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DataInputFieldsResponse.md b/docs/EInvoicing/DataInputFieldsResponse.md new file mode 100644 index 0000000..ab063b0 --- /dev/null +++ b/docs/EInvoicing/DataInputFieldsResponse.md @@ -0,0 +1,11 @@ +# # DataInputFieldsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**at_record_set_count** | **float** | Total count of results | [optional] +**at_next_link** | **string** | | [optional] +**value** | [**\Avalara\SDK\Model\EInvoicing\V1\DataInputField[]**](DataInputField.md) | Array of Data Input Fields | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DocumentListResponse.md b/docs/EInvoicing/DocumentListResponse.md new file mode 100644 index 0000000..faf551f --- /dev/null +++ b/docs/EInvoicing/DocumentListResponse.md @@ -0,0 +1,11 @@ +# # DocumentListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**at_record_set_count** | **string** | Count of collections for the given date range | [optional] +**at_next_link** | **string** | | [optional] +**value** | [**\Avalara\SDK\Model\EInvoicing\V1\DocumentSummary[]**](DocumentSummary.md) | Array of invoices matching query parameters | + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DocumentStatusResponse.md b/docs/EInvoicing/DocumentStatusResponse.md new file mode 100644 index 0000000..0972000 --- /dev/null +++ b/docs/EInvoicing/DocumentStatusResponse.md @@ -0,0 +1,11 @@ +# # DocumentStatusResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The unique ID for this document | [optional] +**status** | **string** | Status of the transaction: <br> 'Pending' <br> 'Failed' <br> 'Complete' | [optional] +**events** | [**\Avalara\SDK\Model\EInvoicing\V1\StatusEvent[]**](StatusEvent.md) | | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DocumentSubmissionError.md b/docs/EInvoicing/DocumentSubmissionError.md new file mode 100644 index 0000000..2e8a48f --- /dev/null +++ b/docs/EInvoicing/DocumentSubmissionError.md @@ -0,0 +1,10 @@ +# # DocumentSubmissionError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status_code** | **string** | The three-digit HTTP status code for the exception | [optional] +**message** | **string** | A message explaining the exception | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DocumentSubmitResponse.md b/docs/EInvoicing/DocumentSubmitResponse.md new file mode 100644 index 0000000..aa9ae26 --- /dev/null +++ b/docs/EInvoicing/DocumentSubmitResponse.md @@ -0,0 +1,9 @@ +# # DocumentSubmitResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Unique ID for this document that can be used for status checking and file downloads. This is a UID created by the Avalara E-Invoicing platform. | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DocumentSummary.md b/docs/EInvoicing/DocumentSummary.md new file mode 100644 index 0000000..3fe9dd2 --- /dev/null +++ b/docs/EInvoicing/DocumentSummary.md @@ -0,0 +1,20 @@ +# # DocumentSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The unique ID for this document | [optional] +**process_date_time** | **string** | The date and time when the document was processed, displayed in the format YYYY-MM-DDThh:mm:ss | [optional] +**status** | **string** | The transaction status: <br> 'Pending' <br> 'Failed' <br> 'Complete' | [optional] +**supplier_name** | **string** | The name of the supplier in the transaction | [optional] +**customer_name** | **string** | The name of the customer in the transaction | [optional] +**document_number** | **string** | The invoice document number | [optional] +**document_date** | **string** | The invoice issue date | [optional] +**flow** | **string** | The invoice direction, where issued = `out` and received = `in` | [optional] +**country_code** | **string** | The two-letter ISO-3166 country code for the country where the e-invoice is being submitted | [optional] +**country_mandate** | **string** | The e-invoicing mandate for the specified country | [optional] +**interface** | **string** | The interface where the invoice data is sent | [optional] +**receiver** | **string** | The invoice recipient based on the interface | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/ForbiddenError.md b/docs/EInvoicing/ForbiddenError.md new file mode 100644 index 0000000..94c1b1e --- /dev/null +++ b/docs/EInvoicing/ForbiddenError.md @@ -0,0 +1,9 @@ +# # ForbiddenError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **string** | A message that informs the user that they may not access a resource | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/InputDataFormats.md b/docs/EInvoicing/InputDataFormats.md new file mode 100644 index 0000000..7875618 --- /dev/null +++ b/docs/EInvoicing/InputDataFormats.md @@ -0,0 +1,10 @@ +# # InputDataFormats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**format** | **string** | Invoice format | [optional] +**versions** | **string[]** | | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/InternalServerError.md b/docs/EInvoicing/InternalServerError.md new file mode 100644 index 0000000..0146795 --- /dev/null +++ b/docs/EInvoicing/InternalServerError.md @@ -0,0 +1,10 @@ +# # InternalServerError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **string** | A bad request error code | [optional] +**message** | **string** | A message explaining the bad request error | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/Mandate.md b/docs/EInvoicing/Mandate.md new file mode 100644 index 0000000..81a3e75 --- /dev/null +++ b/docs/EInvoicing/Mandate.md @@ -0,0 +1,16 @@ +# # Mandate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mandate_id** | **string** | Mandate UUID | [optional] +**country_mandate** | **string** | Country mandate name | [optional] +**country_code** | **string** | Country code | [optional] +**description** | **string** | Mandate description | [optional] +**supported_by_partner_api** | **bool** | Indicates whether this mandate supported by the partner API | [optional] +**mandate_format** | **string** | Mandate format | [optional] +**input_data_formats** | [**\Avalara\SDK\Model\EInvoicing\V1\InputDataFormats[]**](InputDataFormats.md) | Format and version used when inputting the data | [optional] +**workflow_ids** | [**\Avalara\SDK\Model\EInvoicing\V1\WorkflowIds[]**](WorkflowIds.md) | Workflow ID list | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/MandatesResponse.md b/docs/EInvoicing/MandatesResponse.md new file mode 100644 index 0000000..456a79f --- /dev/null +++ b/docs/EInvoicing/MandatesResponse.md @@ -0,0 +1,11 @@ +# # MandatesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**at_record_set_count** | **float** | Total count of results | [optional] +**at_next_link** | **string** | | [optional] +**value** | [**\Avalara\SDK\Model\EInvoicing\V1\Mandate[]**](Mandate.md) | Mandates schema | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/NotFoundError.md b/docs/EInvoicing/NotFoundError.md new file mode 100644 index 0000000..b066538 --- /dev/null +++ b/docs/EInvoicing/NotFoundError.md @@ -0,0 +1,10 @@ +# # NotFoundError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **string** | The three-digit HTTP error code for a not found error | [optional] +**message** | **string** | A message about the not found error | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/NotUsedForField.md b/docs/EInvoicing/NotUsedForField.md new file mode 100644 index 0000000..e545883 --- /dev/null +++ b/docs/EInvoicing/NotUsedForField.md @@ -0,0 +1,9 @@ +# # NotUsedForField + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country_mandate** | **string** | | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/RequiredWhenField.md b/docs/EInvoicing/RequiredWhenField.md new file mode 100644 index 0000000..9f6757d --- /dev/null +++ b/docs/EInvoicing/RequiredWhenField.md @@ -0,0 +1,9 @@ +# # RequiredWhenField + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**scenario** | **string** | | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/StatusEvent.md b/docs/EInvoicing/StatusEvent.md new file mode 100644 index 0000000..98e6364 --- /dev/null +++ b/docs/EInvoicing/StatusEvent.md @@ -0,0 +1,10 @@ +# # StatusEvent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**event_date_time** | **string** | The date and time when the status event occured, displayed in the format YYYY-MM-DDThh:mm:ss | [optional] +**message** | **string** | A message describing the status event | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/SubmitDocumentData.md b/docs/EInvoicing/SubmitDocumentData.md new file mode 100644 index 0000000..5897a61 --- /dev/null +++ b/docs/EInvoicing/SubmitDocumentData.md @@ -0,0 +1,9 @@ +# # SubmitDocumentData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | **string** | The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/SubmitDocumentMetadata.md b/docs/EInvoicing/SubmitDocumentMetadata.md new file mode 100644 index 0000000..c1273d0 --- /dev/null +++ b/docs/EInvoicing/SubmitDocumentMetadata.md @@ -0,0 +1,13 @@ +# # SubmitDocumentMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**workflow_id** | **string** | Specifies a unique ID for this workflow. | +**data_format** | **string** | Specifies the data format for this workflow. | +**data_format_version** | **string** | Specifies the data format version number. | +**country_code** | **string** | The two-letter ISO-3166 country code for the country where the e-invoice is being submitted | +**country_mandate** | **string** | The e-invoicing mandate for the specified country. | + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/V1/DataInputFieldsApi.md b/docs/EInvoicing/V1/DataInputFieldsApi.md new file mode 100644 index 0000000..ba3bf88 --- /dev/null +++ b/docs/EInvoicing/V1/DataInputFieldsApi.md @@ -0,0 +1,81 @@ +# Avalara\SDK\DataInputFieldsApi + +All URIs are relative to https://api.sbx.avalara.com/einvoicing. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getDataInputFields()**](DataInputFieldsApi.md#getDataInputFields) | **GET** /data-input-fields | Returns the mandatory and conditional invoice or creditnote input fields for different country mandates + + +## `getDataInputFields()` + +```php +getDataInputFields($avalara_version, $x_avalara_client, $filter, $top, $skip, $count, $count_only): \Avalara\SDK\Model\EInvoicing\V1\DataInputFieldsResponse +``` + +Returns the mandatory and conditional invoice or creditnote input fields for different country mandates + +This endpoint provides a list of required, conditional, and optional fields for each country mandate. You can use the mandates endpoint to retrieve all available country mandates. You can use the $filter query parameter to retrieve fields for a particular mandate + +### Example + +```php +setBearerToken('YOUR_JWT_ACCESS_TOKEN') + ->setAppName('YOUR_APP_NAME') + ->setEnvironment('sandbox') + ->setMachineName('YOUR_MACHINE_NAME') + ->setAppVersion('YOUR_APP_VERSION'); + +$client = new \Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\SDK\Api\DataInputFieldsApi($client); + +$avalara_version = 1.0; // string | The HTTP Header meant to specify the version of the API intended to be used +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" +$filter = requiredFor/countryMandate eq AU-B2G-PEPPOL; // string | Filter by field name and value. This filter only supports eq and contains. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. +$top = 10; // float | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. +$skip = 10; // float | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. +$count = true; // bool | When set to true, the count of the collection is also returned in the response body +$count_only = true; // bool | When set to true, only the count of the collection is returned + +try { + $result = $apiInstance->getDataInputFields($avalara_version, $x_avalara_client, $filter, $top, $skip, $count, $count_only); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DataInputFieldsApi->getDataInputFields: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + **filter** | **string**| Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. | [optional] + **top** | **float**| If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. | [optional] + **skip** | **float**| If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] + **count** | **bool**| When set to true, the count of the collection is also returned in the response body | [optional] + **count_only** | **bool**| When set to true, only the count of the collection is returned | [optional] + +### Return type + +[**\Avalara\SDK\Model\EInvoicing\V1\DataInputFieldsResponse**](../Model/DataInputFieldsResponse.md) + +### Authorization + +[Bearer](../../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../../README.md#endpoints) +[[Back to Model list]](../../../README.md#models) +[[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/V1/DocumentsApi.md b/docs/EInvoicing/V1/DocumentsApi.md new file mode 100644 index 0000000..16ada8e --- /dev/null +++ b/docs/EInvoicing/V1/DocumentsApi.md @@ -0,0 +1,289 @@ +# Avalara\SDK\DocumentsApi + +All URIs are relative to https://api.sbx.avalara.com/einvoicing. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**downloadDocument()**](DocumentsApi.md#downloadDocument) | **GET** /documents/{documentId}/$download | Returns a copy of the document +[**getDocumentList()**](DocumentsApi.md#getDocumentList) | **GET** /documents | Returns a summary of documents for a date range +[**getDocumentStatus()**](DocumentsApi.md#getDocumentStatus) | **GET** /document/{documentId}/status | Checks the status of a document +[**submitDocument()**](DocumentsApi.md#submitDocument) | **POST** /documents | Submits a document to Avalara E-Invoicing API + + +## `downloadDocument()` + +```php +downloadDocument($avalara_version, $accept, $document_id, $x_avalara_client): \SplFileObject +``` + +Returns a copy of the document + +When the document is available, use this endpoint to download it as text, XML, or PDF. The output format needs to be specified in the Accept header and it will vary depending on the mandate. If the file has not yet been created, then status code 404 (not found) is returned. + +### Example + +```php +setBearerToken('YOUR_JWT_ACCESS_TOKEN') + ->setAppName('YOUR_APP_NAME') + ->setEnvironment('sandbox') + ->setMachineName('YOUR_MACHINE_NAME') + ->setAppVersion('YOUR_APP_VERSION'); + +$client = new \Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\SDK\Api\DocumentsApi($client); + +$avalara_version = 1.0; // string | The HTTP Header meant to specify the version of the API intended to be used +$accept = application/pdf; // string | This header indicates the MIME type of the document +$document_id = 'document_id_example'; // string | The unique ID for this document that was returned in the POST /einvoicing/document response body +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" + +try { + $result = $apiInstance->downloadDocument($avalara_version, $accept, $document_id, $x_avalara_client); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentsApi->downloadDocument: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | + **accept** | **string**| This header indicates the MIME type of the document | + **document_id** | **string**| The unique ID for this document that was returned in the POST /einvoicing/document response body | + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + +### Return type + +**\SplFileObject** + +### Authorization + +[Bearer](../../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/pdf`, `application/xml`, `application/json` + +[[Back to top]](#) [[Back to API list]](../../../README.md#endpoints) +[[Back to Model list]](../../../README.md#models) +[[Back to README]](../../../README.md) + +## `getDocumentList()` + +```php +getDocumentList($avalara_version, $x_avalara_client, $start_date, $end_date, $flow, $count, $count_only, $filter, $top, $skip): \Avalara\SDK\Model\EInvoicing\V1\DocumentListResponse +``` + +Returns a summary of documents for a date range + +Get a list of documents on the Avalara E-Invoicing platform that have a processing date within the specified date range. + +### Example + +```php +setBearerToken('YOUR_JWT_ACCESS_TOKEN') + ->setAppName('YOUR_APP_NAME') + ->setEnvironment('sandbox') + ->setMachineName('YOUR_MACHINE_NAME') + ->setAppVersion('YOUR_APP_VERSION'); + +$client = new \Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\SDK\Api\DocumentsApi($client); + +$avalara_version = 1.0; // string | The HTTP Header meant to specify the version of the API intended to be used +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" +$start_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Start date of documents to return. This defaults to the previous month. +$end_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | End date of documents to return. This defaults to the current date. +$flow = out; // string | Optionally filter by document direction, where issued = `out` and received = `in` +$count = true; // string | When set to true, the count of the collection is also returned in the response body +$count_only = false; // string | When set to true, only the count of the collection is returned +$filter = id eq 2023-02-000016; // string | Filter by field name and value. This filter only supports eq . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. +$top = 10; // float | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. +$skip = 10; // string | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. + +try { + $result = $apiInstance->getDocumentList($avalara_version, $x_avalara_client, $start_date, $end_date, $flow, $count, $count_only, $filter, $top, $skip); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentsApi->getDocumentList: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + **start_date** | **\DateTime**| Start date of documents to return. This defaults to the previous month. | [optional] + **end_date** | **\DateTime**| End date of documents to return. This defaults to the current date. | [optional] + **flow** | **string**| Optionally filter by document direction, where issued = `out` and received = `in` | [optional] + **count** | **string**| When set to true, the count of the collection is also returned in the response body | [optional] + **count_only** | **string**| When set to true, only the count of the collection is returned | [optional] + **filter** | **string**| Filter by field name and value. This filter only supports <code>eq</code> . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. | [optional] + **top** | **float**| If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. | [optional] + **skip** | **string**| If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] + +### Return type + +[**\Avalara\SDK\Model\EInvoicing\V1\DocumentListResponse**](../Model/DocumentListResponse.md) + +### Authorization + +[Bearer](../../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../../README.md#endpoints) +[[Back to Model list]](../../../README.md#models) +[[Back to README]](../../../README.md) + +## `getDocumentStatus()` + +```php +getDocumentStatus($avalara_version, $document_id, $x_avalara_client): \Avalara\SDK\Model\EInvoicing\V1\DocumentStatusResponse +``` + +Checks the status of a document + +Using the unique ID from POST /einvoicing/documents response body, request the current status of a document. + +### Example + +```php +setBearerToken('YOUR_JWT_ACCESS_TOKEN') + ->setAppName('YOUR_APP_NAME') + ->setEnvironment('sandbox') + ->setMachineName('YOUR_MACHINE_NAME') + ->setAppVersion('YOUR_APP_VERSION'); + +$client = new \Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\SDK\Api\DocumentsApi($client); + +$avalara_version = 1.0; // string | The HTTP Header meant to specify the version of the API intended to be used +$document_id = 'document_id_example'; // string | The unique ID for this document that was returned in the POST /einvoicing/documents response body +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" + +try { + $result = $apiInstance->getDocumentStatus($avalara_version, $document_id, $x_avalara_client); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentsApi->getDocumentStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | + **document_id** | **string**| The unique ID for this document that was returned in the POST /einvoicing/documents response body | + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + +### Return type + +[**\Avalara\SDK\Model\EInvoicing\V1\DocumentStatusResponse**](../Model/DocumentStatusResponse.md) + +### Authorization + +[Bearer](../../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../../README.md#endpoints) +[[Back to Model list]](../../../README.md#models) +[[Back to README]](../../../README.md) + +## `submitDocument()` + +```php +submitDocument($avalara_version, $metadata, $data, $x_avalara_client): \Avalara\SDK\Model\EInvoicing\V1\DocumentSubmitResponse +``` + +Submits a document to Avalara E-Invoicing API + +For both e-invoices and credit notes, when a document is sent to this endpoint, it generates an invoice or credit note in the required format as mandated by the specified country. Additionally, it initiates the workflow to transmit the generated document to the relevant tax authority, if necessary.

The response from the endpoint contains a unique document ID, which can be used to request the status of the document and verify if it was successfully accepted at the destination.

Furthermore, the unique ID enables the download of a copy of the e-invoice or credit note for reference purposes. + +### Example + +```php +setBearerToken('YOUR_JWT_ACCESS_TOKEN') + ->setAppName('YOUR_APP_NAME') + ->setEnvironment('sandbox') + ->setMachineName('YOUR_MACHINE_NAME') + ->setAppVersion('YOUR_APP_VERSION'); + +$client = new \Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\SDK\Api\DocumentsApi($client); + +$avalara_version = 1.0; // string | The HTTP Header meant to specify the version of the API intended to be used +$metadata = new \Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentMetadata(); // \Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentMetadata +$data = new \Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentData(); // \Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentData +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" + +try { + $result = $apiInstance->submitDocument($avalara_version, $metadata, $data, $x_avalara_client); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentsApi->submitDocument: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | + **metadata** | [**\Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentMetadata**](../Model/SubmitDocumentMetadata.md)| | + **data** | [**\Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentData**](../Model/SubmitDocumentData.md)| | + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + +### Return type + +[**\Avalara\SDK\Model\EInvoicing\V1\DocumentSubmitResponse**](../Model/DocumentSubmitResponse.md) + +### Authorization + +[Bearer](../../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json`, `text/xml` + +[[Back to top]](#) [[Back to API list]](../../../README.md#endpoints) +[[Back to Model list]](../../../README.md#models) +[[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/V1/MandatesApi.md b/docs/EInvoicing/V1/MandatesApi.md new file mode 100644 index 0000000..7c06e73 --- /dev/null +++ b/docs/EInvoicing/V1/MandatesApi.md @@ -0,0 +1,81 @@ +# Avalara\SDK\MandatesApi + +All URIs are relative to https://api.sbx.avalara.com/einvoicing. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getMandates()**](MandatesApi.md#getMandates) | **GET** /mandates | List country mandates that are supported by the Avalara E-Invoicing platform + + +## `getMandates()` + +```php +getMandates($avalara_version, $x_avalara_client, $filter, $top, $skip, $count, $count_only): \Avalara\SDK\Model\EInvoicing\V1\MandatesResponse +``` + +List country mandates that are supported by the Avalara E-Invoicing platform + +This endpoint offers a list of country mandates supported by the Avalara E-Invoicing API. + +### Example + +```php +setBearerToken('YOUR_JWT_ACCESS_TOKEN') + ->setAppName('YOUR_APP_NAME') + ->setEnvironment('sandbox') + ->setMachineName('YOUR_MACHINE_NAME') + ->setAppVersion('YOUR_APP_VERSION'); + +$client = new \Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\SDK\Api\MandatesApi($client); + +$avalara_version = 1.0; // string | The HTTP Header meant to specify the version of the API intended to be used +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" +$filter = countryMandate eq DE-B2G-PEPPOL; // string | Filter by field name and value. This filter only supports eq and contains. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. +$top = 10; // float | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. +$skip = 10; // float | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. +$count = true; // bool | When set to true, the count of the collection is also returned in the response body. +$count_only = true; // bool | When set to true, only the count of the collection is returned + +try { + $result = $apiInstance->getMandates($avalara_version, $x_avalara_client, $filter, $top, $skip, $count, $count_only); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling MandatesApi->getMandates: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + **filter** | **string**| Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. | [optional] + **top** | **float**| If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. | [optional] + **skip** | **float**| If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] + **count** | **bool**| When set to true, the count of the collection is also returned in the response body. | [optional] + **count_only** | **bool**| When set to true, only the count of the collection is returned | [optional] + +### Return type + +[**\Avalara\SDK\Model\EInvoicing\V1\MandatesResponse**](../Model/MandatesResponse.md) + +### Authorization + +[Bearer](../../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../../README.md#endpoints) +[[Back to Model list]](../../../README.md#models) +[[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/WorkflowIds.md b/docs/EInvoicing/WorkflowIds.md new file mode 100644 index 0000000..9a2df43 --- /dev/null +++ b/docs/EInvoicing/WorkflowIds.md @@ -0,0 +1,10 @@ +# # WorkflowIds + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of this workflow | [optional] +**description** | **string** | Workflow description | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/git_push.sh b/git_push.sh new file mode 100644 index 0000000..55b3e8f --- /dev/null +++ b/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/index.php b/index.php new file mode 100644 index 0000000..cc9cbb2 --- /dev/null +++ b/index.php @@ -0,0 +1,79 @@ +setUsername('') + ->setPassword(''); + +$config->appName="testApplication"; +$config->appVersion='2.1.2'; +$config->machineName='localhost'; +$config->environment='sandbox'; + +$client= new Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\SDK\API\AgeVerification\AgeVerificationApi($client); + +$age_verify_add= new \Avalara\SDK\Model\AgeVerification\AgeVerifyRequestAddress(); +$age_verify_add->setLine1('255 S King St'); +$age_verify_add->setPostalCode('98109'); + +$age_verify_request = new \Avalara\SDK\Model\AgeVerification\AgeVerifyRequest(); + +$age_verify_request->setFirstName('Test'); +$age_verify_request->setLastName('Person'); +$age_verify_request->setDob('1970-01-01'); +$age_verify_request->setAddress($age_verify_add); + +$result=$apiInstance->verifyAge($age_verify_request); +print_r($result); +/* +$apiInstance2 = new Avalara\SDK\API\Shipping\ShippingVerificationApi($client); +try { + $apiInstance2->deregisterShipment("DEFAULT", "575f7201-ae11-483a-bc4e-0b3f948e4397", null); + print_r('success'); + +} +catch (Exception $e) { + echo 'Exception : ', $e->getMessage(), PHP_EOL; +} + + +echo ("\n \n"); +/*$apiInstance = new OpenAPI\Client\Api\ShippingVerificationApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$age_verify_request = new \OpenAPI\Client\Model\AgeVerifyRequest(); // \OpenAPI\Client\Model\AgeVerifyRequest | Information about the individual whose age is being verified. + +try { + $result = $apiInstance->deregisterShipment("DEFAULT", "575f7201-ae11-483a-bc4e-0b3f948e4397", null); + print_r('success'); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AgeVerificationApi->verifyAge: ', $e->getMessage(), PHP_EOL; +} +*/ + + +?> + + + AvaTax PHP Example + + +

AvaTax PHP Example

+ + + + + \ No newline at end of file diff --git a/lib/API/EInvoicing/V1/DataInputFieldsApi.php b/lib/API/EInvoicing/V1/DataInputFieldsApi.php new file mode 100644 index 0000000..da2e654 --- /dev/null +++ b/lib/API/EInvoicing/V1/DataInputFieldsApi.php @@ -0,0 +1,604 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + + + +namespace Avalara\SDK\API\EInvoicing\V1; + +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\ConnectException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use Avalara\SDK\ApiClient; +use Avalara\SDK\ApiException; +use Avalara\SDK\Configuration; +use Avalara\SDK\HeaderSelector; +use Avalara\SDK\ObjectSerializer; +use Avalara\SDK\Utils\LogObject; + +class DataInputFieldsApi +{ + /** + * @var ApiClient + */ + protected $client; + + /** + * @var Configuration + */ + protected $config; + + /** + * @var HeaderSelector + */ + protected $headerSelector; + + /** + * @param ApiClient $client + */ + public function __construct(ApiClient $client ) + { + $this->setConfiguration($client); + } + + /** + * Set APIClient Configuration + * + * @param APIClient $client + */ + private function setConfiguration($client): void + { + $this->verifyAPIClient($client); + $client->setSdkVersion(""); + $this->headerSelector = new HeaderSelector(); + $this->client = $client; + } + + /** + * Verify APIClient object + * + * @param int $client + */ + private function verifyAPIClient($client): void + { + if (is_null($client)){ + throw new ApiException("APIClient not defined"); + } + } + + + /** + * Set the HeaderSelector + * + * @param HeaderSelector $selector (required) + */ + public function setHeaderSelector($selector): void + { + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->client->config; + } + + /** + * Operation getDataInputFields + * + * Returns the mandatory and conditional invoice or creditnote input fields for different country mandates + * + * @param GetDataInputFieldsRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Avalara\SDK\Model\EInvoicing\V1\DataInputFieldsResponse|\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError|\Avalara\SDK\Model\EInvoicing\V1\InternalServerError + */ + public function getDataInputFields($request_parameters) + { + list($response) = $this->getDataInputFieldsWithHttpInfo($request_parameters); + return $response; + } + + /** + * Operation getDataInputFieldsWithHttpInfo + * + * Returns the mandatory and conditional invoice or creditnote input fields for different country mandates + * + * @param GetDataInputFieldsRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Avalara\SDK\Model\EInvoicing\V1\DataInputFieldsResponse|\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError|\Avalara\SDK\Model\EInvoicing\V1\InternalServerError, HTTP status code, HTTP response headers (array of strings) + */ + public function getDataInputFieldsWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + //OAuth2 Scopes + $requiredScopes = ""; + $request = $this->getDataInputFieldsRequest($request_parameters); + $logObject->populateRequestInfo($request); + + try { + try { + $response = $this->client->send_sync($request, []); + } catch (RequestException $e) { + $statusCode = $e->getCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($e->getRequest() ? $e->getRequest()->getHeaders() : null, $requiredScopes); + list($response) = $this->getDataInputFieldsWithHttpInfo($request_parameters, true); + return $response; + } + $logObject->populateErrorInfo($e->getResponse()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + $logObject->populateErrorMessage($e->getCode(), $e->getMessage()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Avalara\SDK\Model\EInvoicing\V1\DataInputFieldsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\DataInputFieldsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Avalara\SDK\Model\EInvoicing\V1\InternalServerError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\InternalServerError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\DataInputFieldsResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\DataInputFieldsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\InternalServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDataInputFieldsAsync + * + * Returns the mandatory and conditional invoice or creditnote input fields for different country mandates + * + * @param GetDataInputFieldsRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDataInputFieldsAsync($request_parameters) + { + return $this->getDataInputFieldsAsyncWithHttpInfo($request_parameters) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDataInputFieldsAsyncWithHttpInfo + * + * Returns the mandatory and conditional invoice or creditnote input fields for different country mandates + * + * @param GetDataInputFieldsRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDataInputFieldsAsyncWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\DataInputFieldsResponse'; + $request = $this->getDataInputFieldsRequest($request_parameters); + $logObject->populateRequestInfo($request); + return $this->client + ->send_async($request, []) + ->then( + function ($response) use ($returnType, $logObject) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) use ($request_parameters, $isRetry, $request, $logObject) { + //OAuth2 Scopes + $requiredScopes = ""; + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($request->getHeaders(), $requiredScopes); + return $this->getDataInputFieldsAsyncWithHttpInfo($request_parameters, true) + ->then( + function ($response) { + return $response[0]; + } + ); + } + $logObject->populateErrorInfo($response); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDataInputFields' + * + * @param GetDataInputFieldsRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDataInputFieldsRequest($request_parameters) + { + //OAuth2 Scopes + $requiredScopes = ""; + + $avalara_version = $request_parameters->getAvalaraVersion(); + $x_avalara_client = $request_parameters->getXAvalaraClient(); + $filter = $request_parameters->getFilter(); + $top = $request_parameters->getTop(); + $skip = $request_parameters->getSkip(); + $count = $request_parameters->getCount(); + $count_only = $request_parameters->getCountOnly(); + + // verify the required parameter 'avalara_version' is set + if ($avalara_version === null || (is_array($avalara_version) && count($avalara_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $avalara_version when calling getDataInputFields' + ); + } + + $resourcePath = '/einvoicing/data-input-fields'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($filter !== null) { + if('form' === 'form' && is_array($filter)) { + foreach($filter as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$filter'] = $filter; + } + } + // query params + if ($top !== null) { + if('form' === 'form' && is_array($top)) { + foreach($top as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$top'] = $top; + } + } + // query params + if ($skip !== null) { + if('form' === 'form' && is_array($skip)) { + foreach($skip as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$skip'] = $skip; + } + } + // query params + if ($count !== null) { + if('form' === 'form' && is_array($count)) { + foreach($count as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$count'] = $count; + } + } + // query params + if ($count_only !== null) { + if('form' === 'form' && is_array($count_only)) { + foreach($count_only as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$countOnly'] = $count_only; + } + } + + // header params + $headerParams['avalara-version'] = '1.0'; + if ($avalara_version !== null) { + $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); + } + // header params + $headerParams['avalara-version'] = '1.0'; + if ($x_avalara_client !== null) { + $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); + } + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; ; {$this->client->config->getMachineName()}"; + + $headers['X-Avalara-Client']=$clientId; + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + $headers = $this->client->applyAuthToRequest($headers, $requiredScopes); + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->client->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + +} + /** + * Represents the Request object for the GetDataInputFields API + * + * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + * @param string $filter Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. (optional) + * @param float $top If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. (optional) + * @param float $skip If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. (optional) + * @param bool $count When set to true, the count of the collection is also returned in the response body (optional) + * @param bool $count_only When set to true, only the count of the collection is returned (optional) + */ +class GetDataInputFieldsRequest { + private $avalara_version; + private $x_avalara_client; + private $filter; + private $top; + private $skip; + private $count; + private $count_only; + + public function __construct() { + } + public function getAvalaraVersion() { + return $this->avalara_version; + } + + public function setAvalaraVersion($avalara_version) { + $this->avalara_version = $avalara_version; + } + public function getXAvalaraClient() { + return $this->x_avalara_client; + } + + public function setXAvalaraClient($x_avalara_client) { + $this->x_avalara_client = $x_avalara_client; + } + public function getFilter() { + return $this->filter; + } + + public function setFilter($filter) { + $this->filter = $filter; + } + public function getTop() { + return $this->top; + } + + public function setTop($top) { + $this->top = $top; + } + public function getSkip() { + return $this->skip; + } + + public function setSkip($skip) { + $this->skip = $skip; + } + public function getCount() { + return $this->count; + } + + public function setCount($count) { + $this->count = $count; + } + public function getCountOnly() { + return $this->count_only; + } + + public function setCountOnly($count_only) { + $this->count_only = $count_only; + } +} + diff --git a/lib/API/EInvoicing/V1/DocumentsApi.php b/lib/API/EInvoicing/V1/DocumentsApi.php new file mode 100644 index 0000000..245478c --- /dev/null +++ b/lib/API/EInvoicing/V1/DocumentsApi.php @@ -0,0 +1,1937 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + + + +namespace Avalara\SDK\API\EInvoicing\V1; + +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\ConnectException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use Avalara\SDK\ApiClient; +use Avalara\SDK\ApiException; +use Avalara\SDK\Configuration; +use Avalara\SDK\HeaderSelector; +use Avalara\SDK\ObjectSerializer; +use Avalara\SDK\Utils\LogObject; + +class DocumentsApi +{ + /** + * @var ApiClient + */ + protected $client; + + /** + * @var Configuration + */ + protected $config; + + /** + * @var HeaderSelector + */ + protected $headerSelector; + + /** + * @param ApiClient $client + */ + public function __construct(ApiClient $client ) + { + $this->setConfiguration($client); + } + + /** + * Set APIClient Configuration + * + * @param APIClient $client + */ + private function setConfiguration($client): void + { + $this->verifyAPIClient($client); + $client->setSdkVersion(""); + $this->headerSelector = new HeaderSelector(); + $this->client = $client; + } + + /** + * Verify APIClient object + * + * @param int $client + */ + private function verifyAPIClient($client): void + { + if (is_null($client)){ + throw new ApiException("APIClient not defined"); + } + } + + + /** + * Set the HeaderSelector + * + * @param HeaderSelector $selector (required) + */ + public function setHeaderSelector($selector): void + { + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->client->config; + } + + /** + * Operation downloadDocument + * + * Returns a copy of the document + * + * @param DownloadDocumentRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SplFileObject|\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError|\Avalara\SDK\Model\EInvoicing\V1\NotFoundError|\Avalara\SDK\Model\EInvoicing\V1\BadDownloadRequest + */ + public function downloadDocument($request_parameters) + { + list($response) = $this->downloadDocumentWithHttpInfo($request_parameters); + return $response; + } + + /** + * Operation downloadDocumentWithHttpInfo + * + * Returns a copy of the document + * + * @param DownloadDocumentRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SplFileObject|\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError|\Avalara\SDK\Model\EInvoicing\V1\NotFoundError|\Avalara\SDK\Model\EInvoicing\V1\BadDownloadRequest, HTTP status code, HTTP response headers (array of strings) + */ + public function downloadDocumentWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + //OAuth2 Scopes + $requiredScopes = ""; + $request = $this->downloadDocumentRequest($request_parameters); + $logObject->populateRequestInfo($request); + + try { + try { + $response = $this->client->send_sync($request, []); + } catch (RequestException $e) { + $statusCode = $e->getCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($e->getRequest() ? $e->getRequest()->getHeaders() : null, $requiredScopes); + list($response) = $this->downloadDocumentWithHttpInfo($request_parameters, true); + return $response; + } + $logObject->populateErrorInfo($e->getResponse()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + $logObject->populateErrorMessage($e->getCode(), $e->getMessage()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\SplFileObject' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\SplFileObject', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Avalara\SDK\Model\EInvoicing\V1\NotFoundError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\NotFoundError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 406: + if ('\Avalara\SDK\Model\EInvoicing\V1\BadDownloadRequest' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\BadDownloadRequest', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\SplFileObject'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SplFileObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\NotFoundError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 406: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\BadDownloadRequest', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation downloadDocumentAsync + * + * Returns a copy of the document + * + * @param DownloadDocumentRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function downloadDocumentAsync($request_parameters) + { + return $this->downloadDocumentAsyncWithHttpInfo($request_parameters) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation downloadDocumentAsyncWithHttpInfo + * + * Returns a copy of the document + * + * @param DownloadDocumentRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function downloadDocumentAsyncWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + $returnType = '\SplFileObject'; + $request = $this->downloadDocumentRequest($request_parameters); + $logObject->populateRequestInfo($request); + return $this->client + ->send_async($request, []) + ->then( + function ($response) use ($returnType, $logObject) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) use ($request_parameters, $isRetry, $request, $logObject) { + //OAuth2 Scopes + $requiredScopes = ""; + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($request->getHeaders(), $requiredScopes); + return $this->downloadDocumentAsyncWithHttpInfo($request_parameters, true) + ->then( + function ($response) { + return $response[0]; + } + ); + } + $logObject->populateErrorInfo($response); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'downloadDocument' + * + * @param DownloadDocumentRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function downloadDocumentRequest($request_parameters) + { + //OAuth2 Scopes + $requiredScopes = ""; + + $avalara_version = $request_parameters->getAvalaraVersion(); + $accept = $request_parameters->getAccept(); + $document_id = $request_parameters->getDocumentId(); + $x_avalara_client = $request_parameters->getXAvalaraClient(); + + // verify the required parameter 'avalara_version' is set + if ($avalara_version === null || (is_array($avalara_version) && count($avalara_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $avalara_version when calling downloadDocument' + ); + } + // verify the required parameter 'accept' is set + if ($accept === null || (is_array($accept) && count($accept) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $accept when calling downloadDocument' + ); + } + // verify the required parameter 'document_id' is set + if ($document_id === null || (is_array($document_id) && count($document_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $document_id when calling downloadDocument' + ); + } + + $resourcePath = '/einvoicing/documents/{documentId}/$download'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + $headerParams['avalara-version'] = '1.0'; + if ($avalara_version !== null) { + $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); + } + // header params + $headerParams['avalara-version'] = '1.0'; + if ($accept !== null) { + $headerParams['Accept'] = ObjectSerializer::toHeaderValue($accept); + } + // header params + $headerParams['avalara-version'] = '1.0'; + if ($x_avalara_client !== null) { + $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); + } + + // path params + if ($document_id !== null) { + $resourcePath = str_replace( + '{' . 'documentId' . '}', + ObjectSerializer::toPathValue($document_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/pdf', 'application/xml', 'application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/pdf', 'application/xml', 'application/json'], + [] + ); + } + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; ; {$this->client->config->getMachineName()}"; + + $headers['X-Avalara-Client']=$clientId; + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + $headers = $this->client->applyAuthToRequest($headers, $requiredScopes); + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->client->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDocumentList + * + * Returns a summary of documents for a date range + * + * @param GetDocumentListRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Avalara\SDK\Model\EInvoicing\V1\DocumentListResponse|\Avalara\SDK\Model\EInvoicing\V1\BadRequest|\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError + */ + public function getDocumentList($request_parameters) + { + list($response) = $this->getDocumentListWithHttpInfo($request_parameters); + return $response; + } + + /** + * Operation getDocumentListWithHttpInfo + * + * Returns a summary of documents for a date range + * + * @param GetDocumentListRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Avalara\SDK\Model\EInvoicing\V1\DocumentListResponse|\Avalara\SDK\Model\EInvoicing\V1\BadRequest|\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError, HTTP status code, HTTP response headers (array of strings) + */ + public function getDocumentListWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + //OAuth2 Scopes + $requiredScopes = ""; + $request = $this->getDocumentListRequest($request_parameters); + $logObject->populateRequestInfo($request); + + try { + try { + $response = $this->client->send_sync($request, []); + } catch (RequestException $e) { + $statusCode = $e->getCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($e->getRequest() ? $e->getRequest()->getHeaders() : null, $requiredScopes); + list($response) = $this->getDocumentListWithHttpInfo($request_parameters, true); + return $response; + } + $logObject->populateErrorInfo($e->getResponse()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + $logObject->populateErrorMessage($e->getCode(), $e->getMessage()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Avalara\SDK\Model\EInvoicing\V1\DocumentListResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\DocumentListResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Avalara\SDK\Model\EInvoicing\V1\BadRequest' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\BadRequest', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\DocumentListResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\DocumentListResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\BadRequest', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDocumentListAsync + * + * Returns a summary of documents for a date range + * + * @param GetDocumentListRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDocumentListAsync($request_parameters) + { + return $this->getDocumentListAsyncWithHttpInfo($request_parameters) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDocumentListAsyncWithHttpInfo + * + * Returns a summary of documents for a date range + * + * @param GetDocumentListRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDocumentListAsyncWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\DocumentListResponse'; + $request = $this->getDocumentListRequest($request_parameters); + $logObject->populateRequestInfo($request); + return $this->client + ->send_async($request, []) + ->then( + function ($response) use ($returnType, $logObject) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) use ($request_parameters, $isRetry, $request, $logObject) { + //OAuth2 Scopes + $requiredScopes = ""; + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($request->getHeaders(), $requiredScopes); + return $this->getDocumentListAsyncWithHttpInfo($request_parameters, true) + ->then( + function ($response) { + return $response[0]; + } + ); + } + $logObject->populateErrorInfo($response); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDocumentList' + * + * @param GetDocumentListRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDocumentListRequest($request_parameters) + { + //OAuth2 Scopes + $requiredScopes = ""; + + $avalara_version = $request_parameters->getAvalaraVersion(); + $x_avalara_client = $request_parameters->getXAvalaraClient(); + $start_date = $request_parameters->getStartDate(); + $end_date = $request_parameters->getEndDate(); + $flow = $request_parameters->getFlow(); + $count = $request_parameters->getCount(); + $count_only = $request_parameters->getCountOnly(); + $filter = $request_parameters->getFilter(); + $top = $request_parameters->getTop(); + $skip = $request_parameters->getSkip(); + + // verify the required parameter 'avalara_version' is set + if ($avalara_version === null || (is_array($avalara_version) && count($avalara_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $avalara_version when calling getDocumentList' + ); + } + + $resourcePath = '/einvoicing/documents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($start_date !== null) { + if('form' === 'form' && is_array($start_date)) { + foreach($start_date as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['startDate'] = $start_date; + } + } + // query params + if ($end_date !== null) { + if('form' === 'form' && is_array($end_date)) { + foreach($end_date as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['endDate'] = $end_date; + } + } + // query params + if ($flow !== null) { + if('form' === 'form' && is_array($flow)) { + foreach($flow as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['flow'] = $flow; + } + } + // query params + if ($count !== null) { + if('form' === 'form' && is_array($count)) { + foreach($count as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$count'] = $count; + } + } + // query params + if ($count_only !== null) { + if('form' === 'form' && is_array($count_only)) { + foreach($count_only as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$countOnly'] = $count_only; + } + } + // query params + if ($filter !== null) { + if('form' === 'form' && is_array($filter)) { + foreach($filter as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$filter'] = $filter; + } + } + // query params + if ($top !== null) { + if('form' === 'form' && is_array($top)) { + foreach($top as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$top'] = $top; + } + } + // query params + if ($skip !== null) { + if('form' === 'form' && is_array($skip)) { + foreach($skip as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$skip'] = $skip; + } + } + + // header params + $headerParams['avalara-version'] = '1.0'; + if ($avalara_version !== null) { + $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); + } + // header params + $headerParams['avalara-version'] = '1.0'; + if ($x_avalara_client !== null) { + $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); + } + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; ; {$this->client->config->getMachineName()}"; + + $headers['X-Avalara-Client']=$clientId; + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + $headers = $this->client->applyAuthToRequest($headers, $requiredScopes); + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->client->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDocumentStatus + * + * Checks the status of a document + * + * @param GetDocumentStatusRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Avalara\SDK\Model\EInvoicing\V1\DocumentStatusResponse|\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError|\Avalara\SDK\Model\EInvoicing\V1\NotFoundError + */ + public function getDocumentStatus($request_parameters) + { + list($response) = $this->getDocumentStatusWithHttpInfo($request_parameters); + return $response; + } + + /** + * Operation getDocumentStatusWithHttpInfo + * + * Checks the status of a document + * + * @param GetDocumentStatusRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Avalara\SDK\Model\EInvoicing\V1\DocumentStatusResponse|\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError|\Avalara\SDK\Model\EInvoicing\V1\NotFoundError, HTTP status code, HTTP response headers (array of strings) + */ + public function getDocumentStatusWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + //OAuth2 Scopes + $requiredScopes = ""; + $request = $this->getDocumentStatusRequest($request_parameters); + $logObject->populateRequestInfo($request); + + try { + try { + $response = $this->client->send_sync($request, []); + } catch (RequestException $e) { + $statusCode = $e->getCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($e->getRequest() ? $e->getRequest()->getHeaders() : null, $requiredScopes); + list($response) = $this->getDocumentStatusWithHttpInfo($request_parameters, true); + return $response; + } + $logObject->populateErrorInfo($e->getResponse()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + $logObject->populateErrorMessage($e->getCode(), $e->getMessage()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Avalara\SDK\Model\EInvoicing\V1\DocumentStatusResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\DocumentStatusResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Avalara\SDK\Model\EInvoicing\V1\NotFoundError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\NotFoundError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\DocumentStatusResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\DocumentStatusResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\NotFoundError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDocumentStatusAsync + * + * Checks the status of a document + * + * @param GetDocumentStatusRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDocumentStatusAsync($request_parameters) + { + return $this->getDocumentStatusAsyncWithHttpInfo($request_parameters) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDocumentStatusAsyncWithHttpInfo + * + * Checks the status of a document + * + * @param GetDocumentStatusRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDocumentStatusAsyncWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\DocumentStatusResponse'; + $request = $this->getDocumentStatusRequest($request_parameters); + $logObject->populateRequestInfo($request); + return $this->client + ->send_async($request, []) + ->then( + function ($response) use ($returnType, $logObject) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) use ($request_parameters, $isRetry, $request, $logObject) { + //OAuth2 Scopes + $requiredScopes = ""; + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($request->getHeaders(), $requiredScopes); + return $this->getDocumentStatusAsyncWithHttpInfo($request_parameters, true) + ->then( + function ($response) { + return $response[0]; + } + ); + } + $logObject->populateErrorInfo($response); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDocumentStatus' + * + * @param GetDocumentStatusRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDocumentStatusRequest($request_parameters) + { + //OAuth2 Scopes + $requiredScopes = ""; + + $avalara_version = $request_parameters->getAvalaraVersion(); + $document_id = $request_parameters->getDocumentId(); + $x_avalara_client = $request_parameters->getXAvalaraClient(); + + // verify the required parameter 'avalara_version' is set + if ($avalara_version === null || (is_array($avalara_version) && count($avalara_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $avalara_version when calling getDocumentStatus' + ); + } + // verify the required parameter 'document_id' is set + if ($document_id === null || (is_array($document_id) && count($document_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $document_id when calling getDocumentStatus' + ); + } + + $resourcePath = '/einvoicing/document/{documentId}/status'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + $headerParams['avalara-version'] = '1.0'; + if ($avalara_version !== null) { + $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); + } + // header params + $headerParams['avalara-version'] = '1.0'; + if ($x_avalara_client !== null) { + $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); + } + + // path params + if ($document_id !== null) { + $resourcePath = str_replace( + '{' . 'documentId' . '}', + ObjectSerializer::toPathValue($document_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; ; {$this->client->config->getMachineName()}"; + + $headers['X-Avalara-Client']=$clientId; + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + $headers = $this->client->applyAuthToRequest($headers, $requiredScopes); + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->client->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation submitDocument + * + * Submits a document to Avalara E-Invoicing API + * + * @param SubmitDocumentRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Avalara\SDK\Model\EInvoicing\V1\DocumentSubmitResponse|\Avalara\SDK\Model\EInvoicing\V1\DocumentSubmissionError|\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError + */ + public function submitDocument($request_parameters) + { + list($response) = $this->submitDocumentWithHttpInfo($request_parameters); + return $response; + } + + /** + * Operation submitDocumentWithHttpInfo + * + * Submits a document to Avalara E-Invoicing API + * + * @param SubmitDocumentRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Avalara\SDK\Model\EInvoicing\V1\DocumentSubmitResponse|\Avalara\SDK\Model\EInvoicing\V1\DocumentSubmissionError|\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError, HTTP status code, HTTP response headers (array of strings) + */ + public function submitDocumentWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + //OAuth2 Scopes + $requiredScopes = ""; + $request = $this->submitDocumentRequest($request_parameters); + $logObject->populateRequestInfo($request); + + try { + try { + $response = $this->client->send_sync($request, []); + } catch (RequestException $e) { + $statusCode = $e->getCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($e->getRequest() ? $e->getRequest()->getHeaders() : null, $requiredScopes); + list($response) = $this->submitDocumentWithHttpInfo($request_parameters, true); + return $response; + } + $logObject->populateErrorInfo($e->getResponse()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + $logObject->populateErrorMessage($e->getCode(), $e->getMessage()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 201: + if ('\Avalara\SDK\Model\EInvoicing\V1\DocumentSubmitResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\DocumentSubmitResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Avalara\SDK\Model\EInvoicing\V1\DocumentSubmissionError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\DocumentSubmissionError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\DocumentSubmitResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\DocumentSubmitResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\DocumentSubmissionError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation submitDocumentAsync + * + * Submits a document to Avalara E-Invoicing API + * + * @param SubmitDocumentRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function submitDocumentAsync($request_parameters) + { + return $this->submitDocumentAsyncWithHttpInfo($request_parameters) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation submitDocumentAsyncWithHttpInfo + * + * Submits a document to Avalara E-Invoicing API + * + * @param SubmitDocumentRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function submitDocumentAsyncWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\DocumentSubmitResponse'; + $request = $this->submitDocumentRequest($request_parameters); + $logObject->populateRequestInfo($request); + return $this->client + ->send_async($request, []) + ->then( + function ($response) use ($returnType, $logObject) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) use ($request_parameters, $isRetry, $request, $logObject) { + //OAuth2 Scopes + $requiredScopes = ""; + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($request->getHeaders(), $requiredScopes); + return $this->submitDocumentAsyncWithHttpInfo($request_parameters, true) + ->then( + function ($response) { + return $response[0]; + } + ); + } + $logObject->populateErrorInfo($response); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'submitDocument' + * + * @param SubmitDocumentRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function submitDocumentRequest($request_parameters) + { + //OAuth2 Scopes + $requiredScopes = ""; + + $avalara_version = $request_parameters->getAvalaraVersion(); + $metadata = $request_parameters->getMetadata(); + $data = $request_parameters->getData(); + $x_avalara_client = $request_parameters->getXAvalaraClient(); + + // verify the required parameter 'avalara_version' is set + if ($avalara_version === null || (is_array($avalara_version) && count($avalara_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $avalara_version when calling submitDocument' + ); + } + // verify the required parameter 'metadata' is set + if ($metadata === null || (is_array($metadata) && count($metadata) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $metadata when calling submitDocument' + ); + } + // verify the required parameter 'data' is set + if ($data === null || (is_array($data) && count($data) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $data when calling submitDocument' + ); + } + + $resourcePath = '/einvoicing/documents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + $headerParams['avalara-version'] = '1.0'; + if ($avalara_version !== null) { + $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); + } + // header params + $headerParams['avalara-version'] = '1.0'; + if ($x_avalara_client !== null) { + $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); + } + + + // form params + if ($metadata !== null) { + $formParams['metadata'] = ObjectSerializer::toFormValue($metadata); + } + // form params + if ($data !== null) { + $formParams['data'] = ObjectSerializer::toFormValue($data); + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json', 'text/xml'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json', 'text/xml'], + ['multipart/form-data'] + ); + } + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; ; {$this->client->config->getMachineName()}"; + + $headers['X-Avalara-Client']=$clientId; + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + $headers = $this->client->applyAuthToRequest($headers, $requiredScopes); + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'POST', + $this->client->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + +} + /** + * Represents the Request object for the DownloadDocument API + * + * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) + * @param string $accept This header indicates the MIME type of the document (required) + * @param string $document_id The unique ID for this document that was returned in the POST /einvoicing/document response body (required) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + */ +class DownloadDocumentRequest { + private $avalara_version; + private $accept; + private $document_id; + private $x_avalara_client; + + public function __construct() { + } + public function getAvalaraVersion() { + return $this->avalara_version; + } + + public function setAvalaraVersion($avalara_version) { + $this->avalara_version = $avalara_version; + } + public function getAccept() { + return $this->accept; + } + + public function setAccept($accept) { + $this->accept = $accept; + } + public function getDocumentId() { + return $this->document_id; + } + + public function setDocumentId($document_id) { + $this->document_id = $document_id; + } + public function getXAvalaraClient() { + return $this->x_avalara_client; + } + + public function setXAvalaraClient($x_avalara_client) { + $this->x_avalara_client = $x_avalara_client; + } +} + + /** + * Represents the Request object for the GetDocumentList API + * + * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + * @param \DateTime $start_date Start date of documents to return. This defaults to the previous month. (optional) + * @param \DateTime $end_date End date of documents to return. This defaults to the current date. (optional) + * @param string $flow Optionally filter by document direction, where issued = `out` and received = `in` (optional) + * @param string $count When set to true, the count of the collection is also returned in the response body (optional) + * @param string $count_only When set to true, only the count of the collection is returned (optional) + * @param string $filter Filter by field name and value. This filter only supports <code>eq</code> . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. (optional) + * @param float $top If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. (optional) + * @param string $skip If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. (optional) + */ +class GetDocumentListRequest { + private $avalara_version; + private $x_avalara_client; + private $start_date; + private $end_date; + private $flow; + private $count; + private $count_only; + private $filter; + private $top; + private $skip; + + public function __construct() { + } + public function getAvalaraVersion() { + return $this->avalara_version; + } + + public function setAvalaraVersion($avalara_version) { + $this->avalara_version = $avalara_version; + } + public function getXAvalaraClient() { + return $this->x_avalara_client; + } + + public function setXAvalaraClient($x_avalara_client) { + $this->x_avalara_client = $x_avalara_client; + } + public function getStartDate() { + return $this->start_date; + } + + public function setStartDate($start_date) { + $this->start_date = $start_date; + } + public function getEndDate() { + return $this->end_date; + } + + public function setEndDate($end_date) { + $this->end_date = $end_date; + } + public function getFlow() { + return $this->flow; + } + + public function setFlow($flow) { + $this->flow = $flow; + } + public function getCount() { + return $this->count; + } + + public function setCount($count) { + $this->count = $count; + } + public function getCountOnly() { + return $this->count_only; + } + + public function setCountOnly($count_only) { + $this->count_only = $count_only; + } + public function getFilter() { + return $this->filter; + } + + public function setFilter($filter) { + $this->filter = $filter; + } + public function getTop() { + return $this->top; + } + + public function setTop($top) { + $this->top = $top; + } + public function getSkip() { + return $this->skip; + } + + public function setSkip($skip) { + $this->skip = $skip; + } +} + + /** + * Represents the Request object for the GetDocumentStatus API + * + * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) + * @param string $document_id The unique ID for this document that was returned in the POST /einvoicing/documents response body (required) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + */ +class GetDocumentStatusRequest { + private $avalara_version; + private $document_id; + private $x_avalara_client; + + public function __construct() { + } + public function getAvalaraVersion() { + return $this->avalara_version; + } + + public function setAvalaraVersion($avalara_version) { + $this->avalara_version = $avalara_version; + } + public function getDocumentId() { + return $this->document_id; + } + + public function setDocumentId($document_id) { + $this->document_id = $document_id; + } + public function getXAvalaraClient() { + return $this->x_avalara_client; + } + + public function setXAvalaraClient($x_avalara_client) { + $this->x_avalara_client = $x_avalara_client; + } +} + + /** + * Represents the Request object for the SubmitDocument API + * + * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) + * @param \Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentMetadata $metadata metadata (required) + * @param \Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentData $data data (required) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + */ +class SubmitDocumentRequest { + private $avalara_version; + private $metadata; + private $data; + private $x_avalara_client; + + public function __construct() { + } + public function getAvalaraVersion() { + return $this->avalara_version; + } + + public function setAvalaraVersion($avalara_version) { + $this->avalara_version = $avalara_version; + } + public function getMetadata() { + return $this->metadata; + } + + public function setMetadata($metadata) { + $this->metadata = $metadata; + } + public function getData() { + return $this->data; + } + + public function setData($data) { + $this->data = $data; + } + public function getXAvalaraClient() { + return $this->x_avalara_client; + } + + public function setXAvalaraClient($x_avalara_client) { + $this->x_avalara_client = $x_avalara_client; + } +} + diff --git a/lib/API/EInvoicing/V1/MandatesApi.php b/lib/API/EInvoicing/V1/MandatesApi.php new file mode 100644 index 0000000..0ad17a7 --- /dev/null +++ b/lib/API/EInvoicing/V1/MandatesApi.php @@ -0,0 +1,625 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + + + +namespace Avalara\SDK\API\EInvoicing\V1; + +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\ConnectException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use Avalara\SDK\ApiClient; +use Avalara\SDK\ApiException; +use Avalara\SDK\Configuration; +use Avalara\SDK\HeaderSelector; +use Avalara\SDK\ObjectSerializer; +use Avalara\SDK\Utils\LogObject; + +class MandatesApi +{ + /** + * @var ApiClient + */ + protected $client; + + /** + * @var Configuration + */ + protected $config; + + /** + * @var HeaderSelector + */ + protected $headerSelector; + + /** + * @param ApiClient $client + */ + public function __construct(ApiClient $client ) + { + $this->setConfiguration($client); + } + + /** + * Set APIClient Configuration + * + * @param APIClient $client + */ + private function setConfiguration($client): void + { + $this->verifyAPIClient($client); + $client->setSdkVersion(""); + $this->headerSelector = new HeaderSelector(); + $this->client = $client; + } + + /** + * Verify APIClient object + * + * @param int $client + */ + private function verifyAPIClient($client): void + { + if (is_null($client)){ + throw new ApiException("APIClient not defined"); + } + } + + + /** + * Set the HeaderSelector + * + * @param HeaderSelector $selector (required) + */ + public function setHeaderSelector($selector): void + { + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->client->config; + } + + /** + * Operation getMandates + * + * List country mandates that are supported by the Avalara E-Invoicing platform + * + * @param GetMandatesRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Avalara\SDK\Model\EInvoicing\V1\MandatesResponse|\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError|\Avalara\SDK\Model\EInvoicing\V1\NotFoundError|\Avalara\SDK\Model\EInvoicing\V1\InternalServerError + */ + public function getMandates($request_parameters) + { + list($response) = $this->getMandatesWithHttpInfo($request_parameters); + return $response; + } + + /** + * Operation getMandatesWithHttpInfo + * + * List country mandates that are supported by the Avalara E-Invoicing platform + * + * @param GetMandatesRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Avalara\SDK\Model\EInvoicing\V1\MandatesResponse|\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError|\Avalara\SDK\Model\EInvoicing\V1\NotFoundError|\Avalara\SDK\Model\EInvoicing\V1\InternalServerError, HTTP status code, HTTP response headers (array of strings) + */ + public function getMandatesWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + //OAuth2 Scopes + $requiredScopes = ""; + $request = $this->getMandatesRequest($request_parameters); + $logObject->populateRequestInfo($request); + + try { + try { + $response = $this->client->send_sync($request, []); + } catch (RequestException $e) { + $statusCode = $e->getCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($e->getRequest() ? $e->getRequest()->getHeaders() : null, $requiredScopes); + list($response) = $this->getMandatesWithHttpInfo($request_parameters, true); + return $response; + } + $logObject->populateErrorInfo($e->getResponse()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + $logObject->populateErrorMessage($e->getCode(), $e->getMessage()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Avalara\SDK\Model\EInvoicing\V1\MandatesResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\MandatesResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Avalara\SDK\Model\EInvoicing\V1\NotFoundError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\NotFoundError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Avalara\SDK\Model\EInvoicing\V1\InternalServerError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\InternalServerError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\MandatesResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\MandatesResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\NotFoundError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\InternalServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getMandatesAsync + * + * List country mandates that are supported by the Avalara E-Invoicing platform + * + * @param GetMandatesRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMandatesAsync($request_parameters) + { + return $this->getMandatesAsyncWithHttpInfo($request_parameters) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMandatesAsyncWithHttpInfo + * + * List country mandates that are supported by the Avalara E-Invoicing platform + * + * @param GetMandatesRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMandatesAsyncWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\MandatesResponse'; + $request = $this->getMandatesRequest($request_parameters); + $logObject->populateRequestInfo($request); + return $this->client + ->send_async($request, []) + ->then( + function ($response) use ($returnType, $logObject) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) use ($request_parameters, $isRetry, $request, $logObject) { + //OAuth2 Scopes + $requiredScopes = ""; + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($request->getHeaders(), $requiredScopes); + return $this->getMandatesAsyncWithHttpInfo($request_parameters, true) + ->then( + function ($response) { + return $response[0]; + } + ); + } + $logObject->populateErrorInfo($response); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getMandates' + * + * @param GetMandatesRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getMandatesRequest($request_parameters) + { + //OAuth2 Scopes + $requiredScopes = ""; + + $avalara_version = $request_parameters->getAvalaraVersion(); + $x_avalara_client = $request_parameters->getXAvalaraClient(); + $filter = $request_parameters->getFilter(); + $top = $request_parameters->getTop(); + $skip = $request_parameters->getSkip(); + $count = $request_parameters->getCount(); + $count_only = $request_parameters->getCountOnly(); + + // verify the required parameter 'avalara_version' is set + if ($avalara_version === null || (is_array($avalara_version) && count($avalara_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $avalara_version when calling getMandates' + ); + } + + $resourcePath = '/einvoicing/mandates'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($filter !== null) { + if('form' === 'form' && is_array($filter)) { + foreach($filter as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$filter'] = $filter; + } + } + // query params + if ($top !== null) { + if('form' === 'form' && is_array($top)) { + foreach($top as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$top'] = $top; + } + } + // query params + if ($skip !== null) { + if('form' === 'form' && is_array($skip)) { + foreach($skip as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$skip'] = $skip; + } + } + // query params + if ($count !== null) { + if('form' === 'form' && is_array($count)) { + foreach($count as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$count'] = $count; + } + } + // query params + if ($count_only !== null) { + if('form' === 'form' && is_array($count_only)) { + foreach($count_only as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$countOnly'] = $count_only; + } + } + + // header params + $headerParams['avalara-version'] = '1.0'; + if ($avalara_version !== null) { + $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); + } + // header params + $headerParams['avalara-version'] = '1.0'; + if ($x_avalara_client !== null) { + $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); + } + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; ; {$this->client->config->getMachineName()}"; + + $headers['X-Avalara-Client']=$clientId; + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + $headers = $this->client->applyAuthToRequest($headers, $requiredScopes); + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->client->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + +} + /** + * Represents the Request object for the GetMandates API + * + * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + * @param string $filter Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. (optional) + * @param float $top If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. (optional) + * @param float $skip If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. (optional) + * @param bool $count When set to true, the count of the collection is also returned in the response body. (optional) + * @param bool $count_only When set to true, only the count of the collection is returned (optional) + */ +class GetMandatesRequest { + private $avalara_version; + private $x_avalara_client; + private $filter; + private $top; + private $skip; + private $count; + private $count_only; + + public function __construct() { + } + public function getAvalaraVersion() { + return $this->avalara_version; + } + + public function setAvalaraVersion($avalara_version) { + $this->avalara_version = $avalara_version; + } + public function getXAvalaraClient() { + return $this->x_avalara_client; + } + + public function setXAvalaraClient($x_avalara_client) { + $this->x_avalara_client = $x_avalara_client; + } + public function getFilter() { + return $this->filter; + } + + public function setFilter($filter) { + $this->filter = $filter; + } + public function getTop() { + return $this->top; + } + + public function setTop($top) { + $this->top = $top; + } + public function getSkip() { + return $this->skip; + } + + public function setSkip($skip) { + $this->skip = $skip; + } + public function getCount() { + return $this->count; + } + + public function setCount($count) { + $this->count = $count; + } + public function getCountOnly() { + return $this->count_only; + } + + public function setCountOnly($count_only) { + $this->count_only = $count_only; + } +} + diff --git a/lib/ApiClient.php b/lib/ApiClient.php new file mode 100644 index 0000000..7f52cb7 --- /dev/null +++ b/lib/ApiClient.php @@ -0,0 +1,285 @@ +accessTokenMap = new \Ds\Map(); + + $this->config = $config; + $this->environment = $this->config->getEnvironment(); + + if (strtolower($this->environment)=="sandbox"){ + $this->config->setHost('https://api.sbx.avalara.com'); + } + elseif(strtolower($this->environment)=="qa"){ + $this->config->setHost("https://superapi.qa.avalara.io"); + } + elseif(strtolower($this->environment)=="production"){ + $this->config->setHost("https://api.avalara.com"); + } + elseif(strtolower($this->environment)=="test"){ + if (is_null($this->config->getTestBasePath())) { + throw new ApiException("TestBasePath must be passed into the config object when environment=\"test\"."); + } else { + $this->config->setHost($this->config->getTestBasePath()); + } + } + else{ + throw new ApiException("Environment is not set correctly."); + } + + $logOptions = $this->config->getLogOptions(); + if ($logOptions != null && $logOptions->logger != null) { + $this->logger = $logOptions->logger; + } else { + $this->logger = new BaseLogger(); + } + + $this->logRequestAndResponse = $logOptions->logRequestAndResponse; + + $this->client = $this->config->getClient(); + + $this->headerSelector = new HeaderSelector(); + } + + /** + * Sets the sdkVersion + * + * @param string $sdkVersion + * + * @return $this + */ + public function setSdkVersion($sdkVersion) + { + $this->sdkVersion = $sdkVersion; + return $this; + } + + /** + * Adds appropriate Authentication header to the array of headers passed in + * + * @param Array $headers + * + * @return $headers + */ + public function applyAuthToRequest($headers, $requiredScopes) { + $bearerToken = $this->config->getBearerToken(); + $clientId = $this->config->getClientId(); + $clientSecret = $this->config->getClientSecret(); + $username = $this->config->getUserName(); + $password = $this->config->getPassword(); + + if (!is_null($bearerToken)) { + $headers['Authorization'] = 'Bearer ' . $bearerToken; + } elseif (!is_null($clientId) && !is_null($clientSecret)) { + $scopes = $this->standardizeScopes($requiredScopes); + $accessToken = $this->getOAuthAccessToken($scopes); + if (is_null($accessToken)) { + $this->updateOAuthAccessToken($scopes, null); + $accessToken = $this->getOAuthAccessToken($scopes); + } + $headers['Authorization'] = 'Bearer ' . $accessToken; + } elseif (!is_null($username) && !is_null($password)) { + $headers['Authorization'] = 'Basic ' . base64_encode($username . ":" . $password); + } + return $headers; + } + + private function standardizeScopes($requiredScopes) { + $strArray = explode(' ', $requiredScopes); + sort($strArray); + return implode(' ', $strArray); + } + + private function getOAuthAccessToken($scopes) { + $tokenMetadata = null; + if ($this->accessTokenMap->hasKey($scopes)) { + $tokenMetadata = $this->accessTokenMap->get($scopes); + } + if (!is_null($tokenMetadata)) { + $accessToken = $tokenMetadata->accessToken; + $expiry = $tokenMetadata->expiry; + $expirationTime = time() + 300; + if ($expirationTime < $expiry) { + return $accessToken; + } + } + return null; + } + + private function updateOAuthAccessToken($scopes, $accessToken) { + $currentAccessToken = $this->getOAuthAccessToken($scopes); + if (is_null($currentAccessToken) || $currentAccessToken == $accessToken) { + try { + $data = $this->buildOAuthRequest($scopes); + $timestamp = time() + $data->expires_in; + $tokenMetadata = new TokenMetadata($data->access_token, $timestamp); + $this->accessTokenMap->put($scopes, $tokenMetadata); + } catch (Exception $e) { + echo 'OAuth2 Token retrieval failed. Error: ', $e->getMessage(), "\n"; + throw new ApiException('OAuth2 Token retrieval failed. Error: '. $e->getMessage()); + } + } + } + + private function buildOAuthRequest($scopes) { + $this->config->setOAuthEndpoints(); + $httpBody = 'grant_type=client_credentials&scope=' . $scopes; + $headers = []; + $headers['Content-Type'] = 'application/x-www-form-urlencoded'; + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getClientId() . ":" . $this->config->getClientSecret()); + $headers['Accept'] = 'application/json'; + $request = new Request('POST', $this->config->getTokenUrl(), $headers, $httpBody); + $response = $this->send_sync($request, []); + $content = (string) $response->getBody(); + return json_decode($content); + } + + public function refreshAuthToken($headers, $requiredScopes) { + $authHeader = $headers['Authorization'][0]; + $authValues = explode(' ', $authHeader); + if (!is_null($authValues) && count($authValues) == 2 && + !is_null($this->config->getClientId()) && !is_null($this->config->getClientSecret())) { + + $this->updateOAuthAccessToken($requiredScopes, $authValues[1]); + } + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation send_sync + * + * Executes http request synchronously + * + * @param GuzzleHttp\Request + * @param array of http client options + * @param \returnType + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return Http response + */ + public function send_sync($request, $options) + { + return $this->client->send($request, $options); + } + + /** + * Operation send_async + * + * Executes http request synchronously + * + * @param GuzzleHttp\Request + * @param array of http client options + * @param \returnType + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return Http response + */ + public function send_async($request, $options) + { + return $this->client->sendAsync($request, $options); + } +} diff --git a/lib/ApiException.php b/lib/ApiException.php new file mode 100644 index 0000000..5830e3b --- /dev/null +++ b/lib/ApiException.php @@ -0,0 +1,120 @@ +responseHeaders = $responseHeaders; + $this->responseBody = $responseBody; + } + + /** + * Gets the HTTP response header + * + * @return string[]|null HTTP response header + */ + public function getResponseHeaders() + { + return $this->responseHeaders; + } + + /** + * Gets the HTTP body of the server response either as Json or string + * + * @return \stdClass|string|null HTTP body of the server response either as \stdClass or string + */ + public function getResponseBody() + { + return $this->responseBody; + } + + /** + * Sets the deserialized response object (during deserialization) + * + * @param mixed $obj Deserialized response object + * + * @return void + */ + public function setResponseObject($obj) + { + $this->responseObject = $obj; + } + + /** + * Gets the deserialized response object (during deserialization) + * + * @return mixed the deserialized response object + */ + public function getResponseObject() + { + return $this->responseObject; + } +} diff --git a/lib/Auth/DeviceAuthorizationResponse.php b/lib/Auth/DeviceAuthorizationResponse.php new file mode 100644 index 0000000..d422948 --- /dev/null +++ b/lib/Auth/DeviceAuthorizationResponse.php @@ -0,0 +1,58 @@ +deviceCode = $deviceCode; + $this->userCode = $userCode; + $this->verificationUrl = $verificationUrl; + $this->verificationUrlComplete = $verificationUrlComplete; + $this->interval = $interval; + $this->expiry = $expiry; + } +} +?> \ No newline at end of file diff --git a/lib/Auth/OAuthHelper.php b/lib/Auth/OAuthHelper.php new file mode 100644 index 0000000..3cb9747 --- /dev/null +++ b/lib/Auth/OAuthHelper.php @@ -0,0 +1,62 @@ +setOAuthEndpoints(); + try { + $httpBody = 'client_id=' . $configuration->getClientId() . '&scope=' . $scopes; + $headers = []; + $headers['Content-Type'] = 'application/x-www-form-urlencoded'; + $headers['Accept'] = 'application/json'; + $request = new Request('POST', $configuration->getDeviceAuthorizationUrl(), $headers, $httpBody); + $response = $configuration->getClient()->send($request, []); + $content = (string) $response->getBody(); + $json = json_decode($content); + return new DeviceAuthorizationResponse($json->device_code, $json->user_code, $json->verification_uri, $json->verification_uri_complete, $json->expires_in, $json->interval); + } catch (Exception $e) { + echo 'OAuth2 Device Authorization retrieval failed. Error: ', $e->getMessage(), "\n"; + throw new ApiException('OAuth2 Device Authorization retrieval failed. Error: '. $e->getMessage()); + } + } + + public static function getAccessTokenForDeviceFlow($deviceAuthorizationCode, $configuration) { + try { + $httpBody = 'grant_type=urn:ietf:params:oauth:grant-type:device_code&client_id=' . $configuration->getClientId() . '&device_code=' . $deviceAuthorizationCode; + $headers = []; + $headers['Content-Type'] = 'application/x-www-form-urlencoded'; + $headers['Accept'] = 'application/json'; + $request = new Request('POST', $configuration->getTokenUrl(), $headers, $httpBody); + $response = $configuration->getClient()->send($request, []); + $content = (string) $response->getBody(); + $json = json_decode($content); + $statusCode = $response->getStatusCode(); + if ($statusCode > 199 && $statusCode < 300) { + $refreshToken = isset($json->refresh_token) ? $json->refresh_token : null; + return new TokenResponse($json->token_type, $refreshToken, $json->access_token, $statusCode, $json->expires_in, null); + } + } catch (\GuzzleHttp\Exception\ClientException $e) { + $errObj = json_decode($e->getResponse()->getBody()); + return new TokenResponse(null, null, null, $e->getCode(), null, $errObj->error); + } catch (\Exception $e) { + throw new ApiException('GetAccessTokenForDeviceFlow API call failed to retrieve the token. Error: ' . $e->getMessage()); + } + } +} +?> \ No newline at end of file diff --git a/lib/Auth/TokenResponse.php b/lib/Auth/TokenResponse.php new file mode 100644 index 0000000..ccf96a7 --- /dev/null +++ b/lib/Auth/TokenResponse.php @@ -0,0 +1,63 @@ +tokenType = $tokenType; + $this->refreshToken = $refreshToken; + $this->accessToken = $accessToken; + $this->httpStatusCode = $httpStatusCode; + $this->expiryTime = $expiryTime; + $this->errorMessage = $errorMessage; + } +} +?> \ No newline at end of file diff --git a/lib/Configuration.php b/lib/Configuration.php new file mode 100644 index 0000000..97aa82f --- /dev/null +++ b/lib/Configuration.php @@ -0,0 +1,800 @@ +tempFolderPath = sys_get_temp_dir(); + $this->logOptions = new LogOptions(); + } + /** + * Sets API key + * + * @param string $environment API + * + * @return $this + */ + public function setEnvironment($environment) + { + $this->environment = $environment; + return $this; + } + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return $this + */ + public function setApiKey($apiKeyIdentifier, $key) + { + $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string API key or token + */ + public function getApiKey($apiKeyIdentifier) + { + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + } + + /** + * 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 + * + * @return $this + */ + public function setApiKeyPrefix($apiKeyIdentifier, $prefix) + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string + */ + public function getApiKeyPrefix($apiKeyIdentifier) + { + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + } + + /** + * Sets the access token for OAuth + * + * @param string Bearer Token for OAuth + * + * @return $this + */ + public function setBearerToken($bearerToken) + { + $this->bearerToken = $bearerToken; + return $this; + } + + /** + * Gets the access token for OAuth + * + * @return string Bearer token for OAuth + */ + public function getBearerToken() + { + return $this->bearerToken; + } + + /** + * Gets the Guzzle client for the app + * + * @return string GuzzleClient + */ + public function getClient() + { + if (is_null($this->client)) { + $this->client = new Client(); + } + return $this->client; + } + + /** + * Sets the ClientId used for the OAuth2 Client Credentials flow + * + * @param string ClientId for OAuth client creds flow + * + * @return $this + */ + public function setClientId($clientId) + { + $this->clientId = $clientId; + return $this; + } + + /** + * Gets the clientId for OAuth2 + * + * @return string ClientId for OAuth2 + */ + public function getClientId() + { + return $this->clientId; + } + + /** + * Sets the clientSecret used for the OAuth2 Client Credentials flow + * + * @param string clientSecret for OAuth client creds flow + * + * @return $this + */ + public function setClientSecret($clientSecret) + { + $this->clientSecret = $clientSecret; + return $this; + } + + /** + * Gets the clientSecret for OAuth2 + * + * @return string clientSecret for OAuth2 + */ + public function getClientSecret() + { + return $this->clientSecret; + } + + /** + * Sets the Test Base Path to be used for local development for calling the Avalara APIs + * + * @param string testBasePath + * + * @return $this + */ + public function setTestBasePath($testBasePath) + { + $this->testBasePath = $testBasePath; + return $this; + } + + /** + * Gets the Test Base Path to be used for local development for calling the Avalara APIs + * + * @return string testBasePath + */ + public function getTestBasePath() + { + return $this->testBasePath; + } + + /** + * Sets The Test Token URL to be used for local development to invoke the OAuth2 flow + * + * @param string clientSecret for OAuth client creds flow + * + * @return $this + */ + public function setTestTokenUrl($testTokenUrl) + { + $this->testTokenUrl = $testTokenUrl; + return $this; + } + + /** + * Gets the Token URL to be used to invoke the OAuth2 flow + * + * @return string tokenUrl + */ + public function getTokenUrl() + { + return $this->tokenUrl; + } + + /** + * Gets the Token URL to be used to invoke the OAuth2 flow + * + * @return string deviceAuthorizationUrl + */ + public function getDeviceAuthorizationUrl() + { + return $this->deviceAuthorizationUrl; + } + + /** + * Gets the Test Token URL to be used for local development to invoke the OAuth2 flow + * + * @return string testTokenUrl + */ + public function getTestTokenUrl() + { + return $this->testTokenUrl; + } + + /** + * Gets the Test Authorization URL to be used for local development to invoke the OAuth2 Device Code flow + * + * @return string testDeviceAuthorizationUrl + */ + public function getTestDeviceAuthorizationUrl() + { + return $this->testDeviceAuthorizationUrl; + } + + /** + * Sets the appName + * + * @param string $appname + * + * @return $this + */ + public function setAppName($appName) + { + $this->appName = $appName; + return $this; + } + + /** + * Gets the application name. + * + * @return string appname + */ + public function getAppName() + { + return $this->appName; + } + + /** + * Sets the appVersion + * + * @param string $appVersion + * + * @return $this + */ + public function setAppVersion($appVersion) + { + $this->appVersion = $appVersion; + return $this; + } + + /** + * Gets the application version. + * + * @return string appVersion + */ + public function getAppVersion() + { + return $this->appVersion; + } + /** + * Sets the machineName + * + * @param string $machineName + * + * @return $this + */ + public function setMachineName($machineName) + { + $this->machineName = $machineName; + return $this; + } + + /** + * Gets the machine name. + * + * @return string machineName + */ + public function getMachineName() + { + return $this->machineName; + } + + /** + * Sets the username for HTTP basic authentication + * + * @param string $username Username for HTTP basic authentication + * + * @return $this + */ + public function setUsername($username) + { + $this->username = $username; + return $this; + } + + /** + * Gets the username for HTTP basic authentication + * + * @return string Username for HTTP basic authentication + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets the password for HTTP basic authentication + * + * @param string $password Password for HTTP basic authentication + * + * @return $this + */ + public function setPassword($password) + { + $this->password = $password; + return $this; + } + + /** + * Gets the password for HTTP basic authentication + * + * @return string Password for HTTP basic authentication + */ + public function getPassword() + { + return $this->password; + } + + /** + * Sets the host + * + * @param string $host Host + * + * @return $this + */ + public function setHost($host) + { + $this->host = $host; + return $this; + } + + /** + * Gets the host + * + * @return string Host + */ + public function getHost() + { + return $this->host; + } + + /** + * Sets log options + * + * @param LogOptions logOptions + * + * @return $this + */ + public function setLogOptions($logOptions) + { + $this->logOptions = $logOptions; + return $this; + } + + /** + * Gets the current logOptions + * + * @return LogOptions + */ + public function getLogOptions() + { + return $this->logOptions; + } + + /** + * Sets the temp folder path + * + * @param string $tempFolderPath Temp folder path + * + * @return $this + */ + public function setTempFolderPath($tempFolderPath) + { + $this->tempFolderPath = $tempFolderPath; + return $this; + } + + /** + * Gets the temp folder path + * + * @return string Temp folder path + */ + public function getTempFolderPath() + { + return $this->tempFolderPath; + } + + /** + * Gets Envrionment + * + * @return string environment + */ + public function getEnvironment() + { + return $this->environment; + } + + /** + * Gets the default configuration instance + * + * @return Configuration + */ + public static function getDefaultConfiguration() + { + if (self::$defaultConfiguration === null) { + self::$defaultConfiguration = new Configuration(); + } + + return self::$defaultConfiguration; + } + + /** + * Sets the default configuration instance + * + * @param Configuration $config An instance of the Configuration Object + * + * @return void + */ + public static function setDefaultConfiguration(Configuration $config) + { + self::$defaultConfiguration = $config; + } + + /** + * Gets the essential information for debugging + * + * @return string The report for debugging + */ + public static function toDebugReport() + { + $report = 'PHP SDK (Avalara\SDK) Debug Report:' . PHP_EOL; + $report .= ' OS: ' . php_uname() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; + $report .= ' The version of the OpenAPI document: 2.1.0-beta' . PHP_EOL; + $report .= ' SDK Package Version: 22.1.0' . PHP_EOL; + $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; + + return $report; + } + + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return null|string API key with the prefix + */ + public function getApiKeyWithPrefix($apiKeyIdentifier) + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } + + /** + * Returns an array of host settings + * + * @return array an array of host settings + */ + public function getHostSettings() + { + return [ + [ + "url" => "", + "description" => "No description provided", + ] + ]; + } + + /** + * Returns URL based on the index and variables + * + * @param int $index index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public function getHostFromSettings($index, $variables = null) + { + if (null === $variables) { + $variables = []; + } + + $hosts = $this->getHostSettings(); + + // check array index out of bound + if ($index < 0 || $index >= sizeof($hosts)) { + throw new \InvalidArgumentException("Invalid index $index when selecting the host. Must be less than ".sizeof($hosts)); + } + + $host = $hosts[$index]; + $url = $host["url"]; + + // go through variable and assign a value + foreach ($host["variables"] ?? [] as $name => $variable) { + if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user + if (in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum + $url = str_replace("{".$name."}", $variables[$name], $url); + } else { + throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); + } + } else { + // use default value + $url = str_replace("{".$name."}", $variable["default_value"], $url); + } + } + + return $url; + } + + /** + * Sets the tokenUrl + * + * + * @return $this + */ + public function setOAuthEndpoints() + { + $environment = $this->environment; + if (strtolower($environment)=="test") { + $this->tokenUrl = $this->getTestTokenUrl(); + $this->deviceAuthorizationUrl = $this->getTestDeviceAuthorizationUrl(); + } else if (is_null($this->tokenUrl) || strlen($this->tokenUrl) == 0) { + try { + $request = new Request('GET', $this->getOpenIdConnectUrl()); + $response = $this->getClient()->send($request, []); + $content = (string) $response->getBody(); + $oidcResponse = json_decode($content); + $this->tokenUrl = $oidcResponse->token_endpoint; + $this->deviceAuthorizationUrl = $oidcResponse->device_authorization_endpoint; + } catch (Exception $e) { + echo 'Exception when calling OpenIdConnect to fetch the token endpoint so using fallbacks. Error: ', $e->getMessage(), "\n"; + $this->tokenUrl = $FALLBACK_TOKEN_URL; + $this->deviceAuthorizationUrl = $FALLBACK_DEVICE_AUTHORIZATION_URL; + } + } + return $this; + } + + public function getOpenIdConnectUrl() { + $environment = strtolower($this->environment); + switch ($environment) { + case "production": + return $this->PRODUCTION_OPENID_CONFIG_URL; + case "sandbox": + return $this->SANDBOX_OPENID_CONFIG_URL; + case "qa": + return $this->QA_OPENID_CONFIG_URL; + } + } +} diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php new file mode 100644 index 0000000..353cad8 --- /dev/null +++ b/lib/HeaderSelector.php @@ -0,0 +1,108 @@ +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 null|string Accept (e.g. application/json) + */ + private function selectAcceptHeader($accept) + { + if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { + return null; + } elseif ($jsonAccept = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept)) { + return implode(',', $jsonAccept); + } 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/lib/Model/EInvoicing/V1/BadDownloadRequest.php b/lib/Model/EInvoicing/V1/BadDownloadRequest.php new file mode 100644 index 0000000..d0f0fcb --- /dev/null +++ b/lib/Model/EInvoicing/V1/BadDownloadRequest.php @@ -0,0 +1,394 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * BadDownloadRequest Class Doc Comment + * + * @category Class + * @description Returns an HTTP status code and message for a 'bad request' + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class BadDownloadRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BadDownloadRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'error' => 'string', + 'message' => 'string', + 'supported_accept_headers' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'error' => null, + 'message' => null, + 'supported_accept_headers' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'error' => 'error', + 'message' => 'message', + 'supported_accept_headers' => 'supportedAcceptHeaders' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'error' => 'setError', + 'message' => 'setMessage', + 'supported_accept_headers' => 'setSupportedAcceptHeaders' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'error' => 'getError', + 'message' => 'getMessage', + 'supported_accept_headers' => 'getSupportedAcceptHeaders' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['error'] = $data['error'] ?? null; + $this->container['message'] = $data['message'] ?? null; + $this->container['supported_accept_headers'] = $data['supported_accept_headers'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The three-digit HTTP error code for the bad request + * + * @return self + */ + public function setError($error) + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message A message explaining the bad request + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets supported_accept_headers + * + * @return object|null + */ + public function getSupportedAcceptHeaders() + { + return $this->container['supported_accept_headers']; + } + + /** + * Sets supported_accept_headers + * + * @param object|null $supported_accept_headers A message explaining the bad request + * + * @return self + */ + public function setSupportedAcceptHeaders($supported_accept_headers) + { + $this->container['supported_accept_headers'] = $supported_accept_headers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/BadRequest.php b/lib/Model/EInvoicing/V1/BadRequest.php new file mode 100644 index 0000000..b55b7df --- /dev/null +++ b/lib/Model/EInvoicing/V1/BadRequest.php @@ -0,0 +1,364 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * BadRequest Class Doc Comment + * + * @category Class + * @description Returns an HTTP status code and message for a 'bad request' + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class BadRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BadRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'error' => 'string', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'error' => null, + 'message' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'error' => 'error', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'error' => 'setError', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'error' => 'getError', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['error'] = $data['error'] ?? null; + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The three-digit HTTP error code for the bad request + * + * @return self + */ + public function setError($error) + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message A message explaining the bad request + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/ConditionalForField.php b/lib/Model/EInvoicing/V1/ConditionalForField.php new file mode 100644 index 0000000..d389ebc --- /dev/null +++ b/lib/Model/EInvoicing/V1/ConditionalForField.php @@ -0,0 +1,364 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * ConditionalForField Class Doc Comment + * + * @category Class + * @description Mandates for which this field is conditional + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class ConditionalForField implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConditionalForField'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'country_mandate' => 'string', + 'required_when' => '\Avalara\SDK\Model\EInvoicing\V1\RequiredWhenField[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'country_mandate' => null, + 'required_when' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'country_mandate' => 'countryMandate', + 'required_when' => 'requiredWhen' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'country_mandate' => 'setCountryMandate', + 'required_when' => 'setRequiredWhen' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'country_mandate' => 'getCountryMandate', + 'required_when' => 'getRequiredWhen' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['country_mandate'] = $data['country_mandate'] ?? null; + $this->container['required_when'] = $data['required_when'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets country_mandate + * + * @return string|null + */ + public function getCountryMandate() + { + return $this->container['country_mandate']; + } + + /** + * Sets country_mandate + * + * @param string|null $country_mandate country_mandate + * + * @return self + */ + public function setCountryMandate($country_mandate) + { + $this->container['country_mandate'] = $country_mandate; + + return $this; + } + + /** + * Gets required_when + * + * @return \Avalara\SDK\Model\EInvoicing\V1\RequiredWhenField[]|null + */ + public function getRequiredWhen() + { + return $this->container['required_when']; + } + + /** + * Sets required_when + * + * @param \Avalara\SDK\Model\EInvoicing\V1\RequiredWhenField[]|null $required_when Array of scenarios which describe when a particular field is conditional for a country mandate + * + * @return self + */ + public function setRequiredWhen($required_when) + { + $this->container['required_when'] = $required_when; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DataInputField.php b/lib/Model/EInvoicing/V1/DataInputField.php new file mode 100644 index 0000000..d04b20b --- /dev/null +++ b/lib/Model/EInvoicing/V1/DataInputField.php @@ -0,0 +1,754 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DataInputField Class Doc Comment + * + * @category Class + * @description The Data Input Field + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DataInputField implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DataInputField'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'field_id' => 'string', + 'applicable_document_roots' => 'object[]', + 'path' => 'string', + 'name_space' => 'string', + 'field_name' => 'string', + 'example_or_fixed_value' => 'string', + 'accepted_values' => 'object', + 'documentation_link' => 'string', + 'description' => 'string', + 'is_segment' => 'bool', + 'required_for' => '\Avalara\SDK\Model\EInvoicing\V1\DataInputFieldRequiredFor', + 'conditional_for' => '\Avalara\SDK\Model\EInvoicing\V1\ConditionalForField[]', + 'not_used_for' => '\Avalara\SDK\Model\EInvoicing\V1\DataInputFieldNotUsedFor', + 'optional_for' => '\Avalara\SDK\Model\EInvoicing\V1\DataInputFieldOptionalFor' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'field_id' => null, + 'applicable_document_roots' => null, + 'path' => null, + 'name_space' => null, + 'field_name' => null, + 'example_or_fixed_value' => null, + 'accepted_values' => null, + 'documentation_link' => null, + 'description' => null, + 'is_segment' => null, + 'required_for' => null, + 'conditional_for' => null, + 'not_used_for' => null, + 'optional_for' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'field_id' => 'fieldId', + 'applicable_document_roots' => 'applicableDocumentRoots', + 'path' => 'path', + 'name_space' => 'nameSpace', + 'field_name' => 'fieldName', + 'example_or_fixed_value' => 'exampleOrFixedValue', + 'accepted_values' => 'acceptedValues', + 'documentation_link' => 'documentationLink', + 'description' => 'description', + 'is_segment' => 'isSegment', + 'required_for' => 'requiredFor', + 'conditional_for' => 'conditionalFor', + 'not_used_for' => 'notUsedFor', + 'optional_for' => 'optionalFor' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'field_id' => 'setFieldId', + 'applicable_document_roots' => 'setApplicableDocumentRoots', + 'path' => 'setPath', + 'name_space' => 'setNameSpace', + 'field_name' => 'setFieldName', + 'example_or_fixed_value' => 'setExampleOrFixedValue', + 'accepted_values' => 'setAcceptedValues', + 'documentation_link' => 'setDocumentationLink', + 'description' => 'setDescription', + 'is_segment' => 'setIsSegment', + 'required_for' => 'setRequiredFor', + 'conditional_for' => 'setConditionalFor', + 'not_used_for' => 'setNotUsedFor', + 'optional_for' => 'setOptionalFor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'field_id' => 'getFieldId', + 'applicable_document_roots' => 'getApplicableDocumentRoots', + 'path' => 'getPath', + 'name_space' => 'getNameSpace', + 'field_name' => 'getFieldName', + 'example_or_fixed_value' => 'getExampleOrFixedValue', + 'accepted_values' => 'getAcceptedValues', + 'documentation_link' => 'getDocumentationLink', + 'description' => 'getDescription', + 'is_segment' => 'getIsSegment', + 'required_for' => 'getRequiredFor', + 'conditional_for' => 'getConditionalFor', + 'not_used_for' => 'getNotUsedFor', + 'optional_for' => 'getOptionalFor' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['field_id'] = $data['field_id'] ?? null; + $this->container['applicable_document_roots'] = $data['applicable_document_roots'] ?? null; + $this->container['path'] = $data['path'] ?? null; + $this->container['name_space'] = $data['name_space'] ?? null; + $this->container['field_name'] = $data['field_name'] ?? null; + $this->container['example_or_fixed_value'] = $data['example_or_fixed_value'] ?? null; + $this->container['accepted_values'] = $data['accepted_values'] ?? null; + $this->container['documentation_link'] = $data['documentation_link'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['is_segment'] = $data['is_segment'] ?? null; + $this->container['required_for'] = $data['required_for'] ?? null; + $this->container['conditional_for'] = $data['conditional_for'] ?? null; + $this->container['not_used_for'] = $data['not_used_for'] ?? null; + $this->container['optional_for'] = $data['optional_for'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Field UUID + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets field_id + * + * @return string|null + */ + public function getFieldId() + { + return $this->container['field_id']; + } + + /** + * Sets field_id + * + * @param string|null $field_id Field ID + * + * @return self + */ + public function setFieldId($field_id) + { + $this->container['field_id'] = $field_id; + + return $this; + } + + /** + * Gets applicable_document_roots + * + * @return object[]|null + */ + public function getApplicableDocumentRoots() + { + return $this->container['applicable_document_roots']; + } + + /** + * Sets applicable_document_roots + * + * @param object[]|null $applicable_document_roots applicable_document_roots + * + * @return self + */ + public function setApplicableDocumentRoots($applicable_document_roots) + { + $this->container['applicable_document_roots'] = $applicable_document_roots; + + return $this; + } + + /** + * Gets path + * + * @return string|null + */ + public function getPath() + { + return $this->container['path']; + } + + /** + * Sets path + * + * @param string|null $path Path to this field + * + * @return self + */ + public function setPath($path) + { + $this->container['path'] = $path; + + return $this; + } + + /** + * Gets name_space + * + * @return string|null + */ + public function getNameSpace() + { + return $this->container['name_space']; + } + + /** + * Sets name_space + * + * @param string|null $name_space Namespace of this field + * + * @return self + */ + public function setNameSpace($name_space) + { + $this->container['name_space'] = $name_space; + + return $this; + } + + /** + * Gets field_name + * + * @return string|null + */ + public function getFieldName() + { + return $this->container['field_name']; + } + + /** + * Sets field_name + * + * @param string|null $field_name Field name + * + * @return self + */ + public function setFieldName($field_name) + { + $this->container['field_name'] = $field_name; + + return $this; + } + + /** + * Gets example_or_fixed_value + * + * @return string|null + */ + public function getExampleOrFixedValue() + { + return $this->container['example_or_fixed_value']; + } + + /** + * Sets example_or_fixed_value + * + * @param string|null $example_or_fixed_value An example of the content for this field + * + * @return self + */ + public function setExampleOrFixedValue($example_or_fixed_value) + { + $this->container['example_or_fixed_value'] = $example_or_fixed_value; + + return $this; + } + + /** + * Gets accepted_values + * + * @return object|null + */ + public function getAcceptedValues() + { + return $this->container['accepted_values']; + } + + /** + * Sets accepted_values + * + * @param object|null $accepted_values An object representing the acceptable values for this field + * + * @return self + */ + public function setAcceptedValues($accepted_values) + { + $this->container['accepted_values'] = $accepted_values; + + return $this; + } + + /** + * Gets documentation_link + * + * @return string|null + */ + public function getDocumentationLink() + { + return $this->container['documentation_link']; + } + + /** + * Sets documentation_link + * + * @param string|null $documentation_link An example of the content for this field + * + * @return self + */ + public function setDocumentationLink($documentation_link) + { + $this->container['documentation_link'] = $documentation_link; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A description of this field + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets is_segment + * + * @return bool|null + */ + public function getIsSegment() + { + return $this->container['is_segment']; + } + + /** + * Sets is_segment + * + * @param bool|null $is_segment Is this a segment of the schema + * + * @return self + */ + public function setIsSegment($is_segment) + { + $this->container['is_segment'] = $is_segment; + + return $this; + } + + /** + * Gets required_for + * + * @return \Avalara\SDK\Model\EInvoicing\V1\DataInputFieldRequiredFor|null + */ + public function getRequiredFor() + { + return $this->container['required_for']; + } + + /** + * Sets required_for + * + * @param \Avalara\SDK\Model\EInvoicing\V1\DataInputFieldRequiredFor|null $required_for required_for + * + * @return self + */ + public function setRequiredFor($required_for) + { + $this->container['required_for'] = $required_for; + + return $this; + } + + /** + * Gets conditional_for + * + * @return \Avalara\SDK\Model\EInvoicing\V1\ConditionalForField[]|null + */ + public function getConditionalFor() + { + return $this->container['conditional_for']; + } + + /** + * Sets conditional_for + * + * @param \Avalara\SDK\Model\EInvoicing\V1\ConditionalForField[]|null $conditional_for conditional_for + * + * @return self + */ + public function setConditionalFor($conditional_for) + { + $this->container['conditional_for'] = $conditional_for; + + return $this; + } + + /** + * Gets not_used_for + * + * @return \Avalara\SDK\Model\EInvoicing\V1\DataInputFieldNotUsedFor|null + */ + public function getNotUsedFor() + { + return $this->container['not_used_for']; + } + + /** + * Sets not_used_for + * + * @param \Avalara\SDK\Model\EInvoicing\V1\DataInputFieldNotUsedFor|null $not_used_for not_used_for + * + * @return self + */ + public function setNotUsedFor($not_used_for) + { + $this->container['not_used_for'] = $not_used_for; + + return $this; + } + + /** + * Gets optional_for + * + * @return \Avalara\SDK\Model\EInvoicing\V1\DataInputFieldOptionalFor|null + */ + public function getOptionalFor() + { + return $this->container['optional_for']; + } + + /** + * Sets optional_for + * + * @param \Avalara\SDK\Model\EInvoicing\V1\DataInputFieldOptionalFor|null $optional_for optional_for + * + * @return self + */ + public function setOptionalFor($optional_for) + { + $this->container['optional_for'] = $optional_for; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DataInputFieldNotUsedFor.php b/lib/Model/EInvoicing/V1/DataInputFieldNotUsedFor.php new file mode 100644 index 0000000..ec227d8 --- /dev/null +++ b/lib/Model/EInvoicing/V1/DataInputFieldNotUsedFor.php @@ -0,0 +1,334 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DataInputFieldNotUsedFor Class Doc Comment + * + * @category Class + * @description Array of CountryMandate names for which this field is not used. + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DataInputFieldNotUsedFor implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DataInputField_notUsedFor'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'country_mandate' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'country_mandate' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'country_mandate' => 'countryMandate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'country_mandate' => 'setCountryMandate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'country_mandate' => 'getCountryMandate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['country_mandate'] = $data['country_mandate'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets country_mandate + * + * @return string|null + */ + public function getCountryMandate() + { + return $this->container['country_mandate']; + } + + /** + * Sets country_mandate + * + * @param string|null $country_mandate country_mandate + * + * @return self + */ + public function setCountryMandate($country_mandate) + { + $this->container['country_mandate'] = $country_mandate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DataInputFieldOptionalFor.php b/lib/Model/EInvoicing/V1/DataInputFieldOptionalFor.php new file mode 100644 index 0000000..ac50908 --- /dev/null +++ b/lib/Model/EInvoicing/V1/DataInputFieldOptionalFor.php @@ -0,0 +1,334 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DataInputFieldOptionalFor Class Doc Comment + * + * @category Class + * @description Array of CountryMandate names for which this field is optional. + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DataInputFieldOptionalFor implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DataInputField_optionalFor'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'country_mandate' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'country_mandate' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'country_mandate' => 'countryMandate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'country_mandate' => 'setCountryMandate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'country_mandate' => 'getCountryMandate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['country_mandate'] = $data['country_mandate'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets country_mandate + * + * @return string|null + */ + public function getCountryMandate() + { + return $this->container['country_mandate']; + } + + /** + * Sets country_mandate + * + * @param string|null $country_mandate country_mandate + * + * @return self + */ + public function setCountryMandate($country_mandate) + { + $this->container['country_mandate'] = $country_mandate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DataInputFieldRequiredFor.php b/lib/Model/EInvoicing/V1/DataInputFieldRequiredFor.php new file mode 100644 index 0000000..c53a42e --- /dev/null +++ b/lib/Model/EInvoicing/V1/DataInputFieldRequiredFor.php @@ -0,0 +1,334 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DataInputFieldRequiredFor Class Doc Comment + * + * @category Class + * @description Array of CountryMandate names for which this field is required. + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DataInputFieldRequiredFor implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DataInputField_requiredFor'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'country_mandate' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'country_mandate' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'country_mandate' => 'countryMandate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'country_mandate' => 'setCountryMandate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'country_mandate' => 'getCountryMandate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['country_mandate'] = $data['country_mandate'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets country_mandate + * + * @return string|null + */ + public function getCountryMandate() + { + return $this->container['country_mandate']; + } + + /** + * Sets country_mandate + * + * @param string|null $country_mandate country_mandate + * + * @return self + */ + public function setCountryMandate($country_mandate) + { + $this->container['country_mandate'] = $country_mandate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DataInputFieldsResponse.php b/lib/Model/EInvoicing/V1/DataInputFieldsResponse.php new file mode 100644 index 0000000..6264460 --- /dev/null +++ b/lib/Model/EInvoicing/V1/DataInputFieldsResponse.php @@ -0,0 +1,393 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DataInputFieldsResponse Class Doc Comment + * + * @category Class + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DataInputFieldsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DataInputFieldsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'at_record_set_count' => 'float', + 'at_next_link' => 'string', + 'value' => '\Avalara\SDK\Model\EInvoicing\V1\DataInputField[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'at_record_set_count' => null, + 'at_next_link' => null, + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'at_record_set_count' => '@recordSetCount', + 'at_next_link' => '@nextLink', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'at_record_set_count' => 'setAtRecordSetCount', + 'at_next_link' => 'setAtNextLink', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'at_record_set_count' => 'getAtRecordSetCount', + 'at_next_link' => 'getAtNextLink', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['at_record_set_count'] = $data['at_record_set_count'] ?? null; + $this->container['at_next_link'] = $data['at_next_link'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets at_record_set_count + * + * @return float|null + */ + public function getAtRecordSetCount() + { + return $this->container['at_record_set_count']; + } + + /** + * Sets at_record_set_count + * + * @param float|null $at_record_set_count Total count of results + * + * @return self + */ + public function setAtRecordSetCount($at_record_set_count) + { + $this->container['at_record_set_count'] = $at_record_set_count; + + return $this; + } + + /** + * Gets at_next_link + * + * @return string|null + */ + public function getAtNextLink() + { + return $this->container['at_next_link']; + } + + /** + * Sets at_next_link + * + * @param string|null $at_next_link at_next_link + * + * @return self + */ + public function setAtNextLink($at_next_link) + { + $this->container['at_next_link'] = $at_next_link; + + return $this; + } + + /** + * Gets value + * + * @return \Avalara\SDK\Model\EInvoicing\V1\DataInputField[]|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param \Avalara\SDK\Model\EInvoicing\V1\DataInputField[]|null $value Array of Data Input Fields + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DocumentListResponse.php b/lib/Model/EInvoicing/V1/DocumentListResponse.php new file mode 100644 index 0000000..566ee17 --- /dev/null +++ b/lib/Model/EInvoicing/V1/DocumentListResponse.php @@ -0,0 +1,397 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DocumentListResponse Class Doc Comment + * + * @category Class + * @description Returns the requested list of documents + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DocumentListResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentListResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'at_record_set_count' => 'string', + 'at_next_link' => 'string', + 'value' => '\Avalara\SDK\Model\EInvoicing\V1\DocumentSummary[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'at_record_set_count' => null, + 'at_next_link' => null, + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'at_record_set_count' => '@recordSetCount', + 'at_next_link' => '@nextLink', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'at_record_set_count' => 'setAtRecordSetCount', + 'at_next_link' => 'setAtNextLink', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'at_record_set_count' => 'getAtRecordSetCount', + 'at_next_link' => 'getAtNextLink', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['at_record_set_count'] = $data['at_record_set_count'] ?? null; + $this->container['at_next_link'] = $data['at_next_link'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets at_record_set_count + * + * @return string|null + */ + public function getAtRecordSetCount() + { + return $this->container['at_record_set_count']; + } + + /** + * Sets at_record_set_count + * + * @param string|null $at_record_set_count Count of collections for the given date range + * + * @return self + */ + public function setAtRecordSetCount($at_record_set_count) + { + $this->container['at_record_set_count'] = $at_record_set_count; + + return $this; + } + + /** + * Gets at_next_link + * + * @return string|null + */ + public function getAtNextLink() + { + return $this->container['at_next_link']; + } + + /** + * Sets at_next_link + * + * @param string|null $at_next_link at_next_link + * + * @return self + */ + public function setAtNextLink($at_next_link) + { + $this->container['at_next_link'] = $at_next_link; + + return $this; + } + + /** + * Gets value + * + * @return \Avalara\SDK\Model\EInvoicing\V1\DocumentSummary[] + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param \Avalara\SDK\Model\EInvoicing\V1\DocumentSummary[] $value Array of invoices matching query parameters + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DocumentStatusResponse.php b/lib/Model/EInvoicing/V1/DocumentStatusResponse.php new file mode 100644 index 0000000..f9a21cb --- /dev/null +++ b/lib/Model/EInvoicing/V1/DocumentStatusResponse.php @@ -0,0 +1,394 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DocumentStatusResponse Class Doc Comment + * + * @category Class + * @description Returns the current document ID and status + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DocumentStatusResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentStatusResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'status' => 'string', + 'events' => '\Avalara\SDK\Model\EInvoicing\V1\StatusEvent[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'status' => null, + 'events' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'status' => 'status', + 'events' => 'events' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'status' => 'setStatus', + 'events' => 'setEvents' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'status' => 'getStatus', + 'events' => 'getEvents' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['events'] = $data['events'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique ID for this document + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status Status of the transaction:
'Pending'
'Failed'
'Complete' + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets events + * + * @return \Avalara\SDK\Model\EInvoicing\V1\StatusEvent[]|null + */ + public function getEvents() + { + return $this->container['events']; + } + + /** + * Sets events + * + * @param \Avalara\SDK\Model\EInvoicing\V1\StatusEvent[]|null $events events + * + * @return self + */ + public function setEvents($events) + { + $this->container['events'] = $events; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DocumentSubmissionError.php b/lib/Model/EInvoicing/V1/DocumentSubmissionError.php new file mode 100644 index 0000000..a5b8606 --- /dev/null +++ b/lib/Model/EInvoicing/V1/DocumentSubmissionError.php @@ -0,0 +1,364 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DocumentSubmissionError Class Doc Comment + * + * @category Class + * @description Returns an HTTP status code and message for an 'exception' + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DocumentSubmissionError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentSubmissionError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status_code' => 'string', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status_code' => null, + 'message' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status_code' => 'StatusCode', + 'message' => 'Message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status_code' => 'setStatusCode', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status_code' => 'getStatusCode', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['status_code'] = $data['status_code'] ?? null; + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status_code + * + * @return string|null + */ + public function getStatusCode() + { + return $this->container['status_code']; + } + + /** + * Sets status_code + * + * @param string|null $status_code The three-digit HTTP status code for the exception + * + * @return self + */ + public function setStatusCode($status_code) + { + $this->container['status_code'] = $status_code; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message A message explaining the exception + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DocumentSubmitResponse.php b/lib/Model/EInvoicing/V1/DocumentSubmitResponse.php new file mode 100644 index 0000000..183280e --- /dev/null +++ b/lib/Model/EInvoicing/V1/DocumentSubmitResponse.php @@ -0,0 +1,334 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DocumentSubmitResponse Class Doc Comment + * + * @category Class + * @description Returns the unique ID of a successful document submission + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DocumentSubmitResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentSubmitResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Unique ID for this document that can be used for status checking and file downloads. This is a UID created by the Avalara E-Invoicing platform. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DocumentSummary.php b/lib/Model/EInvoicing/V1/DocumentSummary.php new file mode 100644 index 0000000..c62838b --- /dev/null +++ b/lib/Model/EInvoicing/V1/DocumentSummary.php @@ -0,0 +1,664 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DocumentSummary Class Doc Comment + * + * @category Class + * @description Displays a summary of information about the document + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DocumentSummary implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentSummary'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'process_date_time' => 'string', + 'status' => 'string', + 'supplier_name' => 'string', + 'customer_name' => 'string', + 'document_number' => 'string', + 'document_date' => 'string', + 'flow' => 'string', + 'country_code' => 'string', + 'country_mandate' => 'string', + 'interface' => 'string', + 'receiver' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'process_date_time' => null, + 'status' => null, + 'supplier_name' => null, + 'customer_name' => null, + 'document_number' => null, + 'document_date' => null, + 'flow' => null, + 'country_code' => null, + 'country_mandate' => null, + 'interface' => null, + 'receiver' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'process_date_time' => 'processDateTime', + 'status' => 'status', + 'supplier_name' => 'supplierName', + 'customer_name' => 'customerName', + 'document_number' => 'documentNumber', + 'document_date' => 'documentDate', + 'flow' => 'flow', + 'country_code' => 'countryCode', + 'country_mandate' => 'countryMandate', + 'interface' => 'interface', + 'receiver' => 'receiver' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'process_date_time' => 'setProcessDateTime', + 'status' => 'setStatus', + 'supplier_name' => 'setSupplierName', + 'customer_name' => 'setCustomerName', + 'document_number' => 'setDocumentNumber', + 'document_date' => 'setDocumentDate', + 'flow' => 'setFlow', + 'country_code' => 'setCountryCode', + 'country_mandate' => 'setCountryMandate', + 'interface' => 'setInterface', + 'receiver' => 'setReceiver' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'process_date_time' => 'getProcessDateTime', + 'status' => 'getStatus', + 'supplier_name' => 'getSupplierName', + 'customer_name' => 'getCustomerName', + 'document_number' => 'getDocumentNumber', + 'document_date' => 'getDocumentDate', + 'flow' => 'getFlow', + 'country_code' => 'getCountryCode', + 'country_mandate' => 'getCountryMandate', + 'interface' => 'getInterface', + 'receiver' => 'getReceiver' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['process_date_time'] = $data['process_date_time'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['supplier_name'] = $data['supplier_name'] ?? null; + $this->container['customer_name'] = $data['customer_name'] ?? null; + $this->container['document_number'] = $data['document_number'] ?? null; + $this->container['document_date'] = $data['document_date'] ?? null; + $this->container['flow'] = $data['flow'] ?? null; + $this->container['country_code'] = $data['country_code'] ?? null; + $this->container['country_mandate'] = $data['country_mandate'] ?? null; + $this->container['interface'] = $data['interface'] ?? null; + $this->container['receiver'] = $data['receiver'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique ID for this document + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets process_date_time + * + * @return string|null + */ + public function getProcessDateTime() + { + return $this->container['process_date_time']; + } + + /** + * Sets process_date_time + * + * @param string|null $process_date_time The date and time when the document was processed, displayed in the format YYYY-MM-DDThh:mm:ss + * + * @return self + */ + public function setProcessDateTime($process_date_time) + { + $this->container['process_date_time'] = $process_date_time; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The transaction status:
'Pending'
'Failed'
'Complete' + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets supplier_name + * + * @return string|null + */ + public function getSupplierName() + { + return $this->container['supplier_name']; + } + + /** + * Sets supplier_name + * + * @param string|null $supplier_name The name of the supplier in the transaction + * + * @return self + */ + public function setSupplierName($supplier_name) + { + $this->container['supplier_name'] = $supplier_name; + + return $this; + } + + /** + * Gets customer_name + * + * @return string|null + */ + public function getCustomerName() + { + return $this->container['customer_name']; + } + + /** + * Sets customer_name + * + * @param string|null $customer_name The name of the customer in the transaction + * + * @return self + */ + public function setCustomerName($customer_name) + { + $this->container['customer_name'] = $customer_name; + + return $this; + } + + /** + * Gets document_number + * + * @return string|null + */ + public function getDocumentNumber() + { + return $this->container['document_number']; + } + + /** + * Sets document_number + * + * @param string|null $document_number The invoice document number + * + * @return self + */ + public function setDocumentNumber($document_number) + { + $this->container['document_number'] = $document_number; + + return $this; + } + + /** + * Gets document_date + * + * @return string|null + */ + public function getDocumentDate() + { + return $this->container['document_date']; + } + + /** + * Sets document_date + * + * @param string|null $document_date The invoice issue date + * + * @return self + */ + public function setDocumentDate($document_date) + { + $this->container['document_date'] = $document_date; + + return $this; + } + + /** + * Gets flow + * + * @return string|null + */ + public function getFlow() + { + return $this->container['flow']; + } + + /** + * Sets flow + * + * @param string|null $flow The invoice direction, where issued = `out` and received = `in` + * + * @return self + */ + public function setFlow($flow) + { + $this->container['flow'] = $flow; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code The two-letter ISO-3166 country code for the country where the e-invoice is being submitted + * + * @return self + */ + public function setCountryCode($country_code) + { + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets country_mandate + * + * @return string|null + */ + public function getCountryMandate() + { + return $this->container['country_mandate']; + } + + /** + * Sets country_mandate + * + * @param string|null $country_mandate The e-invoicing mandate for the specified country + * + * @return self + */ + public function setCountryMandate($country_mandate) + { + $this->container['country_mandate'] = $country_mandate; + + return $this; + } + + /** + * Gets interface + * + * @return string|null + */ + public function getInterface() + { + return $this->container['interface']; + } + + /** + * Sets interface + * + * @param string|null $interface The interface where the invoice data is sent + * + * @return self + */ + public function setInterface($interface) + { + $this->container['interface'] = $interface; + + return $this; + } + + /** + * Gets receiver + * + * @return string|null + */ + public function getReceiver() + { + return $this->container['receiver']; + } + + /** + * Sets receiver + * + * @param string|null $receiver The invoice recipient based on the interface + * + * @return self + */ + public function setReceiver($receiver) + { + $this->container['receiver'] = $receiver; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/ForbiddenError.php b/lib/Model/EInvoicing/V1/ForbiddenError.php new file mode 100644 index 0000000..852217b --- /dev/null +++ b/lib/Model/EInvoicing/V1/ForbiddenError.php @@ -0,0 +1,334 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * ForbiddenError Class Doc Comment + * + * @category Class + * @description Returns an optional message with a 'forbidden' response + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class ForbiddenError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForbiddenError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'Message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message A message that informs the user that they may not access a resource + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/InputDataFormats.php b/lib/Model/EInvoicing/V1/InputDataFormats.php new file mode 100644 index 0000000..7bdaf24 --- /dev/null +++ b/lib/Model/EInvoicing/V1/InputDataFormats.php @@ -0,0 +1,364 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * InputDataFormats Class Doc Comment + * + * @category Class + * @description Format and version used when inputting the data + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class InputDataFormats implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InputDataFormats'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'format' => 'string', + 'versions' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'format' => null, + 'versions' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'format' => 'format', + 'versions' => 'versions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'format' => 'setFormat', + 'versions' => 'setVersions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'format' => 'getFormat', + 'versions' => 'getVersions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['format'] = $data['format'] ?? null; + $this->container['versions'] = $data['versions'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets format + * + * @return string|null + */ + public function getFormat() + { + return $this->container['format']; + } + + /** + * Sets format + * + * @param string|null $format Invoice format + * + * @return self + */ + public function setFormat($format) + { + $this->container['format'] = $format; + + return $this; + } + + /** + * Gets versions + * + * @return string[]|null + */ + public function getVersions() + { + return $this->container['versions']; + } + + /** + * Sets versions + * + * @param string[]|null $versions versions + * + * @return self + */ + public function setVersions($versions) + { + $this->container['versions'] = $versions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/InternalServerError.php b/lib/Model/EInvoicing/V1/InternalServerError.php new file mode 100644 index 0000000..b48d933 --- /dev/null +++ b/lib/Model/EInvoicing/V1/InternalServerError.php @@ -0,0 +1,364 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * InternalServerError Class Doc Comment + * + * @category Class + * @description Returns an optional message with a 'InternalServerError' response + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class InternalServerError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InternalServerError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'error' => 'string', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'error' => null, + 'message' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'error' => 'error', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'error' => 'setError', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'error' => 'getError', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['error'] = $data['error'] ?? null; + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error A bad request error code + * + * @return self + */ + public function setError($error) + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message A message explaining the bad request error + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/Mandate.php b/lib/Model/EInvoicing/V1/Mandate.php new file mode 100644 index 0000000..a3f20f1 --- /dev/null +++ b/lib/Model/EInvoicing/V1/Mandate.php @@ -0,0 +1,543 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * Mandate Class Doc Comment + * + * @category Class + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class Mandate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Mandate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'mandate_id' => 'string', + 'country_mandate' => 'string', + 'country_code' => 'string', + 'description' => 'string', + 'supported_by_partner_api' => 'bool', + 'mandate_format' => 'string', + 'input_data_formats' => '\Avalara\SDK\Model\EInvoicing\V1\InputDataFormats[]', + 'workflow_ids' => '\Avalara\SDK\Model\EInvoicing\V1\WorkflowIds[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'mandate_id' => null, + 'country_mandate' => null, + 'country_code' => null, + 'description' => null, + 'supported_by_partner_api' => null, + 'mandate_format' => null, + 'input_data_formats' => null, + 'workflow_ids' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'mandate_id' => 'mandateId', + 'country_mandate' => 'countryMandate', + 'country_code' => 'countryCode', + 'description' => 'description', + 'supported_by_partner_api' => 'supportedByPartnerAPI', + 'mandate_format' => 'mandateFormat', + 'input_data_formats' => 'inputDataFormats', + 'workflow_ids' => 'workflowIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'mandate_id' => 'setMandateId', + 'country_mandate' => 'setCountryMandate', + 'country_code' => 'setCountryCode', + 'description' => 'setDescription', + 'supported_by_partner_api' => 'setSupportedByPartnerApi', + 'mandate_format' => 'setMandateFormat', + 'input_data_formats' => 'setInputDataFormats', + 'workflow_ids' => 'setWorkflowIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'mandate_id' => 'getMandateId', + 'country_mandate' => 'getCountryMandate', + 'country_code' => 'getCountryCode', + 'description' => 'getDescription', + 'supported_by_partner_api' => 'getSupportedByPartnerApi', + 'mandate_format' => 'getMandateFormat', + 'input_data_formats' => 'getInputDataFormats', + 'workflow_ids' => 'getWorkflowIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['mandate_id'] = $data['mandate_id'] ?? null; + $this->container['country_mandate'] = $data['country_mandate'] ?? null; + $this->container['country_code'] = $data['country_code'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['supported_by_partner_api'] = $data['supported_by_partner_api'] ?? null; + $this->container['mandate_format'] = $data['mandate_format'] ?? null; + $this->container['input_data_formats'] = $data['input_data_formats'] ?? null; + $this->container['workflow_ids'] = $data['workflow_ids'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets mandate_id + * + * @return string|null + */ + public function getMandateId() + { + return $this->container['mandate_id']; + } + + /** + * Sets mandate_id + * + * @param string|null $mandate_id Mandate UUID + * + * @return self + */ + public function setMandateId($mandate_id) + { + $this->container['mandate_id'] = $mandate_id; + + return $this; + } + + /** + * Gets country_mandate + * + * @return string|null + */ + public function getCountryMandate() + { + return $this->container['country_mandate']; + } + + /** + * Sets country_mandate + * + * @param string|null $country_mandate Country mandate name + * + * @return self + */ + public function setCountryMandate($country_mandate) + { + $this->container['country_mandate'] = $country_mandate; + + return $this; + } + + /** + * Gets country_code + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string|null $country_code Country code + * + * @return self + */ + public function setCountryCode($country_code) + { + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Mandate description + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets supported_by_partner_api + * + * @return bool|null + */ + public function getSupportedByPartnerApi() + { + return $this->container['supported_by_partner_api']; + } + + /** + * Sets supported_by_partner_api + * + * @param bool|null $supported_by_partner_api Indicates whether this mandate supported by the partner API + * + * @return self + */ + public function setSupportedByPartnerApi($supported_by_partner_api) + { + $this->container['supported_by_partner_api'] = $supported_by_partner_api; + + return $this; + } + + /** + * Gets mandate_format + * + * @return string|null + */ + public function getMandateFormat() + { + return $this->container['mandate_format']; + } + + /** + * Sets mandate_format + * + * @param string|null $mandate_format Mandate format + * + * @return self + */ + public function setMandateFormat($mandate_format) + { + $this->container['mandate_format'] = $mandate_format; + + return $this; + } + + /** + * Gets input_data_formats + * + * @return \Avalara\SDK\Model\EInvoicing\V1\InputDataFormats[]|null + */ + public function getInputDataFormats() + { + return $this->container['input_data_formats']; + } + + /** + * Sets input_data_formats + * + * @param \Avalara\SDK\Model\EInvoicing\V1\InputDataFormats[]|null $input_data_formats Format and version used when inputting the data + * + * @return self + */ + public function setInputDataFormats($input_data_formats) + { + $this->container['input_data_formats'] = $input_data_formats; + + return $this; + } + + /** + * Gets workflow_ids + * + * @return \Avalara\SDK\Model\EInvoicing\V1\WorkflowIds[]|null + */ + public function getWorkflowIds() + { + return $this->container['workflow_ids']; + } + + /** + * Sets workflow_ids + * + * @param \Avalara\SDK\Model\EInvoicing\V1\WorkflowIds[]|null $workflow_ids Workflow ID list + * + * @return self + */ + public function setWorkflowIds($workflow_ids) + { + $this->container['workflow_ids'] = $workflow_ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/MandatesResponse.php b/lib/Model/EInvoicing/V1/MandatesResponse.php new file mode 100644 index 0000000..0b99253 --- /dev/null +++ b/lib/Model/EInvoicing/V1/MandatesResponse.php @@ -0,0 +1,394 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * MandatesResponse Class Doc Comment + * + * @category Class + * @description Mandate list response schema + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class MandatesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MandatesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'at_record_set_count' => 'float', + 'at_next_link' => 'string', + 'value' => '\Avalara\SDK\Model\EInvoicing\V1\Mandate[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'at_record_set_count' => null, + 'at_next_link' => null, + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'at_record_set_count' => '@recordSetCount', + 'at_next_link' => '@nextLink', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'at_record_set_count' => 'setAtRecordSetCount', + 'at_next_link' => 'setAtNextLink', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'at_record_set_count' => 'getAtRecordSetCount', + 'at_next_link' => 'getAtNextLink', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['at_record_set_count'] = $data['at_record_set_count'] ?? null; + $this->container['at_next_link'] = $data['at_next_link'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets at_record_set_count + * + * @return float|null + */ + public function getAtRecordSetCount() + { + return $this->container['at_record_set_count']; + } + + /** + * Sets at_record_set_count + * + * @param float|null $at_record_set_count Total count of results + * + * @return self + */ + public function setAtRecordSetCount($at_record_set_count) + { + $this->container['at_record_set_count'] = $at_record_set_count; + + return $this; + } + + /** + * Gets at_next_link + * + * @return string|null + */ + public function getAtNextLink() + { + return $this->container['at_next_link']; + } + + /** + * Sets at_next_link + * + * @param string|null $at_next_link at_next_link + * + * @return self + */ + public function setAtNextLink($at_next_link) + { + $this->container['at_next_link'] = $at_next_link; + + return $this; + } + + /** + * Gets value + * + * @return \Avalara\SDK\Model\EInvoicing\V1\Mandate[]|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param \Avalara\SDK\Model\EInvoicing\V1\Mandate[]|null $value Mandates schema + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/ModelInterface.php b/lib/Model/EInvoicing/V1/ModelInterface.php new file mode 100644 index 0000000..44109dd --- /dev/null +++ b/lib/Model/EInvoicing/V1/ModelInterface.php @@ -0,0 +1,124 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +/** + * Interface abstracting model access. + * + * @package Avalara\SDK\Model\EInvoicing\V1 + * @author OpenAPI Generator team + */ +interface ModelInterface +{ + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(); + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(); + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(); + + /** + * Array of attributes where the key is the local name, and the value is the original name + * + * @return array + */ + public static function attributeMap(); + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(); + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(); + + /** + * Show all the invalid properties with reasons. + * + * @return array + */ + public function listInvalidProperties(); + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool + */ + public function valid(); + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool; + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool; +} diff --git a/lib/Model/EInvoicing/V1/NotFoundError.php b/lib/Model/EInvoicing/V1/NotFoundError.php new file mode 100644 index 0000000..d6211b7 --- /dev/null +++ b/lib/Model/EInvoicing/V1/NotFoundError.php @@ -0,0 +1,364 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * NotFoundError Class Doc Comment + * + * @category Class + * @description Returns an HTTP error code and message for a 'not found' error + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class NotFoundError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NotFoundError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'error' => 'string', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'error' => null, + 'message' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'error' => 'error', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'error' => 'setError', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'error' => 'getError', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['error'] = $data['error'] ?? null; + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets error + * + * @return string|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string|null $error The three-digit HTTP error code for a not found error + * + * @return self + */ + public function setError($error) + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message A message about the not found error + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/NotUsedForField.php b/lib/Model/EInvoicing/V1/NotUsedForField.php new file mode 100644 index 0000000..d1d23e6 --- /dev/null +++ b/lib/Model/EInvoicing/V1/NotUsedForField.php @@ -0,0 +1,334 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * NotUsedForField Class Doc Comment + * + * @category Class + * @description Mandates for which this field is not used + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class NotUsedForField implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NotUsedForField'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'country_mandate' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'country_mandate' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'country_mandate' => 'countryMandate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'country_mandate' => 'setCountryMandate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'country_mandate' => 'getCountryMandate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['country_mandate'] = $data['country_mandate'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets country_mandate + * + * @return string|null + */ + public function getCountryMandate() + { + return $this->container['country_mandate']; + } + + /** + * Sets country_mandate + * + * @param string|null $country_mandate country_mandate + * + * @return self + */ + public function setCountryMandate($country_mandate) + { + $this->container['country_mandate'] = $country_mandate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/RequiredWhenField.php b/lib/Model/EInvoicing/V1/RequiredWhenField.php new file mode 100644 index 0000000..abde239 --- /dev/null +++ b/lib/Model/EInvoicing/V1/RequiredWhenField.php @@ -0,0 +1,333 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * RequiredWhenField Class Doc Comment + * + * @category Class + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class RequiredWhenField implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RequiredWhenField'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'scenario' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'scenario' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'scenario' => 'scenario' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'scenario' => 'setScenario' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'scenario' => 'getScenario' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['scenario'] = $data['scenario'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets scenario + * + * @return string|null + */ + public function getScenario() + { + return $this->container['scenario']; + } + + /** + * Sets scenario + * + * @param string|null $scenario scenario + * + * @return self + */ + public function setScenario($scenario) + { + $this->container['scenario'] = $scenario; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/StatusEvent.php b/lib/Model/EInvoicing/V1/StatusEvent.php new file mode 100644 index 0000000..54baaec --- /dev/null +++ b/lib/Model/EInvoicing/V1/StatusEvent.php @@ -0,0 +1,364 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * StatusEvent Class Doc Comment + * + * @category Class + * @description Displays when a status event occurred + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class StatusEvent implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'StatusEvent'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'event_date_time' => 'string', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'event_date_time' => null, + 'message' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'event_date_time' => 'eventDateTime', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'event_date_time' => 'setEventDateTime', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'event_date_time' => 'getEventDateTime', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['event_date_time'] = $data['event_date_time'] ?? null; + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets event_date_time + * + * @return string|null + */ + public function getEventDateTime() + { + return $this->container['event_date_time']; + } + + /** + * Sets event_date_time + * + * @param string|null $event_date_time The date and time when the status event occured, displayed in the format YYYY-MM-DDThh:mm:ss + * + * @return self + */ + public function setEventDateTime($event_date_time) + { + $this->container['event_date_time'] = $event_date_time; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message A message describing the status event + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/SubmitDocumentData.php b/lib/Model/EInvoicing/V1/SubmitDocumentData.php new file mode 100644 index 0000000..a218141 --- /dev/null +++ b/lib/Model/EInvoicing/V1/SubmitDocumentData.php @@ -0,0 +1,334 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * SubmitDocumentData Class Doc Comment + * + * @category Class + * @description The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class SubmitDocumentData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubmitDocument_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return string|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param string|null $data The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/SubmitDocumentMetadata.php b/lib/Model/EInvoicing/V1/SubmitDocumentMetadata.php new file mode 100644 index 0000000..a9c692f --- /dev/null +++ b/lib/Model/EInvoicing/V1/SubmitDocumentMetadata.php @@ -0,0 +1,469 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * SubmitDocumentMetadata Class Doc Comment + * + * @category Class + * @description Key value pairs of metadata for a document submission. dataFormat can be ubl-invoice or ubl-creditnote: <br><pre>{ \"workflowId\": \"partner-einvoicing\", \"dataFormat\": \"ubl-invoice\", \"dataFormatVersion\": \"2.1\", \"countryCode\": \"SA\", \"countryMandate\": \"SA-Phase1-B2B\" }</pre> <br> + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class SubmitDocumentMetadata implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubmitDocument_metadata'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'workflow_id' => 'string', + 'data_format' => 'string', + 'data_format_version' => 'string', + 'country_code' => 'string', + 'country_mandate' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'workflow_id' => null, + 'data_format' => null, + 'data_format_version' => null, + 'country_code' => null, + 'country_mandate' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'workflow_id' => 'workflowId', + 'data_format' => 'dataFormat', + 'data_format_version' => 'dataFormatVersion', + 'country_code' => 'countryCode', + 'country_mandate' => 'countryMandate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'workflow_id' => 'setWorkflowId', + 'data_format' => 'setDataFormat', + 'data_format_version' => 'setDataFormatVersion', + 'country_code' => 'setCountryCode', + 'country_mandate' => 'setCountryMandate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'workflow_id' => 'getWorkflowId', + 'data_format' => 'getDataFormat', + 'data_format_version' => 'getDataFormatVersion', + 'country_code' => 'getCountryCode', + 'country_mandate' => 'getCountryMandate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['workflow_id'] = $data['workflow_id'] ?? null; + $this->container['data_format'] = $data['data_format'] ?? null; + $this->container['data_format_version'] = $data['data_format_version'] ?? null; + $this->container['country_code'] = $data['country_code'] ?? null; + $this->container['country_mandate'] = $data['country_mandate'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['workflow_id'] === null) { + $invalidProperties[] = "'workflow_id' can't be null"; + } + if ($this->container['data_format'] === null) { + $invalidProperties[] = "'data_format' can't be null"; + } + if ($this->container['data_format_version'] === null) { + $invalidProperties[] = "'data_format_version' can't be null"; + } + if ($this->container['country_code'] === null) { + $invalidProperties[] = "'country_code' can't be null"; + } + if ($this->container['country_mandate'] === null) { + $invalidProperties[] = "'country_mandate' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets workflow_id + * + * @return string + */ + public function getWorkflowId() + { + return $this->container['workflow_id']; + } + + /** + * Sets workflow_id + * + * @param string $workflow_id Specifies a unique ID for this workflow. + * + * @return self + */ + public function setWorkflowId($workflow_id) + { + $this->container['workflow_id'] = $workflow_id; + + return $this; + } + + /** + * Gets data_format + * + * @return string + */ + public function getDataFormat() + { + return $this->container['data_format']; + } + + /** + * Sets data_format + * + * @param string $data_format Specifies the data format for this workflow. + * + * @return self + */ + public function setDataFormat($data_format) + { + $this->container['data_format'] = $data_format; + + return $this; + } + + /** + * Gets data_format_version + * + * @return string + */ + public function getDataFormatVersion() + { + return $this->container['data_format_version']; + } + + /** + * Sets data_format_version + * + * @param string $data_format_version Specifies the data format version number. + * + * @return self + */ + public function setDataFormatVersion($data_format_version) + { + $this->container['data_format_version'] = $data_format_version; + + return $this; + } + + /** + * Gets country_code + * + * @return string + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string $country_code The two-letter ISO-3166 country code for the country where the e-invoice is being submitted + * + * @return self + */ + public function setCountryCode($country_code) + { + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets country_mandate + * + * @return string + */ + public function getCountryMandate() + { + return $this->container['country_mandate']; + } + + /** + * Sets country_mandate + * + * @param string $country_mandate The e-invoicing mandate for the specified country. + * + * @return self + */ + public function setCountryMandate($country_mandate) + { + $this->container['country_mandate'] = $country_mandate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/WorkflowIds.php b/lib/Model/EInvoicing/V1/WorkflowIds.php new file mode 100644 index 0000000..f1be32a --- /dev/null +++ b/lib/Model/EInvoicing/V1/WorkflowIds.php @@ -0,0 +1,364 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * WorkflowIds Class Doc Comment + * + * @category Class + * @description Workflow ID list + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class WorkflowIds implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WorkflowIds'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'description' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'description' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'description' => 'description' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'description' => 'setDescription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'description' => 'getDescription' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['description'] = $data['description'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of this workflow + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Workflow description + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php new file mode 100644 index 0000000..25ee7ef --- /dev/null +++ b/lib/Model/ModelInterface.php @@ -0,0 +1,108 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version 2.4.29 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model; + +/** + * Interface abstracting model access. + * + * @package Avalara\\SDK\Model\\AgeVerification + * @author OpenAPI Generator team + */ +interface ModelInterface +{ + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(); + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(); + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(); + + /** + * Array of attributes where the key is the local name, and the value is the original name + * + * @return array + */ + public static function attributeMap(); + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(); + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(); + + /** + * Show all the invalid properties with reasons. + * + * @return array + */ + public function listInvalidProperties(); + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool + */ + public function valid(); +} diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php new file mode 100644 index 0000000..762bd14 --- /dev/null +++ b/lib/ObjectSerializer.php @@ -0,0 +1,394 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +namespace Avalara\SDK; + +use Avalara\SDK\Model\ModelInterface; + +/** + * ObjectSerializer Class Doc Comment + * + * @category Class + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ObjectSerializer +{ + /** @var string */ + private static $dateTimeFormat = \DateTime::ATOM; + + /** + * Change the date format + * + * @param string $format the new date format to use + */ + public static function setDateTimeFormat($format) + { + self::$dateTimeFormat = $format; + } + + /** + * Serialize data + * + * @param mixed $data the data to serialize + * @param string $type the OpenAPIToolsType of the data + * @param string $format the format of the OpenAPITools type of the data + * + * @return scalar|object|array|null serialized form of $data + */ + public static function sanitizeForSerialization($data, $type = null, $format = null) + { + if (is_scalar($data) || null === $data) { + return $data; + } + + if ($data instanceof \DateTime) { + return ($format === 'date') ? $data->format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if ($value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + 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 + * + * @return string the serialized object + */ + public static function toQueryValue($object) + { + if (is_array($object)) { + return implode(',', $object); + } else { + return self::toString($object); + } + } + + /** + * 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 ISO8601 + * + * @param string $value a string which will be part of the header + * + * @return string the header string + */ + public static function toHeaderValue($value) + { + $callable = [$value, 'toHeaderValue']; + if (is_callable($callable)) { + return $callable(); + } + + 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 ISO8601 + * + * @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 ISO8601 + * If it's a boolean, convert it to "true" or "false". + * + * @param string|bool|\DateTime $value the value of the parameter + * + * @return string the header string + */ + public static function toString($value) + { + if ($value instanceof \DateTime) { // datetime in ISO8601 format + return $value->format(self::$dateTimeFormat); + } elseif (is_bool($value)) { + return $value ? 'true' : 'false'; + } else { + return $value; + } + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style 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, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // 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 ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + 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 a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $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; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } else if ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($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)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some API's return a date-time with too high nanosecond + // precision for php's DateTime to handle. This conversion + // (string -> unix timestamp -> DateTime) is a workaround + // for the problem. + return (new \DateTime())->setTimestamp(strtotime($data)); + } + } else { + return null; + } + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + if ($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(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + // 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 = '\Avalara\SDK\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/lib/TokenMetadata.php b/lib/TokenMetadata.php new file mode 100644 index 0000000..0d53388 --- /dev/null +++ b/lib/TokenMetadata.php @@ -0,0 +1,26 @@ +accessToken = $token; + $this->expiry = $expireTime; + + } +} +?> \ No newline at end of file diff --git a/lib/Utils/BaseLogger.php b/lib/Utils/BaseLogger.php new file mode 100644 index 0000000..7eb0d8d --- /dev/null +++ b/lib/Utils/BaseLogger.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/lib/Utils/LogObject.php b/lib/Utils/LogObject.php new file mode 100644 index 0000000..299700f --- /dev/null +++ b/lib/Utils/LogObject.php @@ -0,0 +1,72 @@ +logRequestAndResponse = $logRequestAndResponse; + } + + public function populateRequestInfo($request) + { + $this->startTime = microtime(true); + $this->timestamp = gmdate("Y/m/d H:i:s"); + $this->httpMethod = $request->getMethod(); + $this->requestURI = (string) $request->getUri(); + if($this->logRequestAndResponse) + { + $this->requestDetails = (string) $request->getBody(); + } + } + + public function populateResponseInfo($jsonBody, $response) + { + $this->populateCommonResponseInfo($response); + if($this->logRequestAndResponse) + { + $this->responseDetails = $jsonBody; + } + } + + public function populateErrorInfo($response) + { + $this->populateCommonResponseInfo($response); + $this->exceptionMessage = (string) $response->getBody(); + } + + public function populateErrorMessage($statusCode, $errorMessage) + { + $this->populateTotalExecutionTime(); + $this->statusCode = $errorMessage; + $this->exceptionMessage = $errorMessage; + } + + private function populateCommonResponseInfo($response) + { + $this->populateTotalExecutionTime(); + $this->headerCorrelationId = $response->getHeader('x-correlation-id')[0]; + $this->statusCode = $response->getStatusCode(); + } + + private function populateTotalExecutionTime() + { + $time_elapsed_secs = microtime(true) - $this->startTime; + $milliseconds = round($time_elapsed_secs * 1000); + $this->totalExecutionTime = $milliseconds; + } +} +?> \ No newline at end of file diff --git a/lib/Utils/LogOptions.php b/lib/Utils/LogOptions.php new file mode 100644 index 0000000..2b0ed96 --- /dev/null +++ b/lib/Utils/LogOptions.php @@ -0,0 +1,19 @@ +logRequestAndResponse = $logRequestAndResponse; + $this->logger = $logger; + } +} +?> \ No newline at end of file diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 0000000..9841a49 --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.3.0" + } +} diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..b34729d --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,19 @@ + + + + + ./lib\/API + ./lib\/Auth + ./lib\/Model + + + + + ./test/Auth + ./test/Integration + + + + + + \ No newline at end of file diff --git a/test/Auth/OAuthHelperTest.php b/test/Auth/OAuthHelperTest.php new file mode 100644 index 0000000..fb6524c --- /dev/null +++ b/test/Auth/OAuthHelperTest.php @@ -0,0 +1,43 @@ +load(); + $config = new \Avalara\SDK\Configuration(); + $config->setClientId(getenv('CLIENT_ID')); + $config->setClientSecret(getenv('CLIENT_SECRET')); + $config->appName='testApplication'; + $config->appVersion='2.1.2'; + $config->machineName='localhost'; + $config->environment='sandbox'; + + self::$config = $config; + } + + // public function testDeviceCodeFlow() + // { + // $result = \Avalara\SDK\Auth\OAuthHelper::initiateDeviceAuthorizationFlow('avatax_api', self::$config); + // $this->assertEquals($result->verificationUrl, 'https://ai-sbx.avlr.sh/device'); + // $tokenResult = \Avalara\SDK\Auth\OAuthHelper::getAccessTokenForDeviceFlow($result->deviceCode, self::$config); + // $this->assertEquals($tokenResult->errorMessage, 'authorization_pending'); + // $this->assertEquals($tokenResult->httpStatusCode, 400); + // } +} \ No newline at end of file diff --git a/test/Integration/DocumentsApiTest.php b/test/Integration/DocumentsApiTest.php new file mode 100644 index 0000000..73f903d --- /dev/null +++ b/test/Integration/DocumentsApiTest.php @@ -0,0 +1,71 @@ +load(); + $config = new \Avalara\SDK\Configuration(); + // Configure logger + $logger = new Logger('DocumentsLogger'); + $logger->pushHandler(new StreamHandler(__DIR__ . '/../../app.log', Logger::DEBUG)); + // Setup log options + $logOptions = new \Avalara\SDK\Utils\LogOptions(true, $logger); + $config->setBearerToken(getenv('BEARER_TOKEN')); + $config->appName='testApplication'; + $config->appVersion='2.1.2'; + $config->machineName='localhost'; + $config->environment='sandbox'; + $config->setLogOptions($logOptions); + + self::$client = new \Avalara\SDK\ApiClient($config); + } + + public function testGetDocumentsList() + { + $apiInstance = new \Avalara\SDK\API\EInvoicing\V1\DocumentsApi(self::$client); + + + $request_options = new \Avalara\SDK\API\EInvoicing\V1\GetDocumentListRequest(); + $request_options->setAvalaraVersion('1.0'); + + try { + $result=$apiInstance->getDocumentListAsync($request_options); + $result->then( + function($response) { + $this->assertNotNull($response); + print_r($response); + }, + function(\Exception $e){ + echo $e; + echo 'Exception : ', $e->getMessage(), PHP_EOL; + echo 'Exception Response Body: ', $e->getResponseBody(), PHP_EOL; + } + ); + // Tick the promise queue to trigger the callback + $result->wait(); + \GuzzleHttp\Promise\queue(); + } + catch (Exception $e) { + echo $e; + echo 'Exception : ', $e->getMessage(), PHP_EOL; + } + } +} \ No newline at end of file