diff --git a/.gitignore b/.gitignore index cb1a879..9f1681c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,15 @@ # ref: https://github.com/github/gitignore/blob/master/Composer.gitignore + composer.phar /vendor/ -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 +# composer.lock + +# php-cs-fixer cache +.php_cs.cache +.php-cs-fixer.cache -# Custom -build +# PHPUnit cache +.phpunit.result.cache diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..c647f6c --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,171 @@ +.gitignore +.php-cs-fixer.dist.php +.travis.yml +README.md +composer.json +docs/Api/PDFApi.md +docs/Model/AddFieldsData.md +docs/Model/AddFieldsTemplateResponse.md +docs/Model/AuthenticationError.md +docs/Model/AuthenticationSuccessResponse.md +docs/Model/CombinePdfsData.md +docs/Model/CombinedSubmission.md +docs/Model/CombinedSubmissionAction.md +docs/Model/CombinedSubmissionData.md +docs/Model/CopyTemplateData.md +docs/Model/CreateCombinedSubmissionResponse.md +docs/Model/CreateCustomFileData.md +docs/Model/CreateCustomFileResponse.md +docs/Model/CreateFolderAttributes.md +docs/Model/CreateFolderData.md +docs/Model/CreateHtmlTemplateData.md +docs/Model/CreateSubmissionBatchResponse.md +docs/Model/CreateSubmissionBatchSubmissionsResponse.md +docs/Model/CreateSubmissionData.md +docs/Model/CreateSubmissionDataRequestData.md +docs/Model/CreateSubmissionDataRequestTokenResponse.md +docs/Model/CreateSubmissionResponse.md +docs/Model/CreateTemplateFromUploadData.md +docs/Model/DataRequestToken.md +docs/Model/DeleteTemplateResponse.md +docs/Model/ErrorResponse.md +docs/Model/Folder.md +docs/Model/FullTemplate.md +docs/Model/HtmlTemplateData.md +docs/Model/InvalidRequest.md +docs/Model/ListSubmissionsResponse.md +docs/Model/MoveFolderData.md +docs/Model/MoveTemplateData.md +docs/Model/PendingTemplate.md +docs/Model/RenameFolderData.md +docs/Model/Submission.md +docs/Model/SubmissionAction.md +docs/Model/SubmissionBatch.md +docs/Model/SubmissionBatchData.md +docs/Model/SubmissionData.md +docs/Model/SubmissionDataBatchRequest.md +docs/Model/SubmissionDataRequest.md +docs/Model/Template.md +docs/Model/TemplateData.md +docs/Model/TemplateDefaults.md +docs/Model/TemplateDocument.md +docs/Model/TemplateDocumentMetadata.md +docs/Model/UpdateDataRequestResponse.md +docs/Model/UpdateSubmissionDataRequestData.md +docs/Model/UpdateTemplateData.md +docs/Model/UpdateTemplateResponse.md +docs/Model/UploadTemplateData.md +git_push.sh +lib/Api/PDFApi.php +lib/ApiException.php +lib/Client.php +lib/Configuration.php +lib/HeaderSelector.php +lib/Model/AddFieldsData.php +lib/Model/AddFieldsTemplateResponse.php +lib/Model/AuthenticationError.php +lib/Model/AuthenticationSuccessResponse.php +lib/Model/CombinePdfsData.php +lib/Model/CombinedSubmission.php +lib/Model/CombinedSubmissionAction.php +lib/Model/CombinedSubmissionData.php +lib/Model/CopyTemplateData.php +lib/Model/CreateCombinedSubmissionResponse.php +lib/Model/CreateCustomFileData.php +lib/Model/CreateCustomFileResponse.php +lib/Model/CreateFolderAttributes.php +lib/Model/CreateFolderData.php +lib/Model/CreateHtmlTemplateData.php +lib/Model/CreateSubmissionBatchResponse.php +lib/Model/CreateSubmissionBatchSubmissionsResponse.php +lib/Model/CreateSubmissionData.php +lib/Model/CreateSubmissionDataRequestData.php +lib/Model/CreateSubmissionDataRequestTokenResponse.php +lib/Model/CreateSubmissionResponse.php +lib/Model/CreateTemplateFromUploadData.php +lib/Model/DataRequestToken.php +lib/Model/DeleteTemplateResponse.php +lib/Model/ErrorResponse.php +lib/Model/Folder.php +lib/Model/FullTemplate.php +lib/Model/HtmlTemplateData.php +lib/Model/InvalidRequest.php +lib/Model/ListSubmissionsResponse.php +lib/Model/ModelInterface.php +lib/Model/MoveFolderData.php +lib/Model/MoveTemplateData.php +lib/Model/PendingTemplate.php +lib/Model/RenameFolderData.php +lib/Model/Submission.php +lib/Model/SubmissionAction.php +lib/Model/SubmissionBatch.php +lib/Model/SubmissionBatchData.php +lib/Model/SubmissionData.php +lib/Model/SubmissionDataBatchRequest.php +lib/Model/SubmissionDataRequest.php +lib/Model/Template.php +lib/Model/TemplateData.php +lib/Model/TemplateDefaults.php +lib/Model/TemplateDocument.php +lib/Model/TemplateDocumentMetadata.php +lib/Model/UpdateDataRequestResponse.php +lib/Model/UpdateSubmissionDataRequestData.php +lib/Model/UpdateTemplateData.php +lib/Model/UpdateTemplateResponse.php +lib/Model/UploadTemplateData.php +lib/ObjectSerializer.php +phpunit.xml.dist +test/Api/PDFApiIntegrationTest.php +test/Api/PDFApiTest.php +test/ClientIntegrationTest.php +test/Model/AddFieldsDataTest.php +test/Model/AddFieldsTemplateResponseTest.php +test/Model/AuthenticationErrorTest.php +test/Model/AuthenticationSuccessResponseTest.php +test/Model/CombinePdfsDataTest.php +test/Model/CombinedSubmissionActionTest.php +test/Model/CombinedSubmissionDataTest.php +test/Model/CombinedSubmissionTest.php +test/Model/CopyTemplateDataTest.php +test/Model/CreateCombinedSubmissionResponseTest.php +test/Model/CreateCustomFileDataTest.php +test/Model/CreateCustomFileResponseTest.php +test/Model/CreateFolderAttributesTest.php +test/Model/CreateFolderDataTest.php +test/Model/CreateHtmlTemplateDataTest.php +test/Model/CreateSubmissionBatchResponseTest.php +test/Model/CreateSubmissionBatchSubmissionsResponseTest.php +test/Model/CreateSubmissionDataRequestDataTest.php +test/Model/CreateSubmissionDataRequestTokenResponseTest.php +test/Model/CreateSubmissionDataTest.php +test/Model/CreateSubmissionResponseTest.php +test/Model/CreateTemplateFromUploadDataTest.php +test/Model/DataRequestTokenTest.php +test/Model/DeleteTemplateResponseTest.php +test/Model/ErrorResponseTest.php +test/Model/FolderTest.php +test/Model/FullTemplateTest.php +test/Model/HtmlTemplateDataTest.php +test/Model/InvalidRequestTest.php +test/Model/ListSubmissionsResponseTest.php +test/Model/MoveFolderDataTest.php +test/Model/MoveTemplateDataTest.php +test/Model/PendingTemplateTest.php +test/Model/RenameFolderDataTest.php +test/Model/SubmissionActionTest.php +test/Model/SubmissionBatchDataTest.php +test/Model/SubmissionBatchTest.php +test/Model/SubmissionDataBatchRequestTest.php +test/Model/SubmissionDataRequestTest.php +test/Model/SubmissionDataTest.php +test/Model/SubmissionTest.php +test/Model/TemplateDataTest.php +test/Model/TemplateDefaultsTest.php +test/Model/TemplateDocumentMetadataTest.php +test/Model/TemplateDocumentTest.php +test/Model/TemplateTest.php +test/Model/UpdateDataRequestResponseTest.php +test/Model/UpdateSubmissionDataRequestDataTest.php +test/Model/UpdateTemplateDataTest.php +test/Model/UpdateTemplateResponseTest.php +test/Model/UploadTemplateDataTest.php diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 0fa4ae4..3769235 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0 \ No newline at end of file +7.1.0 \ No newline at end of file diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..af9cf39 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,29 @@ +in(__DIR__) + ->exclude('vendor') + ->exclude('test') + ->exclude('tests') +; + +$config = new PhpCsFixer\Config(); +return $config->setRules([ + '@PSR12' => 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, + 'no_leading_import_slash' => false, + ]) + ->setFinder($finder) +; diff --git a/.travis.yml b/.travis.yml index d77f382..667b815 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,8 @@ language: php -sudo: false +# Bionic environment has preinstalled PHP from 7.1 to 7.4 +# https://docs.travis-ci.com/user/reference/bionic/#php-support +dist: bionic php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - hhvm + - 7.4 before_install: "composer install" script: "vendor/bin/phpunit" diff --git a/CHANGELOG.md b/CHANGELOG.md index f3c64b6..0944be9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### 2.0.0 [December 19, 2023] + +- Updated OpenAPI Generator to 7.1 for this client update. +- Guzzle 7.8.1 is now used by the client. +- The API has changed from SubmissionData() to CreateSubmissionData() etc. + ### 1.3.2 [November 28, 2021] - Added 'password' parameter to Generate PDF and Combine PDF API endpoints. You can now encrypt each generated PDF with a unique password. diff --git a/README.md b/README.md index 3854594..8713895 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,24 @@ # DocSpring + DocSpring is a service that helps you fill out and sign PDF templates. -This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: v1 -- Package version: 1.3.2 -- Build package: com.docspring.codegen.DocSpringPhpClientCodegen +## Installation & Usage -## Requirements +### Requirements -PHP 5.5 and later +PHP 7.4 and later. +Should also work with PHP 8.0. -## Installation & Usage ### Composer -To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`: +To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`: -``` +```json { "repositories": [ { - "type": "git", + "type": "vcs", "url": "https://github.com/docspring/docspring.git" } ], @@ -37,16 +35,8 @@ Then run `composer install` Download the files and include `autoload.php`: ```php - require_once('/path/to/DocSpring/vendor/autoload.php'); -``` - -## Tests - -To run the unit tests: - -``` -composer install -./vendor/bin/phpunit +setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); + ->setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + $apiInstance = new DocSpring\Api\PDFApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -68,20 +61,19 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$template_id = tpl_000000000000000002; // string | -$add_fields_data = new \DocSpring\Model\AddFieldsData(); // \DocSpring\Model\AddFieldsData | +$template_id = tpl_000000000000000002; // string +$data = new \DocSpring\Model\AddFieldsData(); // \DocSpring\Model\AddFieldsData try { - $result = $apiInstance->addFieldsToTemplate($template_id, $add_fields_data); + $result = $apiInstance->addFieldsToTemplate($template_id, $data); print_r($result); } catch (Exception $e) { echo 'Exception when calling PDFApi->addFieldsToTemplate: ', $e->getMessage(), PHP_EOL; } -?> ``` -## Documentation for API Endpoints +## API Endpoints All URIs are relative to *https://api.docspring.com/api/v1* @@ -100,6 +92,7 @@ Class | Method | HTTP request | Description *PDFApi* | [**createPDFTemplate**](docs/Api/PDFApi.md#createpdftemplate) | **POST** /templates | Create a new PDF template with a form POST file upload *PDFApi* | [**createPDFTemplateFromUpload**](docs/Api/PDFApi.md#createpdftemplatefromupload) | **POST** /templates?desc=cached_upload | Create a new PDF template from a cached presign upload *PDFApi* | [**deleteFolder**](docs/Api/PDFApi.md#deletefolder) | **DELETE** /folders/{folder_id} | Delete a folder +*PDFApi* | [**deleteTemplate**](docs/Api/PDFApi.md#deletetemplate) | **DELETE** /templates/{template_id} | Delete a template *PDFApi* | [**expireCombinedSubmission**](docs/Api/PDFApi.md#expirecombinedsubmission) | **DELETE** /combined_submissions/{combined_submission_id} | Expire a combined submission *PDFApi* | [**expireSubmission**](docs/Api/PDFApi.md#expiresubmission) | **DELETE** /submissions/{submission_id} | Expire a PDF submission *PDFApi* | [**generatePDF**](docs/Api/PDFApi.md#generatepdf) | **POST** /templates/{template_id}/submissions | Generates a new PDF @@ -111,9 +104,10 @@ Class | Method | HTTP request | Description *PDFApi* | [**getSubmissionBatch**](docs/Api/PDFApi.md#getsubmissionbatch) | **GET** /submissions/batches/{submission_batch_id} | Check the status of a submission batch job *PDFApi* | [**getTemplate**](docs/Api/PDFApi.md#gettemplate) | **GET** /templates/{template_id} | Check the status of an uploaded template *PDFApi* | [**getTemplateSchema**](docs/Api/PDFApi.md#gettemplateschema) | **GET** /templates/{template_id}/schema | Fetch the JSON schema for a template +*PDFApi* | [**listCombinedSubmissions**](docs/Api/PDFApi.md#listcombinedsubmissions) | **GET** /combined_submissions | Get a list of all combined submissions *PDFApi* | [**listFolders**](docs/Api/PDFApi.md#listfolders) | **GET** /folders/ | Get a list of all folders *PDFApi* | [**listSubmissions**](docs/Api/PDFApi.md#listsubmissions) | **GET** /submissions | List all submissions -*PDFApi* | [**listSubmissions_0**](docs/Api/PDFApi.md#listsubmissions_0) | **GET** /templates/{template_id}/submissions | List all submissions for a given template +*PDFApi* | [**listTemplateSubmissions**](docs/Api/PDFApi.md#listtemplatesubmissions) | **GET** /templates/{template_id}/submissions | List all submissions for a given template *PDFApi* | [**listTemplates**](docs/Api/PDFApi.md#listtemplates) | **GET** /templates | Get a list of all templates *PDFApi* | [**moveFolderToFolder**](docs/Api/PDFApi.md#movefoldertofolder) | **POST** /folders/{folder_id}/move | Move a folder *PDFApi* | [**moveTemplateToFolder**](docs/Api/PDFApi.md#movetemplatetofolder) | **POST** /templates/{template_id}/move | Move Template to folder @@ -122,72 +116,84 @@ Class | Method | HTTP request | Description *PDFApi* | [**updateDataRequest**](docs/Api/PDFApi.md#updatedatarequest) | **PUT** /data_requests/{data_request_id} | Update a submission data request *PDFApi* | [**updateTemplate**](docs/Api/PDFApi.md#updatetemplate) | **PUT** /templates/{template_id} | Update a Template - -## Documentation For Models - - - [AddFieldsData](docs/Model/AddFieldsData.md) - - [AddFieldsTemplateResponse](docs/Model/AddFieldsTemplateResponse.md) - - [AuthenticationError](docs/Model/AuthenticationError.md) - - [AuthenticationSuccessResponse](docs/Model/AuthenticationSuccessResponse.md) - - [CombinePdfsData](docs/Model/CombinePdfsData.md) - - [CombinedSubmission](docs/Model/CombinedSubmission.md) - - [CombinedSubmissionAction](docs/Model/CombinedSubmissionAction.md) - - [CombinedSubmissionData](docs/Model/CombinedSubmissionData.md) - - [CopyTemplateData](docs/Model/CopyTemplateData.md) - - [CreateCombinedSubmissionResponse](docs/Model/CreateCombinedSubmissionResponse.md) - - [CreateCustomFileData](docs/Model/CreateCustomFileData.md) - - [CreateCustomFileResponse](docs/Model/CreateCustomFileResponse.md) - - [CreateFolderData](docs/Model/CreateFolderData.md) - - [CreateHtmlTemplateData](docs/Model/CreateHtmlTemplateData.md) - - [CreateSubmissionBatchResponse](docs/Model/CreateSubmissionBatchResponse.md) - - [CreateSubmissionBatchSubmissionsResponse](docs/Model/CreateSubmissionBatchSubmissionsResponse.md) - - [CreateSubmissionDataRequestData](docs/Model/CreateSubmissionDataRequestData.md) - - [CreateSubmissionDataRequestTokenResponse](docs/Model/CreateSubmissionDataRequestTokenResponse.md) - - [CreateSubmissionDataRequestTokenResponseToken](docs/Model/CreateSubmissionDataRequestTokenResponseToken.md) - - [CreateSubmissionResponse](docs/Model/CreateSubmissionResponse.md) - - [CreateTemplateFromUploadData](docs/Model/CreateTemplateFromUploadData.md) - - [CustomFile](docs/Model/CustomFile.md) - - [Error](docs/Model/Error.md) - - [Folder](docs/Model/Folder.md) - - [FoldersFolder](docs/Model/FoldersFolder.md) - - [FullTemplate](docs/Model/FullTemplate.md) - - [FullTemplateDefaults](docs/Model/FullTemplateDefaults.md) - - [HtmlTemplateData](docs/Model/HtmlTemplateData.md) - - [InvalidRequest](docs/Model/InvalidRequest.md) - - [ListSubmissionsResponse](docs/Model/ListSubmissionsResponse.md) - - [MoveFolderData](docs/Model/MoveFolderData.md) - - [MoveTemplateData](docs/Model/MoveTemplateData.md) - - [PendingTemplate](docs/Model/PendingTemplate.md) - - [RenameFolderData](docs/Model/RenameFolderData.md) - - [Submission](docs/Model/Submission.md) - - [SubmissionAction](docs/Model/SubmissionAction.md) - - [SubmissionBatch](docs/Model/SubmissionBatch.md) - - [SubmissionBatchData](docs/Model/SubmissionBatchData.md) - - [SubmissionData](docs/Model/SubmissionData.md) - - [SubmissionDataBatchRequest](docs/Model/SubmissionDataBatchRequest.md) - - [SubmissionDataRequest](docs/Model/SubmissionDataRequest.md) - - [Template](docs/Model/Template.md) - - [TemplateData](docs/Model/TemplateData.md) - - [TemplatestemplateIdaddFieldsFields](docs/Model/TemplatestemplateIdaddFieldsFields.md) - - [UpdateDataRequestResponse](docs/Model/UpdateDataRequestResponse.md) - - [UpdateSubmissionDataRequestData](docs/Model/UpdateSubmissionDataRequestData.md) - - [UpdateTemplateData](docs/Model/UpdateTemplateData.md) - - [UpdateTemplateResponse](docs/Model/UpdateTemplateResponse.md) - - [UploadTemplateData](docs/Model/UploadTemplateData.md) - - [UploadTemplateDataDocument](docs/Model/UploadTemplateDataDocument.md) - - [UploadTemplateDataDocumentMetadata](docs/Model/UploadTemplateDataDocumentMetadata.md) - - -## Documentation For Authorization - - -## api_token_basic +## Models + +- [AddFieldsData](docs/Model/AddFieldsData.md) +- [AddFieldsTemplateResponse](docs/Model/AddFieldsTemplateResponse.md) +- [AuthenticationError](docs/Model/AuthenticationError.md) +- [AuthenticationSuccessResponse](docs/Model/AuthenticationSuccessResponse.md) +- [CombinePdfsData](docs/Model/CombinePdfsData.md) +- [CombinedSubmission](docs/Model/CombinedSubmission.md) +- [CombinedSubmissionAction](docs/Model/CombinedSubmissionAction.md) +- [CombinedSubmissionData](docs/Model/CombinedSubmissionData.md) +- [CopyTemplateData](docs/Model/CopyTemplateData.md) +- [CreateCombinedSubmissionResponse](docs/Model/CreateCombinedSubmissionResponse.md) +- [CreateCustomFileData](docs/Model/CreateCustomFileData.md) +- [CreateCustomFileResponse](docs/Model/CreateCustomFileResponse.md) +- [CreateFolderAttributes](docs/Model/CreateFolderAttributes.md) +- [CreateFolderData](docs/Model/CreateFolderData.md) +- [CreateHtmlTemplateData](docs/Model/CreateHtmlTemplateData.md) +- [CreateSubmissionBatchResponse](docs/Model/CreateSubmissionBatchResponse.md) +- [CreateSubmissionBatchSubmissionsResponse](docs/Model/CreateSubmissionBatchSubmissionsResponse.md) +- [CreateSubmissionData](docs/Model/CreateSubmissionData.md) +- [CreateSubmissionDataRequestData](docs/Model/CreateSubmissionDataRequestData.md) +- [CreateSubmissionDataRequestTokenResponse](docs/Model/CreateSubmissionDataRequestTokenResponse.md) +- [CreateSubmissionResponse](docs/Model/CreateSubmissionResponse.md) +- [CreateTemplateFromUploadData](docs/Model/CreateTemplateFromUploadData.md) +- [DataRequestToken](docs/Model/DataRequestToken.md) +- [DeleteTemplateResponse](docs/Model/DeleteTemplateResponse.md) +- [ErrorResponse](docs/Model/ErrorResponse.md) +- [Folder](docs/Model/Folder.md) +- [FullTemplate](docs/Model/FullTemplate.md) +- [HtmlTemplateData](docs/Model/HtmlTemplateData.md) +- [InvalidRequest](docs/Model/InvalidRequest.md) +- [ListSubmissionsResponse](docs/Model/ListSubmissionsResponse.md) +- [MoveFolderData](docs/Model/MoveFolderData.md) +- [MoveTemplateData](docs/Model/MoveTemplateData.md) +- [PendingTemplate](docs/Model/PendingTemplate.md) +- [RenameFolderData](docs/Model/RenameFolderData.md) +- [Submission](docs/Model/Submission.md) +- [SubmissionAction](docs/Model/SubmissionAction.md) +- [SubmissionBatch](docs/Model/SubmissionBatch.md) +- [SubmissionBatchData](docs/Model/SubmissionBatchData.md) +- [SubmissionData](docs/Model/SubmissionData.md) +- [SubmissionDataBatchRequest](docs/Model/SubmissionDataBatchRequest.md) +- [SubmissionDataRequest](docs/Model/SubmissionDataRequest.md) +- [Template](docs/Model/Template.md) +- [TemplateData](docs/Model/TemplateData.md) +- [TemplateDefaults](docs/Model/TemplateDefaults.md) +- [TemplateDocument](docs/Model/TemplateDocument.md) +- [TemplateDocumentMetadata](docs/Model/TemplateDocumentMetadata.md) +- [UpdateDataRequestResponse](docs/Model/UpdateDataRequestResponse.md) +- [UpdateSubmissionDataRequestData](docs/Model/UpdateSubmissionDataRequestData.md) +- [UpdateTemplateData](docs/Model/UpdateTemplateData.md) +- [UpdateTemplateResponse](docs/Model/UpdateTemplateResponse.md) +- [UploadTemplateData](docs/Model/UploadTemplateData.md) + +## Authorization + +Authentication schemes defined for the API: +### api_token_basic - **Type**: HTTP basic authentication +## Tests + +To run the tests, use: + +```bash +composer install +vendor/bin/phpunit +``` ## Author +## About this package + +This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: +- API version: `v1` + - Package version: `2.0.0` +- Build package: `com.docspring.codegen.DocSpringPhpClientCodegen` diff --git a/composer.json b/composer.json index 2e87285..cb9f033 100644 --- a/composer.json +++ b/composer.json @@ -1,39 +1,40 @@ { "name": "docspring/docspring", - "version": "1.3.2", - "description": "", + "version": "2.0.0", + "description": "DocSpring is a service that helps you fill out and sign PDF templates.", "keywords": [ "openapitools", "openapi-generator", + "openapi", "php", "sdk", "rest", "api" ], - "homepage": "http://openapi-generator.tech", - "license": "proprietary", + "homepage": "https://openapi-generator.tech", + "license": "unlicense", "authors": [ { - "name": "OpenAPI-Generator contributors", + "name": "OpenAPI", "homepage": "https://openapi-generator.tech" } ], "require": { - "php": ">=5.6", + "php": "^7.4 || ^8.0", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "guzzlehttp/guzzle": "^6.2" + "guzzlehttp/guzzle": "^7.3", + "guzzlehttp/psr7": "^1.7 || ^2.0" }, "require-dev": { - "phpunit/phpunit": "^4.8", - "squizlabs/php_codesniffer": "~2.6", - "friendsofphp/php-cs-fixer": "~2.12" + "phpunit/phpunit": "^8.0 || ^9.0", + "friendsofphp/php-cs-fixer": "^3.5" }, "autoload": { "psr-4": { "DocSpring\\" : "lib/" } }, "autoload-dev": { - "psr-4": { "DocSpring\\" : "test/" } + "psr-4": { "DocSpring\\Test\\" : "test/" } } } diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..681b438 --- /dev/null +++ b/composer.lock @@ -0,0 +1,4041 @@ +{ + "_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": "aa662f306f0dcda993f2aa76109e9983", + "packages": [ + { + "name": "guzzlehttp/guzzle", + "version": "7.8.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", + "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", + "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.2", + "ext-curl": "*", + "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.36 || ^9.6.15", + "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 + } + }, + "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.8.1" + }, + "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": "2023-12-03T20:35:24+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", + "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.36 || ^9.6.15" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "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/2.0.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": "2023-12-03T20:19:20+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.6.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", + "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.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.2", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.36 || ^9.6.15" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "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.6.2" + }, + "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": "2023-12-03T20:05:35+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.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": "https://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" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "e616d01114759c4c489f93b099585439f795fe35" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", + "reference": "e616d01114759c4c489f93b099585439f795fe35", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0 || ^2.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": "https://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/1.0.2" + }, + "time": "2023-04-10T20:10:41+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://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/2.0" + }, + "time": "2023-04-04T09:54:51+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.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-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.4.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": "2023-05-23T14:45:45+00:00" + } + ], + "packages-dev": [ + { + "name": "composer/pcre", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9", + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.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/3.1.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": "2023-10-11T07:11:09+00:00" + }, + { + "name": "composer/semver", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "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": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.0" + }, + "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": "2023-08-31T09:50:34+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "ced299686f41dce890debac69273b47ffe98a40c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^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/3.0.3" + }, + "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-25T21:32:43+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^11", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" + }, + "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/2.0.0" + }, + "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-12-30T00:23:10+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.41.1", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "8b6ae8dcbaf23f09680643ab832a4a3a260265f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/8b6ae8dcbaf23f09680643ab832a4a3a260265f6", + "reference": "8b6ae8dcbaf23f09680643ab832a4a3a260265f6", + "shasum": "" + }, + "require": { + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0", + "sebastian/diff": "^4.0 || ^5.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.28", + "symfony/polyfill-php80": "^1.28", + "symfony/polyfill-php81": "^1.28", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3 || ^2.0", + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.11", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", + "phpunit/phpunit": "^9.6", + "symfony/phpunit-bridge": "^6.3.8 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + } + }, + "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", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.41.1" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2023-12-10T19:59:27+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "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.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2023-03-08T13:26:56+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.18.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "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.18.0" + }, + "time": "2023-12-10T21:03:43+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": "phpunit/php-code-coverage", + "version": "9.2.29", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76", + "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.15", + "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": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "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", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-09-19T04:57:46+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.6.15", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/05017b80304e0eb3f31d90194a563fd53a6021f1", + "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1 || ^2", + "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.28", + "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": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.6-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", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.15" + }, + "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": "2023-12-01T16:55:19+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "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/2.0.2" + }, + "time": "2021-11-05T16:47:00+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": "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": "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.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "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.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-05-07T05:35:17+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "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.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+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.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bde739e7565280bda77be70044ac1047bc007e34" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", + "reference": "bde739e7565280bda77be70044ac1047bc007e34", + "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.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-02T09:26:13+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.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "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": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:07:39+00:00" + }, + { + "name": "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.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "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.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:13: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": "v7.0.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "cdce5c684b2f920bb1343deecdfba356ffad83d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/cdce5c684b2f920bb1343deecdfba356ffad83d5", + "reference": "cdce5c684b2f920bb1343deecdfba356ffad83d5", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^6.4|^7.0" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" + }, + "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/v7.0.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": "2023-12-01T15:10:06+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "c459b40ffe67c49af6fd392aac374c9edf8a027e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/c459b40ffe67c49af6fd392aac374c9edf8a027e", + "reference": "c459b40ffe67c49af6fd392aac374c9edf8a027e", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0" + }, + "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/v7.0.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": "2023-07-27T16:29:09+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df", + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-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.4.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": "2023-05-23T14:45:45+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/7da8ea2362a283771478c5f7729cfcb43a76b8b7", + "reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "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/v7.0.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": "2023-07-27T06:33:22+00:00" + }, + { + "name": "symfony/finder", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "6e5688d69f7cfc4ed4a511e96007e06c2d34ce56" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/6e5688d69f7cfc4ed4a511e96007e06c2d34ce56", + "reference": "6e5688d69f7cfc4ed4a511e96007e06c2d34ce56", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "symfony/filesystem": "^6.4|^7.0" + }, + "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/v7.0.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": "2023-10-31T17:59:56+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "700ff4096e346f54cb628ea650767c8130f1001f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/700ff4096e346f54cb628ea650767c8130f1001f", + "reference": "700ff4096e346f54cb628ea650767c8130f1001f", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "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/v7.0.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": "2023-08-08T10:20:21+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-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.28.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": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "875e90aeea2777b6f135677f618529449334a612" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-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.28.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": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-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.28.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": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "42292d99c55abe617799667f454222c54c60e229" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-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.28.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": "2023-07-28T09:04:16+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-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.28.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": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "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 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.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": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/process", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "13bdb1670c7f510494e04fcb2bfa29af63db9c0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/13bdb1670c7f510494e04fcb2bfa29af63db9c0d", + "reference": "13bdb1670c7f510494e04fcb2bfa29af63db9c0d", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "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/v7.0.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": "2023-11-20T16:43:42+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/b3313c2dbffaf71c8de2934e2ea56ed2291a3838", + "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "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/v3.4.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": "2023-07-30T20:28:31+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a", + "reference": "7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^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/v7.0.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": "2023-07-05T13:06:06+00:00" + }, + { + "name": "symfony/string", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "92bd2bfbba476d4a1838e5e12168bef2fd1e6620" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/92bd2bfbba476d4a1838e5e12168bef2fd1e6620", + "reference": "92bd2bfbba476d4a1838e5e12168bef2fd1e6620", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.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/v7.0.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": "2023-11-29T08:40:23+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "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.2" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2023-11-20T00:12:19+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^7.4 || ^8.0", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*" + }, + "platform-dev": [], + "plugin-api-version": "2.6.0" +} diff --git a/docs/Api/PDFApi.md b/docs/Api/PDFApi.md index 3588206..698f61e 100644 --- a/docs/Api/PDFApi.md +++ b/docs/Api/PDFApi.md @@ -1,55 +1,62 @@ # DocSpring\PDFApi -All URIs are relative to *https://api.docspring.com/api/v1* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addFieldsToTemplate**](PDFApi.md#addFieldsToTemplate) | **PUT** /templates/{template_id}/add_fields | Add new fields to a Template -[**batchGeneratePdfV1**](PDFApi.md#batchGeneratePdfV1) | **POST** /templates/{template_id}/submissions/batch | Generates multiple PDFs -[**batchGeneratePdfs**](PDFApi.md#batchGeneratePdfs) | **POST** /submissions/batches | Generates multiple PDFs -[**combinePdfs**](PDFApi.md#combinePdfs) | **POST** /combined_submissions?v=2 | Merge submission PDFs, template PDFs, or custom files -[**combineSubmissions**](PDFApi.md#combineSubmissions) | **POST** /combined_submissions | Merge generated PDFs together -[**copyTemplate**](PDFApi.md#copyTemplate) | **POST** /templates/{template_id}/copy | Copy a Template -[**createCustomFileFromUpload**](PDFApi.md#createCustomFileFromUpload) | **POST** /custom_files | Create a new custom file from a cached presign upload -[**createDataRequestToken**](PDFApi.md#createDataRequestToken) | **POST** /data_requests/{data_request_id}/tokens | Creates a new data request token for form authentication -[**createFolder**](PDFApi.md#createFolder) | **POST** /folders/ | Create a folder -[**createHTMLTemplate**](PDFApi.md#createHTMLTemplate) | **POST** /templates?desc=html | Create a new HTML template -[**createPDFTemplate**](PDFApi.md#createPDFTemplate) | **POST** /templates | Create a new PDF template with a form POST file upload -[**createPDFTemplateFromUpload**](PDFApi.md#createPDFTemplateFromUpload) | **POST** /templates?desc=cached_upload | Create a new PDF template from a cached presign upload -[**deleteFolder**](PDFApi.md#deleteFolder) | **DELETE** /folders/{folder_id} | Delete a folder -[**expireCombinedSubmission**](PDFApi.md#expireCombinedSubmission) | **DELETE** /combined_submissions/{combined_submission_id} | Expire a combined submission -[**expireSubmission**](PDFApi.md#expireSubmission) | **DELETE** /submissions/{submission_id} | Expire a PDF submission -[**generatePDF**](PDFApi.md#generatePDF) | **POST** /templates/{template_id}/submissions | Generates a new PDF -[**getCombinedSubmission**](PDFApi.md#getCombinedSubmission) | **GET** /combined_submissions/{combined_submission_id} | Check the status of a combined submission (merged PDFs) -[**getDataRequest**](PDFApi.md#getDataRequest) | **GET** /data_requests/{data_request_id} | Look up a submission data request -[**getFullTemplate**](PDFApi.md#getFullTemplate) | **GET** /templates/{template_id}?full=true | Fetch the full template attributes -[**getPresignUrl**](PDFApi.md#getPresignUrl) | **GET** /uploads/presign | Get a presigned URL so that you can upload a file to our AWS S3 bucket -[**getSubmission**](PDFApi.md#getSubmission) | **GET** /submissions/{submission_id} | Check the status of a PDF -[**getSubmissionBatch**](PDFApi.md#getSubmissionBatch) | **GET** /submissions/batches/{submission_batch_id} | Check the status of a submission batch job -[**getTemplate**](PDFApi.md#getTemplate) | **GET** /templates/{template_id} | Check the status of an uploaded template -[**getTemplateSchema**](PDFApi.md#getTemplateSchema) | **GET** /templates/{template_id}/schema | Fetch the JSON schema for a template -[**listFolders**](PDFApi.md#listFolders) | **GET** /folders/ | Get a list of all folders -[**listSubmissions**](PDFApi.md#listSubmissions) | **GET** /submissions | List all submissions -[**listSubmissions_0**](PDFApi.md#listSubmissions_0) | **GET** /templates/{template_id}/submissions | List all submissions for a given template -[**listTemplates**](PDFApi.md#listTemplates) | **GET** /templates | Get a list of all templates -[**moveFolderToFolder**](PDFApi.md#moveFolderToFolder) | **POST** /folders/{folder_id}/move | Move a folder -[**moveTemplateToFolder**](PDFApi.md#moveTemplateToFolder) | **POST** /templates/{template_id}/move | Move Template to folder -[**renameFolder**](PDFApi.md#renameFolder) | **POST** /folders/{folder_id}/rename | Rename a folder -[**testAuthentication**](PDFApi.md#testAuthentication) | **GET** /authentication | Test Authentication -[**updateDataRequest**](PDFApi.md#updateDataRequest) | **PUT** /data_requests/{data_request_id} | Update a submission data request -[**updateTemplate**](PDFApi.md#updateTemplate) | **PUT** /templates/{template_id} | Update a Template - - -# **addFieldsToTemplate** -> \DocSpring\Model\AddFieldsTemplateResponse addFieldsToTemplate($template_id, $add_fields_data) +All URIs are relative to https://api.docspring.com/api/v1, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**addFieldsToTemplate()**](PDFApi.md#addFieldsToTemplate) | **PUT** /templates/{template_id}/add_fields | Add new fields to a Template | +| [**batchGeneratePdfV1()**](PDFApi.md#batchGeneratePdfV1) | **POST** /templates/{template_id}/submissions/batch | Generates multiple PDFs | +| [**batchGeneratePdfs()**](PDFApi.md#batchGeneratePdfs) | **POST** /submissions/batches | Generates multiple PDFs | +| [**combinePdfs()**](PDFApi.md#combinePdfs) | **POST** /combined_submissions?v=2 | Merge submission PDFs, template PDFs, or custom files | +| [**combineSubmissions()**](PDFApi.md#combineSubmissions) | **POST** /combined_submissions | Merge generated PDFs together | +| [**copyTemplate()**](PDFApi.md#copyTemplate) | **POST** /templates/{template_id}/copy | Copy a Template | +| [**createCustomFileFromUpload()**](PDFApi.md#createCustomFileFromUpload) | **POST** /custom_files | Create a new custom file from a cached presign upload | +| [**createDataRequestToken()**](PDFApi.md#createDataRequestToken) | **POST** /data_requests/{data_request_id}/tokens | Creates a new data request token for form authentication | +| [**createFolder()**](PDFApi.md#createFolder) | **POST** /folders/ | Create a folder | +| [**createHTMLTemplate()**](PDFApi.md#createHTMLTemplate) | **POST** /templates?desc=html | Create a new HTML template | +| [**createPDFTemplate()**](PDFApi.md#createPDFTemplate) | **POST** /templates | Create a new PDF template with a form POST file upload | +| [**createPDFTemplateFromUpload()**](PDFApi.md#createPDFTemplateFromUpload) | **POST** /templates?desc=cached_upload | Create a new PDF template from a cached presign upload | +| [**deleteFolder()**](PDFApi.md#deleteFolder) | **DELETE** /folders/{folder_id} | Delete a folder | +| [**deleteTemplate()**](PDFApi.md#deleteTemplate) | **DELETE** /templates/{template_id} | Delete a template | +| [**expireCombinedSubmission()**](PDFApi.md#expireCombinedSubmission) | **DELETE** /combined_submissions/{combined_submission_id} | Expire a combined submission | +| [**expireSubmission()**](PDFApi.md#expireSubmission) | **DELETE** /submissions/{submission_id} | Expire a PDF submission | +| [**generatePDF()**](PDFApi.md#generatePDF) | **POST** /templates/{template_id}/submissions | Generates a new PDF | +| [**getCombinedSubmission()**](PDFApi.md#getCombinedSubmission) | **GET** /combined_submissions/{combined_submission_id} | Check the status of a combined submission (merged PDFs) | +| [**getDataRequest()**](PDFApi.md#getDataRequest) | **GET** /data_requests/{data_request_id} | Look up a submission data request | +| [**getFullTemplate()**](PDFApi.md#getFullTemplate) | **GET** /templates/{template_id}?full=true | Fetch the full template attributes | +| [**getPresignUrl()**](PDFApi.md#getPresignUrl) | **GET** /uploads/presign | Get a presigned URL so that you can upload a file to our AWS S3 bucket | +| [**getSubmission()**](PDFApi.md#getSubmission) | **GET** /submissions/{submission_id} | Check the status of a PDF | +| [**getSubmissionBatch()**](PDFApi.md#getSubmissionBatch) | **GET** /submissions/batches/{submission_batch_id} | Check the status of a submission batch job | +| [**getTemplate()**](PDFApi.md#getTemplate) | **GET** /templates/{template_id} | Check the status of an uploaded template | +| [**getTemplateSchema()**](PDFApi.md#getTemplateSchema) | **GET** /templates/{template_id}/schema | Fetch the JSON schema for a template | +| [**listCombinedSubmissions()**](PDFApi.md#listCombinedSubmissions) | **GET** /combined_submissions | Get a list of all combined submissions | +| [**listFolders()**](PDFApi.md#listFolders) | **GET** /folders/ | Get a list of all folders | +| [**listSubmissions()**](PDFApi.md#listSubmissions) | **GET** /submissions | List all submissions | +| [**listTemplateSubmissions()**](PDFApi.md#listTemplateSubmissions) | **GET** /templates/{template_id}/submissions | List all submissions for a given template | +| [**listTemplates()**](PDFApi.md#listTemplates) | **GET** /templates | Get a list of all templates | +| [**moveFolderToFolder()**](PDFApi.md#moveFolderToFolder) | **POST** /folders/{folder_id}/move | Move a folder | +| [**moveTemplateToFolder()**](PDFApi.md#moveTemplateToFolder) | **POST** /templates/{template_id}/move | Move Template to folder | +| [**renameFolder()**](PDFApi.md#renameFolder) | **POST** /folders/{folder_id}/rename | Rename a folder | +| [**testAuthentication()**](PDFApi.md#testAuthentication) | **GET** /authentication | Test Authentication | +| [**updateDataRequest()**](PDFApi.md#updateDataRequest) | **PUT** /data_requests/{data_request_id} | Update a submission data request | +| [**updateTemplate()**](PDFApi.md#updateTemplate) | **PUT** /templates/{template_id} | Update a Template | + + +## `addFieldsToTemplate()` + +```php +addFieldsToTemplate($template_id, $data): \DocSpring\Model\AddFieldsTemplateResponse +``` Add new fields to a Template ### Example + ```php setUsername('YOUR_USERNAME') @@ -62,24 +69,23 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$template_id = tpl_000000000000000002; // string | -$add_fields_data = new \DocSpring\Model\AddFieldsData(); // \DocSpring\Model\AddFieldsData | +$template_id = tpl_000000000000000002; // string +$data = new \DocSpring\Model\AddFieldsData(); // \DocSpring\Model\AddFieldsData try { - $result = $apiInstance->addFieldsToTemplate($template_id, $add_fields_data); + $result = $apiInstance->addFieldsToTemplate($template_id, $data); print_r($result); } catch (Exception $e) { echo 'Exception when calling PDFApi->addFieldsToTemplate: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **template_id** | **string**| | - **add_fields_data** | [**\DocSpring\Model\AddFieldsData**](../Model/AddFieldsData.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **template_id** | **string**| | | +| **data** | [**\DocSpring\Model\AddFieldsData**](../Model/AddFieldsData.md)| | | ### Return type @@ -91,21 +97,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **batchGeneratePdfV1** -> \DocSpring\Model\CreateSubmissionResponse[] batchGeneratePdfV1($template_id, $request_body) +## `batchGeneratePdfV1()` + +```php +batchGeneratePdfV1($template_id, $data): \DocSpring\Model\CreateSubmissionResponse[] +``` Generates multiple PDFs ### Example + ```php setUsername('YOUR_USERNAME') @@ -118,24 +131,23 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$template_id = tpl_000000000000000001; // string | -$request_body = array(new \DocSpring\Model\array()); // object[] | +$template_id = tpl_000000000000000001; // string +$data = array(new \DocSpring\Model\SubmissionData()); // \DocSpring\Model\SubmissionData[] try { - $result = $apiInstance->batchGeneratePdfV1($template_id, $request_body); + $result = $apiInstance->batchGeneratePdfV1($template_id, $data); print_r($result); } catch (Exception $e) { echo 'Exception when calling PDFApi->batchGeneratePdfV1: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **template_id** | **string**| | - **request_body** | [**object[]**](../Model/array.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **template_id** | **string**| | | +| **data** | [**\DocSpring\Model\SubmissionData[]**](../Model/SubmissionData.md)| | | ### Return type @@ -147,21 +159,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **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) -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +## `batchGeneratePdfs()` -# **batchGeneratePdfs** -> \DocSpring\Model\CreateSubmissionBatchResponse batchGeneratePdfs($submission_batch_data) +```php +batchGeneratePdfs($data): \DocSpring\Model\CreateSubmissionBatchResponse +``` Generates multiple PDFs ### Example + ```php setUsername('YOUR_USERNAME') @@ -174,22 +193,21 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$submission_batch_data = new \DocSpring\Model\SubmissionBatchData(); // \DocSpring\Model\SubmissionBatchData | +$data = new \DocSpring\Model\SubmissionBatchData(); // \DocSpring\Model\SubmissionBatchData try { - $result = $apiInstance->batchGeneratePdfs($submission_batch_data); + $result = $apiInstance->batchGeneratePdfs($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling PDFApi->batchGeneratePdfs: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **submission_batch_data** | [**\DocSpring\Model\SubmissionBatchData**](../Model/SubmissionBatchData.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **data** | [**\DocSpring\Model\SubmissionBatchData**](../Model/SubmissionBatchData.md)| | | ### Return type @@ -201,21 +219,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **combinePdfs** -> \DocSpring\Model\CreateCombinedSubmissionResponse combinePdfs($combine_pdfs_data) +## `combinePdfs()` + +```php +combinePdfs($data): \DocSpring\Model\CreateCombinedSubmissionResponse +``` Merge submission PDFs, template PDFs, or custom files ### Example + ```php setUsername('YOUR_USERNAME') @@ -228,22 +253,21 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$combine_pdfs_data = new \DocSpring\Model\CombinePdfsData(); // \DocSpring\Model\CombinePdfsData | +$data = new \DocSpring\Model\CombinePdfsData(); // \DocSpring\Model\CombinePdfsData try { - $result = $apiInstance->combinePdfs($combine_pdfs_data); + $result = $apiInstance->combinePdfs($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling PDFApi->combinePdfs: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **combine_pdfs_data** | [**\DocSpring\Model\CombinePdfsData**](../Model/CombinePdfsData.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **data** | [**\DocSpring\Model\CombinePdfsData**](../Model/CombinePdfsData.md)| | | ### Return type @@ -255,21 +279,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **combineSubmissions** -> \DocSpring\Model\CreateCombinedSubmissionResponse combineSubmissions($combined_submission_data) +## `combineSubmissions()` + +```php +combineSubmissions($data): \DocSpring\Model\CreateCombinedSubmissionResponse +``` Merge generated PDFs together ### Example + ```php setUsername('YOUR_USERNAME') @@ -282,22 +313,21 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$combined_submission_data = new \DocSpring\Model\CombinedSubmissionData(); // \DocSpring\Model\CombinedSubmissionData | +$data = new \DocSpring\Model\CombinedSubmissionData(); // \DocSpring\Model\CombinedSubmissionData try { - $result = $apiInstance->combineSubmissions($combined_submission_data); + $result = $apiInstance->combineSubmissions($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling PDFApi->combineSubmissions: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **combined_submission_data** | [**\DocSpring\Model\CombinedSubmissionData**](../Model/CombinedSubmissionData.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **data** | [**\DocSpring\Model\CombinedSubmissionData**](../Model/CombinedSubmissionData.md)| | | ### Return type @@ -309,21 +339,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **copyTemplate** -> \DocSpring\Model\Template copyTemplate($template_id, $copy_template_data) +## `copyTemplate()` + +```php +copyTemplate($template_id, $data): \DocSpring\Model\Template +``` Copy a Template ### Example + ```php setUsername('YOUR_USERNAME') @@ -336,24 +373,23 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$template_id = tpl_000000000000000001; // string | -$copy_template_data = new \DocSpring\Model\CopyTemplateData(); // \DocSpring\Model\CopyTemplateData | +$template_id = tpl_000000000000000001; // string +$data = new \DocSpring\Model\CopyTemplateData(); // \DocSpring\Model\CopyTemplateData try { - $result = $apiInstance->copyTemplate($template_id, $copy_template_data); + $result = $apiInstance->copyTemplate($template_id, $data); print_r($result); } catch (Exception $e) { echo 'Exception when calling PDFApi->copyTemplate: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **template_id** | **string**| | - **copy_template_data** | [**\DocSpring\Model\CopyTemplateData**](../Model/CopyTemplateData.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **template_id** | **string**| | | +| **data** | [**\DocSpring\Model\CopyTemplateData**](../Model/CopyTemplateData.md)| | | ### Return type @@ -365,21 +401,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **createCustomFileFromUpload** -> \DocSpring\Model\CreateCustomFileResponse createCustomFileFromUpload($create_custom_file_data) +## `createCustomFileFromUpload()` + +```php +createCustomFileFromUpload($data): \DocSpring\Model\CreateCustomFileResponse +``` Create a new custom file from a cached presign upload ### Example + ```php setUsername('YOUR_USERNAME') @@ -392,22 +435,21 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$create_custom_file_data = new \DocSpring\Model\CreateCustomFileData(); // \DocSpring\Model\CreateCustomFileData | +$data = new \DocSpring\Model\CreateCustomFileData(); // \DocSpring\Model\CreateCustomFileData try { - $result = $apiInstance->createCustomFileFromUpload($create_custom_file_data); + $result = $apiInstance->createCustomFileFromUpload($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling PDFApi->createCustomFileFromUpload: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **create_custom_file_data** | [**\DocSpring\Model\CreateCustomFileData**](../Model/CreateCustomFileData.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **data** | [**\DocSpring\Model\CreateCustomFileData**](../Model/CreateCustomFileData.md)| | | ### Return type @@ -419,21 +461,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **createDataRequestToken** -> \DocSpring\Model\CreateSubmissionDataRequestTokenResponse createDataRequestToken($data_request_id) +## `createDataRequestToken()` + +```php +createDataRequestToken($data_request_id): \DocSpring\Model\CreateSubmissionDataRequestTokenResponse +``` Creates a new data request token for form authentication ### Example + ```php setUsername('YOUR_USERNAME') @@ -446,7 +495,7 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$data_request_id = drq_000000000000000001; // string | +$data_request_id = drq_000000000000000001; // string try { $result = $apiInstance->createDataRequestToken($data_request_id); @@ -454,14 +503,13 @@ try { } catch (Exception $e) { echo 'Exception when calling PDFApi->createDataRequestToken: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **data_request_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **data_request_id** | **string**| | | ### Return type @@ -473,21 +521,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **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) -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +## `createFolder()` -# **createFolder** -> \DocSpring\Model\Folder createFolder($create_folder_data) +```php +createFolder($data): \DocSpring\Model\Folder +``` Create a folder ### Example + ```php setUsername('YOUR_USERNAME') @@ -500,22 +555,21 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$create_folder_data = new \DocSpring\Model\CreateFolderData(); // \DocSpring\Model\CreateFolderData | +$data = new \DocSpring\Model\CreateFolderData(); // \DocSpring\Model\CreateFolderData try { - $result = $apiInstance->createFolder($create_folder_data); + $result = $apiInstance->createFolder($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling PDFApi->createFolder: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **create_folder_data** | [**\DocSpring\Model\CreateFolderData**](../Model/CreateFolderData.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **data** | [**\DocSpring\Model\CreateFolderData**](../Model/CreateFolderData.md)| | | ### Return type @@ -527,21 +581,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **createHTMLTemplate** -> \DocSpring\Model\PendingTemplate createHTMLTemplate($create_html_template_data) +## `createHTMLTemplate()` + +```php +createHTMLTemplate($data): \DocSpring\Model\PendingTemplate +``` Create a new HTML template ### Example + ```php setUsername('YOUR_USERNAME') @@ -554,22 +615,21 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$create_html_template_data = new \DocSpring\Model\CreateHtmlTemplateData(); // \DocSpring\Model\CreateHtmlTemplateData | +$data = new \DocSpring\Model\CreateHtmlTemplateData(); // \DocSpring\Model\CreateHtmlTemplateData try { - $result = $apiInstance->createHTMLTemplate($create_html_template_data); + $result = $apiInstance->createHTMLTemplate($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling PDFApi->createHTMLTemplate: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **create_html_template_data** | [**\DocSpring\Model\CreateHtmlTemplateData**](../Model/CreateHtmlTemplateData.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **data** | [**\DocSpring\Model\CreateHtmlTemplateData**](../Model/CreateHtmlTemplateData.md)| | | ### Return type @@ -581,21 +641,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **createPDFTemplate** -> \DocSpring\Model\PendingTemplate createPDFTemplate($template_document, $template_name, $template_parent_folder_id) +## `createPDFTemplate()` + +```php +createPDFTemplate($template_document, $template_name, $template_parent_folder_id): \DocSpring\Model\PendingTemplate +``` Create a new PDF template with a form POST file upload ### Example + ```php setUsername('YOUR_USERNAME') @@ -608,9 +675,9 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$template_document = "/path/to/file.txt"; // \SplFileObject | -$template_name = 'template_name_example'; // string | -$template_parent_folder_id = 'template_parent_folder_id_example'; // string | +$template_document = "/path/to/file.txt"; // \SplFileObject +$template_name = 'template_name_example'; // string +$template_parent_folder_id = 'template_parent_folder_id_example'; // string try { $result = $apiInstance->createPDFTemplate($template_document, $template_name, $template_parent_folder_id); @@ -618,16 +685,15 @@ try { } catch (Exception $e) { echo 'Exception when calling PDFApi->createPDFTemplate: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **template_document** | **\SplFileObject****\SplFileObject**| | - **template_name** | **string**| | - **template_parent_folder_id** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **template_document** | **\SplFileObject****\SplFileObject**| | | +| **template_name** | **string**| | | +| **template_parent_folder_id** | **string**| | [optional] | ### Return type @@ -639,21 +705,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **createPDFTemplateFromUpload** -> \DocSpring\Model\PendingTemplate createPDFTemplateFromUpload($create_template_from_upload_data) +## `createPDFTemplateFromUpload()` + +```php +createPDFTemplateFromUpload($data): \DocSpring\Model\PendingTemplate +``` Create a new PDF template from a cached presign upload ### Example + ```php setUsername('YOUR_USERNAME') @@ -666,22 +739,21 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$create_template_from_upload_data = new \DocSpring\Model\CreateTemplateFromUploadData(); // \DocSpring\Model\CreateTemplateFromUploadData | +$data = new \DocSpring\Model\CreateTemplateFromUploadData(); // \DocSpring\Model\CreateTemplateFromUploadData try { - $result = $apiInstance->createPDFTemplateFromUpload($create_template_from_upload_data); + $result = $apiInstance->createPDFTemplateFromUpload($data); print_r($result); } catch (Exception $e) { echo 'Exception when calling PDFApi->createPDFTemplateFromUpload: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **create_template_from_upload_data** | [**\DocSpring\Model\CreateTemplateFromUploadData**](../Model/CreateTemplateFromUploadData.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **data** | [**\DocSpring\Model\CreateTemplateFromUploadData**](../Model/CreateTemplateFromUploadData.md)| | | ### Return type @@ -693,21 +765,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **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) -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +## `deleteFolder()` -# **deleteFolder** -> \DocSpring\Model\Folder deleteFolder($folder_id) +```php +deleteFolder($folder_id): \DocSpring\Model\Folder +``` Delete a folder ### Example + ```php setUsername('YOUR_USERNAME') @@ -720,7 +799,7 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$folder_id = fld_000000000000000001; // string | +$folder_id = fld_000000000000000001; // string try { $result = $apiInstance->deleteFolder($folder_id); @@ -728,14 +807,13 @@ try { } catch (Exception $e) { echo 'Exception when calling PDFApi->deleteFolder: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **folder_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **folder_id** | **string**| | | ### Return type @@ -747,21 +825,88 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **expireCombinedSubmission** -> \DocSpring\Model\CombinedSubmission expireCombinedSubmission($combined_submission_id) +## `deleteTemplate()` + +```php +deleteTemplate($template_id): \DocSpring\Model\DeleteTemplateResponse +``` + +Delete a template + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new DocSpring\Api\PDFApi( + // 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 +); +$template_id = tpl_000000000000000001; // string + +try { + $result = $apiInstance->deleteTemplate($template_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PDFApi->deleteTemplate: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **template_id** | **string**| | | + +### Return type + +[**\DocSpring\Model\DeleteTemplateResponse**](../Model/DeleteTemplateResponse.md) + +### Authorization + +[api_token_basic](../../README.md#api_token_basic) + +### 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) + +## `expireCombinedSubmission()` + +```php +expireCombinedSubmission($combined_submission_id): \DocSpring\Model\CombinedSubmission +``` Expire a combined submission ### Example + ```php setUsername('YOUR_USERNAME') @@ -774,7 +919,7 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$combined_submission_id = com_000000000000000001; // string | +$combined_submission_id = com_000000000000000001; // string try { $result = $apiInstance->expireCombinedSubmission($combined_submission_id); @@ -782,14 +927,13 @@ try { } catch (Exception $e) { echo 'Exception when calling PDFApi->expireCombinedSubmission: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **combined_submission_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **combined_submission_id** | **string**| | | ### Return type @@ -801,21 +945,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **expireSubmission** -> \DocSpring\Model\Submission expireSubmission($submission_id) +## `expireSubmission()` + +```php +expireSubmission($submission_id): \DocSpring\Model\Submission +``` Expire a PDF submission ### Example + ```php setUsername('YOUR_USERNAME') @@ -828,7 +979,7 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$submission_id = sub_000000000000000001; // string | +$submission_id = sub_000000000000000001; // string try { $result = $apiInstance->expireSubmission($submission_id); @@ -836,14 +987,13 @@ try { } catch (Exception $e) { echo 'Exception when calling PDFApi->expireSubmission: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **submission_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **submission_id** | **string**| | | ### Return type @@ -855,21 +1005,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **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) -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +## `generatePDF()` -# **generatePDF** -> \DocSpring\Model\CreateSubmissionResponse generatePDF($template_id, $submission_data) +```php +generatePDF($template_id, $submission): \DocSpring\Model\CreateSubmissionResponse +``` Generates a new PDF ### Example + ```php setUsername('YOUR_USERNAME') @@ -882,24 +1039,23 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$template_id = tpl_000000000000000001; // string | -$submission_data = new \DocSpring\Model\SubmissionData(); // \DocSpring\Model\SubmissionData | +$template_id = tpl_000000000000000001; // string +$submission = new \DocSpring\Model\CreateSubmissionData(); // \DocSpring\Model\CreateSubmissionData try { - $result = $apiInstance->generatePDF($template_id, $submission_data); + $result = $apiInstance->generatePDF($template_id, $submission); print_r($result); } catch (Exception $e) { echo 'Exception when calling PDFApi->generatePDF: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **template_id** | **string**| | - **submission_data** | [**\DocSpring\Model\SubmissionData**](../Model/SubmissionData.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **template_id** | **string**| | | +| **submission** | [**\DocSpring\Model\CreateSubmissionData**](../Model/CreateSubmissionData.md)| | | ### Return type @@ -911,21 +1067,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **getCombinedSubmission** -> \DocSpring\Model\CombinedSubmission getCombinedSubmission($combined_submission_id) +## `getCombinedSubmission()` + +```php +getCombinedSubmission($combined_submission_id): \DocSpring\Model\CombinedSubmission +``` Check the status of a combined submission (merged PDFs) ### Example + ```php setUsername('YOUR_USERNAME') @@ -938,7 +1101,7 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$combined_submission_id = com_000000000000000001; // string | +$combined_submission_id = com_000000000000000001; // string try { $result = $apiInstance->getCombinedSubmission($combined_submission_id); @@ -946,14 +1109,13 @@ try { } catch (Exception $e) { echo 'Exception when calling PDFApi->getCombinedSubmission: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **combined_submission_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **combined_submission_id** | **string**| | | ### Return type @@ -965,21 +1127,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **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) -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +## `getDataRequest()` -# **getDataRequest** -> \DocSpring\Model\SubmissionDataRequest getDataRequest($data_request_id) +```php +getDataRequest($data_request_id): \DocSpring\Model\SubmissionDataRequest +``` Look up a submission data request ### Example + ```php setUsername('YOUR_USERNAME') @@ -992,7 +1161,7 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$data_request_id = drq_000000000000000001; // string | +$data_request_id = drq_000000000000000001; // string try { $result = $apiInstance->getDataRequest($data_request_id); @@ -1000,14 +1169,13 @@ try { } catch (Exception $e) { echo 'Exception when calling PDFApi->getDataRequest: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **data_request_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **data_request_id** | **string**| | | ### Return type @@ -1019,21 +1187,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **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) -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +## `getFullTemplate()` -# **getFullTemplate** -> \DocSpring\Model\FullTemplate getFullTemplate($template_id) +```php +getFullTemplate($template_id): \DocSpring\Model\FullTemplate +``` Fetch the full template attributes ### Example + ```php setUsername('YOUR_USERNAME') @@ -1046,7 +1221,7 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$template_id = tpl_000000000000000001; // string | +$template_id = tpl_000000000000000001; // string try { $result = $apiInstance->getFullTemplate($template_id); @@ -1054,14 +1229,13 @@ try { } catch (Exception $e) { echo 'Exception when calling PDFApi->getFullTemplate: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **template_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **template_id** | **string**| | | ### Return type @@ -1073,21 +1247,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **getPresignUrl** -> map[string,object] getPresignUrl() +## `getPresignUrl()` + +```php +getPresignUrl(): object +``` Get a presigned URL so that you can upload a file to our AWS S3 bucket ### Example + ```php setUsername('YOUR_USERNAME') @@ -1107,15 +1288,15 @@ try { } catch (Exception $e) { echo 'Exception when calling PDFApi->getPresignUrl: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters + This endpoint does not need any parameter. ### Return type -**map[string,object]** +**object** ### Authorization @@ -1123,21 +1304,28 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **getSubmission** -> \DocSpring\Model\Submission getSubmission($submission_id, $include_data) +## `getSubmission()` + +```php +getSubmission($submission_id, $include_data): \DocSpring\Model\Submission +``` Check the status of a PDF ### Example + ```php setUsername('YOUR_USERNAME') @@ -1150,8 +1338,8 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$submission_id = sub_000000000000000001; // string | -$include_data = true; // bool | +$submission_id = sub_000000000000000001; // string +$include_data = true; // bool try { $result = $apiInstance->getSubmission($submission_id, $include_data); @@ -1159,15 +1347,14 @@ try { } catch (Exception $e) { echo 'Exception when calling PDFApi->getSubmission: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **submission_id** | **string**| | - **include_data** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **submission_id** | **string**| | | +| **include_data** | **bool**| | [optional] | ### Return type @@ -1179,21 +1366,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **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) -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +## `getSubmissionBatch()` -# **getSubmissionBatch** -> \DocSpring\Model\SubmissionBatch getSubmissionBatch($submission_batch_id, $include_submissions) +```php +getSubmissionBatch($submission_batch_id, $include_submissions): \DocSpring\Model\SubmissionBatch +``` Check the status of a submission batch job ### Example + ```php setUsername('YOUR_USERNAME') @@ -1206,8 +1400,8 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$submission_batch_id = sbb_000000000000000001; // string | -$include_submissions = true; // bool | +$submission_batch_id = sbb_000000000000000001; // string +$include_submissions = true; // bool try { $result = $apiInstance->getSubmissionBatch($submission_batch_id, $include_submissions); @@ -1215,15 +1409,14 @@ try { } catch (Exception $e) { echo 'Exception when calling PDFApi->getSubmissionBatch: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **submission_batch_id** | **string**| | - **include_submissions** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **submission_batch_id** | **string**| | | +| **include_submissions** | **bool**| | [optional] | ### Return type @@ -1235,21 +1428,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **getTemplate** -> \DocSpring\Model\Template getTemplate($template_id) +## `getTemplate()` + +```php +getTemplate($template_id): \DocSpring\Model\Template +``` Check the status of an uploaded template ### Example + ```php setUsername('YOUR_USERNAME') @@ -1262,7 +1462,7 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$template_id = tpl_000000000000000001; // string | +$template_id = tpl_000000000000000001; // string try { $result = $apiInstance->getTemplate($template_id); @@ -1270,14 +1470,13 @@ try { } catch (Exception $e) { echo 'Exception when calling PDFApi->getTemplate: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **template_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **template_id** | **string**| | | ### Return type @@ -1289,21 +1488,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **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) -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +## `getTemplateSchema()` -# **getTemplateSchema** -> map[string,object] getTemplateSchema($template_id) +```php +getTemplateSchema($template_id): object +``` Fetch the JSON schema for a template ### Example + ```php setUsername('YOUR_USERNAME') @@ -1316,7 +1522,7 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$template_id = tpl_000000000000000001; // string | +$template_id = tpl_000000000000000001; // string try { $result = $apiInstance->getTemplateSchema($template_id); @@ -1324,18 +1530,79 @@ try { } catch (Exception $e) { echo 'Exception when calling PDFApi->getTemplateSchema: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **template_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **template_id** | **string**| | | + +### Return type + +**object** + +### Authorization + +[api_token_basic](../../README.md#api_token_basic) + +### 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) + +## `listCombinedSubmissions()` + +```php +listCombinedSubmissions($page, $per_page): \DocSpring\Model\CombinedSubmission[] +``` + +Get a list of all combined submissions + +### Example + +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new DocSpring\Api\PDFApi( + // 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 +); +$page = 2; // int | Default: 1 +$per_page = 1; // int | Default: 50 + +try { + $result = $apiInstance->listCombinedSubmissions($page, $per_page); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PDFApi->listCombinedSubmissions: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **page** | **int**| Default: 1 | [optional] | +| **per_page** | **int**| Default: 50 | [optional] | ### Return type -**map[string,object]** +[**\DocSpring\Model\CombinedSubmission[]**](../Model/CombinedSubmission.md) ### Authorization @@ -1343,21 +1610,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **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) -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +## `listFolders()` -# **listFolders** -> \DocSpring\Model\Folder[] listFolders($parent_folder_id) +```php +listFolders($parent_folder_id): \DocSpring\Model\Folder[] +``` Get a list of all folders ### Example + ```php setUsername('YOUR_USERNAME') @@ -1378,14 +1652,13 @@ try { } catch (Exception $e) { echo 'Exception when calling PDFApi->listFolders: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **parent_folder_id** | **string**| Filter By Folder Id | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **parent_folder_id** | **string**| Filter By Folder Id | [optional] | ### Return type @@ -1397,21 +1670,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **listSubmissions** -> \DocSpring\Model\ListSubmissionsResponse listSubmissions($cursor, $limit, $created_after, $created_before, $type, $include_data) +## `listSubmissions()` + +```php +listSubmissions($cursor, $limit, $created_after, $created_before, $type, $include_data): \DocSpring\Model\ListSubmissionsResponse +``` List all submissions ### Example + ```php setUsername('YOUR_USERNAME') @@ -1424,12 +1704,12 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$cursor = sub_list_000012; // string | -$limit = 3; // float | -$created_after = 2019-01-01T09:00:00-05:00; // string | -$created_before = 2020-01-01T09:00:00-05:00; // string | -$type = test; // string | -$include_data = true; // bool | +$cursor = sub_list_000012; // string +$limit = 3; // float +$created_after = 2019-01-01T09:00:00-05:00; // string +$created_before = 2020-01-01T09:00:00.000+0200; // string +$type = test; // string +$include_data = true; // bool try { $result = $apiInstance->listSubmissions($cursor, $limit, $created_after, $created_before, $type, $include_data); @@ -1437,19 +1717,18 @@ try { } catch (Exception $e) { echo 'Exception when calling PDFApi->listSubmissions: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **cursor** | **string**| | [optional] - **limit** | **float**| | [optional] - **created_after** | **string**| | [optional] - **created_before** | **string**| | [optional] - **type** | **string**| | [optional] - **include_data** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **cursor** | **string**| | [optional] | +| **limit** | **float**| | [optional] | +| **created_after** | **string**| | [optional] | +| **created_before** | **string**| | [optional] | +| **type** | **string**| | [optional] | +| **include_data** | **bool**| | [optional] | ### Return type @@ -1461,21 +1740,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **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) -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +## `listTemplateSubmissions()` -# **listSubmissions_0** -> \DocSpring\Model\ListSubmissionsResponse listSubmissions_0($template_id, $cursor, $limit, $created_after, $created_before, $type, $include_data) +```php +listTemplateSubmissions($template_id, $cursor, $limit, $created_after, $created_before, $type, $include_data): \DocSpring\Model\ListSubmissionsResponse +``` List all submissions for a given template ### Example + ```php setUsername('YOUR_USERNAME') @@ -1488,34 +1774,33 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$template_id = tpl_000000000000000002; // string | -$cursor = 'cursor_example'; // string | -$limit = 3.4; // float | -$created_after = 'created_after_example'; // string | -$created_before = 'created_before_example'; // string | -$type = 'type_example'; // string | -$include_data = true; // bool | +$template_id = tpl_000000000000000002; // string +$cursor = 'cursor_example'; // string +$limit = 3.4; // float +$created_after = 'created_after_example'; // string +$created_before = 'created_before_example'; // string +$type = 'type_example'; // string +$include_data = true; // bool try { - $result = $apiInstance->listSubmissions_0($template_id, $cursor, $limit, $created_after, $created_before, $type, $include_data); + $result = $apiInstance->listTemplateSubmissions($template_id, $cursor, $limit, $created_after, $created_before, $type, $include_data); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PDFApi->listSubmissions_0: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PDFApi->listTemplateSubmissions: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **template_id** | **string**| | - **cursor** | **string**| | [optional] - **limit** | **float**| | [optional] - **created_after** | **string**| | [optional] - **created_before** | **string**| | [optional] - **type** | **string**| | [optional] - **include_data** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **template_id** | **string**| | | +| **cursor** | **string**| | [optional] | +| **limit** | **float**| | [optional] | +| **created_after** | **string**| | [optional] | +| **created_before** | **string**| | [optional] | +| **type** | **string**| | [optional] | +| **include_data** | **bool**| | [optional] | ### Return type @@ -1527,21 +1812,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **listTemplates** -> \DocSpring\Model\Template[] listTemplates($query, $parent_folder_id, $page, $per_page) +## `listTemplates()` + +```php +listTemplates($query, $parent_folder_id, $page, $per_page): \DocSpring\Model\Template[] +``` Get a list of all templates ### Example + ```php setUsername('YOUR_USERNAME') @@ -1565,17 +1857,16 @@ try { } catch (Exception $e) { echo 'Exception when calling PDFApi->listTemplates: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **string**| Search By Name | [optional] - **parent_folder_id** | **string**| Filter By Folder Id | [optional] - **page** | **int**| Default: 1 | [optional] - **per_page** | **int**| Default: 50 | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **query** | **string**| Search By Name | [optional] | +| **parent_folder_id** | **string**| Filter By Folder Id | [optional] | +| **page** | **int**| Default: 1 | [optional] | +| **per_page** | **int**| Default: 50 | [optional] | ### Return type @@ -1587,21 +1878,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **moveFolderToFolder** -> \DocSpring\Model\Folder moveFolderToFolder($folder_id, $move_folder_data) +## `moveFolderToFolder()` + +```php +moveFolderToFolder($folder_id, $data): \DocSpring\Model\Folder +``` Move a folder ### Example + ```php setUsername('YOUR_USERNAME') @@ -1614,24 +1912,23 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$folder_id = fld_000000000000000001; // string | -$move_folder_data = new \DocSpring\Model\MoveFolderData(); // \DocSpring\Model\MoveFolderData | +$folder_id = fld_000000000000000001; // string +$data = new \DocSpring\Model\MoveFolderData(); // \DocSpring\Model\MoveFolderData try { - $result = $apiInstance->moveFolderToFolder($folder_id, $move_folder_data); + $result = $apiInstance->moveFolderToFolder($folder_id, $data); print_r($result); } catch (Exception $e) { echo 'Exception when calling PDFApi->moveFolderToFolder: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **folder_id** | **string**| | - **move_folder_data** | [**\DocSpring\Model\MoveFolderData**](../Model/MoveFolderData.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **folder_id** | **string**| | | +| **data** | [**\DocSpring\Model\MoveFolderData**](../Model/MoveFolderData.md)| | | ### Return type @@ -1643,21 +1940,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **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) -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +## `moveTemplateToFolder()` -# **moveTemplateToFolder** -> \DocSpring\Model\Template moveTemplateToFolder($template_id, $move_template_data) +```php +moveTemplateToFolder($template_id, $data): \DocSpring\Model\Template +``` Move Template to folder ### Example + ```php setUsername('YOUR_USERNAME') @@ -1670,24 +1974,23 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$template_id = tpl_000000000000000001; // string | -$move_template_data = new \DocSpring\Model\MoveTemplateData(); // \DocSpring\Model\MoveTemplateData | +$template_id = tpl_000000000000000001; // string +$data = new \DocSpring\Model\MoveTemplateData(); // \DocSpring\Model\MoveTemplateData try { - $result = $apiInstance->moveTemplateToFolder($template_id, $move_template_data); + $result = $apiInstance->moveTemplateToFolder($template_id, $data); print_r($result); } catch (Exception $e) { echo 'Exception when calling PDFApi->moveTemplateToFolder: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **template_id** | **string**| | - **move_template_data** | [**\DocSpring\Model\MoveTemplateData**](../Model/MoveTemplateData.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **template_id** | **string**| | | +| **data** | [**\DocSpring\Model\MoveTemplateData**](../Model/MoveTemplateData.md)| | | ### Return type @@ -1699,21 +2002,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **renameFolder** -> renameFolder($folder_id, $rename_folder_data) +## `renameFolder()` + +```php +renameFolder($folder_id, $data) +``` Rename a folder ### Example + ```php setUsername('YOUR_USERNAME') @@ -1726,23 +2036,22 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$folder_id = fld_000000000000000001; // string | -$rename_folder_data = new \DocSpring\Model\RenameFolderData(); // \DocSpring\Model\RenameFolderData | +$folder_id = fld_000000000000000001; // string +$data = new \DocSpring\Model\RenameFolderData(); // \DocSpring\Model\RenameFolderData try { - $apiInstance->renameFolder($folder_id, $rename_folder_data); + $apiInstance->renameFolder($folder_id, $data); } catch (Exception $e) { echo 'Exception when calling PDFApi->renameFolder: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **folder_id** | **string**| | - **rename_folder_data** | [**\DocSpring\Model\RenameFolderData**](../Model/RenameFolderData.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **folder_id** | **string**| | | +| **data** | [**\DocSpring\Model\RenameFolderData**](../Model/RenameFolderData.md)| | | ### Return type @@ -1754,21 +2063,28 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **testAuthentication** -> \DocSpring\Model\AuthenticationSuccessResponse testAuthentication() +## `testAuthentication()` + +```php +testAuthentication(): \DocSpring\Model\AuthenticationSuccessResponse +``` Test Authentication ### Example + ```php setUsername('YOUR_USERNAME') @@ -1788,10 +2104,10 @@ try { } catch (Exception $e) { echo 'Exception when calling PDFApi->testAuthentication: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -1804,21 +2120,28 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **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) -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +## `updateDataRequest()` -# **updateDataRequest** -> \DocSpring\Model\UpdateDataRequestResponse updateDataRequest($data_request_id, $update_submission_data_request_data) +```php +updateDataRequest($data_request_id, $data): \DocSpring\Model\UpdateDataRequestResponse +``` Update a submission data request ### Example + ```php setUsername('YOUR_USERNAME') @@ -1831,24 +2154,23 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$data_request_id = drq_000000000000000001; // string | -$update_submission_data_request_data = new \DocSpring\Model\UpdateSubmissionDataRequestData(); // \DocSpring\Model\UpdateSubmissionDataRequestData | +$data_request_id = drq_000000000000000001; // string +$data = new \DocSpring\Model\UpdateSubmissionDataRequestData(); // \DocSpring\Model\UpdateSubmissionDataRequestData try { - $result = $apiInstance->updateDataRequest($data_request_id, $update_submission_data_request_data); + $result = $apiInstance->updateDataRequest($data_request_id, $data); print_r($result); } catch (Exception $e) { echo 'Exception when calling PDFApi->updateDataRequest: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **data_request_id** | **string**| | - **update_submission_data_request_data** | [**\DocSpring\Model\UpdateSubmissionDataRequestData**](../Model/UpdateSubmissionDataRequestData.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **data_request_id** | **string**| | | +| **data** | [**\DocSpring\Model\UpdateSubmissionDataRequestData**](../Model/UpdateSubmissionDataRequestData.md)| | | ### Return type @@ -1860,21 +2182,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: `application/json` +- **Accept**: `application/json` -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) -# **updateTemplate** -> \DocSpring\Model\UpdateTemplateResponse updateTemplate($template_id, $update_template_data) +## `updateTemplate()` + +```php +updateTemplate($template_id, $data): \DocSpring\Model\UpdateTemplateResponse +``` Update a Template ### Example + ```php setUsername('YOUR_USERNAME') @@ -1887,24 +2216,23 @@ $apiInstance = new DocSpring\Api\PDFApi( new GuzzleHttp\Client(), $config ); -$template_id = tpl_000000000000000003; // string | -$update_template_data = new \DocSpring\Model\UpdateTemplateData(); // \DocSpring\Model\UpdateTemplateData | +$template_id = tpl_000000000000000003; // string +$data = new \DocSpring\Model\UpdateTemplateData(); // \DocSpring\Model\UpdateTemplateData try { - $result = $apiInstance->updateTemplate($template_id, $update_template_data); + $result = $apiInstance->updateTemplate($template_id, $data); print_r($result); } catch (Exception $e) { echo 'Exception when calling PDFApi->updateTemplate: ', $e->getMessage(), PHP_EOL; } -?> ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **template_id** | **string**| | - **update_template_data** | [**\DocSpring\Model\UpdateTemplateData**](../Model/UpdateTemplateData.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **template_id** | **string**| | | +| **data** | [**\DocSpring\Model\UpdateTemplateData**](../Model/UpdateTemplateData.md)| | | ### Return type @@ -1916,8 +2244,9 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +- **Content-Type**: `application/json` +- **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/Model/AddFieldsData.md b/docs/Model/AddFieldsData.md index b504b0d..3e7f163 100644 --- a/docs/Model/AddFieldsData.md +++ b/docs/Model/AddFieldsData.md @@ -1,10 +1,9 @@ -# AddFieldsData +# # AddFieldsData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**fields** | [**\DocSpring\Model\TemplatestemplateIdaddFieldsFields[]**](TemplatestemplateIdaddFieldsFields.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**fields** | **object[]** | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddFieldsTemplateResponse.md b/docs/Model/AddFieldsTemplateResponse.md index 1dbc3fe..5fb19b2 100644 --- a/docs/Model/AddFieldsTemplateResponse.md +++ b/docs/Model/AddFieldsTemplateResponse.md @@ -1,12 +1,11 @@ -# AddFieldsTemplateResponse +# # AddFieldsTemplateResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**new_field_ids** | **int[]** | | [optional] -**errors** | **string[]** | | [optional] -**status** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**status** | **string** | | +**errors** | **string[]** | | [optional] +**new_field_ids** | **int[]** | | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AuthenticationError.md b/docs/Model/AuthenticationError.md index 55ba8b6..e442f3e 100644 --- a/docs/Model/AuthenticationError.md +++ b/docs/Model/AuthenticationError.md @@ -1,11 +1,10 @@ -# AuthenticationError +# # AuthenticationError ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**status** | **string** | | [optional] -**error** | **string** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**status** | **string** | | [optional] +**error** | **string** | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AuthenticationSuccessResponse.md b/docs/Model/AuthenticationSuccessResponse.md index 7e2ae24..fa9cb3b 100644 --- a/docs/Model/AuthenticationSuccessResponse.md +++ b/docs/Model/AuthenticationSuccessResponse.md @@ -1,10 +1,9 @@ -# AuthenticationSuccessResponse +# # AuthenticationSuccessResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**status** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**status** | **string** | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CombinePdfsData.md b/docs/Model/CombinePdfsData.md index aebbfcf..fc3f1f2 100644 --- a/docs/Model/CombinePdfsData.md +++ b/docs/Model/CombinePdfsData.md @@ -1,15 +1,14 @@ -# CombinePdfsData +# # CombinePdfsData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**delete_custom_files** | **bool** | | [optional] -**expires_in** | **int** | | [optional] -**metadata** | **object** | | [optional] -**password** | **string** | | [optional] -**source_pdfs** | **object[]** | | -**test** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - +**delete_custom_files** | **bool** | | [optional] +**expires_in** | **int** | | [optional] +**metadata** | **object** | | [optional] +**password** | **string** | | [optional] +**source_pdfs** | **object[]** | | +**test** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CombinedSubmission.md b/docs/Model/CombinedSubmission.md index 20d285f..d1949c9 100644 --- a/docs/Model/CombinedSubmission.md +++ b/docs/Model/CombinedSubmission.md @@ -1,20 +1,21 @@ -# CombinedSubmission +# # CombinedSubmission ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**metadata** | **object** | | [optional] -**password** | **string** | | [optional] -**expired** | **bool** | | [optional] -**expires_at** | **string** | | [optional] -**source_pdfs** | **object[]** | | [optional] -**pdf_hash** | **string** | | [optional] -**download_url** | **string** | | [optional] -**submission_ids** | **string[]** | | [optional] -**id** | **string** | | [optional] -**state** | **string** | | [optional] -**actions** | [**\DocSpring\Model\CombinedSubmissionAction[]**](CombinedSubmissionAction.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**id** | **string** | | +**expired** | **bool** | | +**expires_in** | **int** | | [optional] +**expires_at** | **string** | | [optional] +**state** | **string** | | +**error_message** | **string** | | [optional] +**metadata** | **object** | | [optional] +**password** | **string** | | [optional] +**submission_ids** | **string[]** | | +**source_pdfs** | **object[]** | | +**download_url** | **string** | | [optional] +**pdf_hash** | **string** | | [optional] +**actions** | [**\DocSpring\Model\CombinedSubmissionAction[]**](CombinedSubmissionAction.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/Model/CombinedSubmissionAction.md b/docs/Model/CombinedSubmissionAction.md index a887be1..ced4455 100644 --- a/docs/Model/CombinedSubmissionAction.md +++ b/docs/Model/CombinedSubmissionAction.md @@ -1,15 +1,14 @@ -# CombinedSubmissionAction +# # CombinedSubmissionAction ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | -**integration_id** | **string** | | -**state** | **string** | | -**action_category** | **string** | | -**action_type** | **string** | | -**result_data** | **object** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - +**id** | **string** | | +**integration_id** | **string** | | +**state** | **string** | | +**action_category** | **string** | | +**action_type** | **string** | | +**result_data** | **object** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CombinedSubmissionData.md b/docs/Model/CombinedSubmissionData.md index 3ca0445..ff8a450 100644 --- a/docs/Model/CombinedSubmissionData.md +++ b/docs/Model/CombinedSubmissionData.md @@ -1,14 +1,13 @@ -# CombinedSubmissionData +# # CombinedSubmissionData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**expires_in** | **int** | | [optional] -**metadata** | **object** | | [optional] -**password** | **string** | | [optional] -**submission_ids** | **string[]** | | -**test** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**expires_in** | **int** | | [optional] +**metadata** | **object** | | [optional] +**password** | **string** | | [optional] +**submission_ids** | **string[]** | | +**test** | **bool** | | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CopyTemplateData.md b/docs/Model/CopyTemplateData.md index dfab836..df3313b 100644 --- a/docs/Model/CopyTemplateData.md +++ b/docs/Model/CopyTemplateData.md @@ -1,11 +1,10 @@ -# CopyTemplateData +# # CopyTemplateData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | | [optional] -**parent_folder_id** | **string** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**name** | **string** | | [optional] +**parent_folder_id** | **string** | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateCombinedSubmissionResponse.md b/docs/Model/CreateCombinedSubmissionResponse.md index d216df9..14478b1 100644 --- a/docs/Model/CreateCombinedSubmissionResponse.md +++ b/docs/Model/CreateCombinedSubmissionResponse.md @@ -1,12 +1,11 @@ -# CreateCombinedSubmissionResponse +# # CreateCombinedSubmissionResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**combined_submission** | [**\DocSpring\Model\CombinedSubmission**](CombinedSubmission.md) | | [optional] -**errors** | **string[]** | | [optional] -**status** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**status** | **string** | | +**errors** | **string[]** | | [optional] +**combined_submission** | [**\DocSpring\Model\CombinedSubmission**](CombinedSubmission.md) | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateCustomFileData.md b/docs/Model/CreateCustomFileData.md index 9379ad8..7c8897d 100644 --- a/docs/Model/CreateCustomFileData.md +++ b/docs/Model/CreateCustomFileData.md @@ -1,10 +1,9 @@ -# CreateCustomFileData +# # CreateCustomFileData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**cache_id** | **string** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**cache_id** | **string** | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateCustomFileResponse.md b/docs/Model/CreateCustomFileResponse.md index 44650e6..65a7764 100644 --- a/docs/Model/CreateCustomFileResponse.md +++ b/docs/Model/CreateCustomFileResponse.md @@ -1,12 +1,11 @@ -# CreateCustomFileResponse +# # CreateCustomFileResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**custom_file** | [**\DocSpring\Model\CustomFile**](CustomFile.md) | | [optional] -**errors** | **string[]** | | [optional] -**status** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**status** | **string** | | +**errors** | **string[]** | | [optional] +**custom_file** | **object** | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateFolderAttributes.md b/docs/Model/CreateFolderAttributes.md new file mode 100644 index 0000000..18fb472 --- /dev/null +++ b/docs/Model/CreateFolderAttributes.md @@ -0,0 +1,10 @@ +# # CreateFolderAttributes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | +**parent_folder_id** | **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/Model/CreateFolderData.md b/docs/Model/CreateFolderData.md index 6c9f165..8f5a34d 100644 --- a/docs/Model/CreateFolderData.md +++ b/docs/Model/CreateFolderData.md @@ -1,10 +1,9 @@ -# CreateFolderData +# # CreateFolderData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**folder** | [**\DocSpring\Model\FoldersFolder**](FoldersFolder.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**folder** | [**\DocSpring\Model\CreateFolderAttributes**](CreateFolderAttributes.md) | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateHtmlTemplateData.md b/docs/Model/CreateHtmlTemplateData.md index 0d92898..91843ec 100644 --- a/docs/Model/CreateHtmlTemplateData.md +++ b/docs/Model/CreateHtmlTemplateData.md @@ -1,10 +1,9 @@ -# CreateHtmlTemplateData +# # CreateHtmlTemplateData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**template** | [**\DocSpring\Model\HtmlTemplateData**](HtmlTemplateData.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**template** | [**\DocSpring\Model\HtmlTemplateData**](HtmlTemplateData.md) | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateSubmissionBatchResponse.md b/docs/Model/CreateSubmissionBatchResponse.md index 08cdc33..ac41cc5 100644 --- a/docs/Model/CreateSubmissionBatchResponse.md +++ b/docs/Model/CreateSubmissionBatchResponse.md @@ -1,14 +1,13 @@ -# CreateSubmissionBatchResponse +# # CreateSubmissionBatchResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**submission_batch** | [**\DocSpring\Model\SubmissionBatch**](SubmissionBatch.md) | | [optional] -**submissions** | [**\DocSpring\Model\CreateSubmissionBatchSubmissionsResponse[]**](CreateSubmissionBatchSubmissionsResponse.md) | | [optional] -**error** | **string** | | [optional] -**errors** | **string[]** | | [optional] -**status** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**status** | **string** | | +**error** | **string** | | [optional] +**errors** | **string[]** | | [optional] +**submission_batch** | [**\DocSpring\Model\SubmissionBatch**](SubmissionBatch.md) | | +**submissions** | [**\DocSpring\Model\CreateSubmissionBatchSubmissionsResponse[]**](CreateSubmissionBatchSubmissionsResponse.md) | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateSubmissionBatchSubmissionsResponse.md b/docs/Model/CreateSubmissionBatchSubmissionsResponse.md index 3253c42..6827c7f 100644 --- a/docs/Model/CreateSubmissionBatchSubmissionsResponse.md +++ b/docs/Model/CreateSubmissionBatchSubmissionsResponse.md @@ -1,12 +1,11 @@ -# CreateSubmissionBatchSubmissionsResponse +# # CreateSubmissionBatchSubmissionsResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**submission** | [**\DocSpring\Model\Submission**](Submission.md) | | [optional] -**errors** | **string[]** | | [optional] -**status** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**status** | **string** | | +**errors** | **string[]** | | [optional] +**submission** | [**\DocSpring\Model\Submission**](Submission.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/Model/CreateSubmissionData.md b/docs/Model/CreateSubmissionData.md new file mode 100644 index 0000000..481a5fe --- /dev/null +++ b/docs/Model/CreateSubmissionData.md @@ -0,0 +1,17 @@ +# # CreateSubmissionData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**css** | **string** | | [optional] +**data** | **object** | | +**data_requests** | [**\DocSpring\Model\CreateSubmissionDataRequestData[]**](CreateSubmissionDataRequestData.md) | | [optional] +**expires_in** | **int** | | [optional] +**field_overrides** | **object** | | [optional] +**html** | **string** | | [optional] +**metadata** | **object** | | [optional] +**password** | **string** | | [optional] +**test** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateSubmissionDataRequestData.md b/docs/Model/CreateSubmissionDataRequestData.md index 9fa1002..14d9ed6 100644 --- a/docs/Model/CreateSubmissionDataRequestData.md +++ b/docs/Model/CreateSubmissionDataRequestData.md @@ -1,22 +1,21 @@ -# CreateSubmissionDataRequestData +# # CreateSubmissionDataRequestData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**auth_type** | **string** | | [optional] -**metadata** | **object** | | [optional] -**auth_second_factor_type** | **string** | | [optional] -**auth_phone_number_hash** | **string** | | [optional] -**auth_session_started_at** | **string** | | [optional] -**auth_user_id_hash** | **string** | | [optional] -**auth_session_id_hash** | **string** | | [optional] -**auth_username_hash** | **string** | | [optional] -**name** | **string** | | [optional] -**fields** | **string[]** | | [optional] -**auth_provider** | **string** | | [optional] -**email** | **string** | | [optional] -**order** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**auth_phone_number_hash** | **string** | | [optional] +**auth_provider** | **string** | | [optional] +**auth_second_factor_type** | **string** | | [optional] +**auth_session_id_hash** | **string** | | [optional] +**auth_session_started_at** | **string** | | [optional] +**auth_type** | **string** | | +**auth_user_id_hash** | **string** | | [optional] +**auth_username_hash** | **string** | | [optional] +**email** | **string** | | +**fields** | **string[]** | | [optional] +**metadata** | **object** | | [optional] +**name** | **string** | | [optional] +**order** | **int** | | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateSubmissionDataRequestTokenResponse.md b/docs/Model/CreateSubmissionDataRequestTokenResponse.md index 89691cf..d7a49e3 100644 --- a/docs/Model/CreateSubmissionDataRequestTokenResponse.md +++ b/docs/Model/CreateSubmissionDataRequestTokenResponse.md @@ -1,12 +1,11 @@ -# CreateSubmissionDataRequestTokenResponse +# # CreateSubmissionDataRequestTokenResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | **string[]** | | [optional] -**status** | **string** | | [optional] -**token** | [**\DocSpring\Model\CreateSubmissionDataRequestTokenResponseToken**](CreateSubmissionDataRequestTokenResponseToken.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**status** | **string** | | +**errors** | **string[]** | | [optional] +**token** | [**\DocSpring\Model\DataRequestToken**](DataRequestToken.md) | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateSubmissionDataRequestTokenResponseToken.md b/docs/Model/CreateSubmissionDataRequestTokenResponseToken.md deleted file mode 100644 index fada8f2..0000000 --- a/docs/Model/CreateSubmissionDataRequestTokenResponseToken.md +++ /dev/null @@ -1,13 +0,0 @@ -# CreateSubmissionDataRequestTokenResponseToken - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**expires_at** | **string** | | [optional] -**id** | **string** | | [optional] -**secret** | **string** | | [optional] -**data_request_url** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Model/CreateSubmissionResponse.md b/docs/Model/CreateSubmissionResponse.md index 58e1871..9d907cf 100644 --- a/docs/Model/CreateSubmissionResponse.md +++ b/docs/Model/CreateSubmissionResponse.md @@ -1,12 +1,11 @@ -# CreateSubmissionResponse +# # CreateSubmissionResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**submission** | [**\DocSpring\Model\Submission**](Submission.md) | | [optional] -**errors** | **string[]** | | [optional] -**status** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**status** | **string** | | +**errors** | **string[]** | | [optional] +**submission** | [**\DocSpring\Model\Submission**](Submission.md) | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateTemplateFromUploadData.md b/docs/Model/CreateTemplateFromUploadData.md index d05e81c..1c9317a 100644 --- a/docs/Model/CreateTemplateFromUploadData.md +++ b/docs/Model/CreateTemplateFromUploadData.md @@ -1,10 +1,9 @@ -# CreateTemplateFromUploadData +# # CreateTemplateFromUploadData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**template** | [**\DocSpring\Model\UploadTemplateData**](UploadTemplateData.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**template** | [**\DocSpring\Model\UploadTemplateData**](UploadTemplateData.md) | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CustomFile.md b/docs/Model/CustomFile.md deleted file mode 100644 index 2f7cfe0..0000000 --- a/docs/Model/CustomFile.md +++ /dev/null @@ -1,11 +0,0 @@ -# CustomFile - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | | [optional] -**url** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Model/DataRequestToken.md b/docs/Model/DataRequestToken.md new file mode 100644 index 0000000..20f8d2b --- /dev/null +++ b/docs/Model/DataRequestToken.md @@ -0,0 +1,12 @@ +# # DataRequestToken + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | +**secret** | **string** | | +**expires_at** | **string** | | +**data_request_url** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteTemplateResponse.md b/docs/Model/DeleteTemplateResponse.md new file mode 100644 index 0000000..8f21a96 --- /dev/null +++ b/docs/Model/DeleteTemplateResponse.md @@ -0,0 +1,10 @@ +# # DeleteTemplateResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | | +**errors** | **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/Model/Error.md b/docs/Model/Error.md deleted file mode 100644 index 8e66451..0000000 --- a/docs/Model/Error.md +++ /dev/null @@ -1,11 +0,0 @@ -# Error - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **string** | | -**error** | **string** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Model/ErrorResponse.md b/docs/Model/ErrorResponse.md new file mode 100644 index 0000000..d5d98a6 --- /dev/null +++ b/docs/Model/ErrorResponse.md @@ -0,0 +1,10 @@ +# # ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | | +**error** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Folder.md b/docs/Model/Folder.md index 8eb31ec..f30abe4 100644 --- a/docs/Model/Folder.md +++ b/docs/Model/Folder.md @@ -1,13 +1,12 @@ -# Folder +# # Folder ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**path** | **string** | | [optional] -**parent_folder_id** | **string** | | [optional] -**name** | **string** | | [optional] -**id** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**id** | **string** | | [optional] +**name** | **string** | | [optional] +**path** | **string** | | [optional] +**parent_folder_id** | **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/Model/FoldersFolder.md b/docs/Model/FoldersFolder.md deleted file mode 100644 index e2f547c..0000000 --- a/docs/Model/FoldersFolder.md +++ /dev/null @@ -1,11 +0,0 @@ -# FoldersFolder - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**parent_folder_id** | **string** | | [optional] -**name** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Model/FullTemplate.md b/docs/Model/FullTemplate.md index 1a3b689..339d2d7 100644 --- a/docs/Model/FullTemplate.md +++ b/docs/Model/FullTemplate.md @@ -1,48 +1,47 @@ -# FullTemplate +# # FullTemplate ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**document_processed** | **bool** | | [optional] -**expiration_interval** | **string** | | [optional] -**scss** | **string** | | [optional] -**document_state** | **string** | | [optional] -**expire_after** | **float** | | [optional] -**description** | **string** | | [optional] -**slack_webhook_url** | **string** | | [optional] -**demo** | **bool** | | [optional] -**path** | **string** | | [optional] -**header_html** | **string** | | [optional] -**public_web_form** | **bool** | | [optional] -**field_order** | [**float[][]**](array.md) | | [optional] -**permanent_document_url** | **string** | | [optional] -**html** | **string** | | [optional] -**template_type** | **string** | | [optional] -**id** | **string** | | [optional] -**page_dimensions** | [**float[][]**](array.md) | | [optional] -**locked** | **bool** | | [optional] -**page_count** | **float** | | [optional] -**encrypt_pdfs** | **bool** | | [optional] -**webhook_url** | **string** | | [optional] -**embed_domains** | **string[]** | | [optional] -**parent_folder_id** | **string** | | [optional] -**allow_additional_properties** | **bool** | | [optional] -**encrypt_pdfs_password** | **string** | | [optional] -**public_submissions** | **bool** | | [optional] -**shared_field_data** | **object** | | [optional] -**document_md5** | **string** | | [optional] -**first_template** | **bool** | | [optional] -**defaults** | [**\DocSpring\Model\FullTemplateDefaults**](FullTemplateDefaults.md) | | [optional] -**editable_submissions** | **bool** | | [optional] -**expire_submissions** | **bool** | | [optional] -**name** | **string** | | [optional] -**footer_html** | **string** | | [optional] -**document_parse_error** | **bool** | | [optional] -**fields** | **object** | | [optional] -**document_filename** | **string** | | [optional] -**redirect_url** | **string** | | [optional] -**document_url** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**name** | **string** | | +**description** | **string** | | +**public_web_form** | **bool** | | +**public_submissions** | **bool** | | +**expire_submissions** | **bool** | | +**expire_after** | **float** | | +**expiration_interval** | **string** | | +**allow_additional_properties** | **bool** | | +**editable_submissions** | **bool** | | +**locked** | **bool** | | +**webhook_url** | **string** | | +**slack_webhook_url** | **string** | | +**redirect_url** | **string** | | +**first_template** | **bool** | | +**html** | **string** | | +**header_html** | **string** | | +**footer_html** | **string** | | +**scss** | **string** | | +**encrypt_pdfs** | **bool** | | +**encrypt_pdfs_password** | **string** | | +**defaults** | [**\DocSpring\Model\TemplateDefaults**](TemplateDefaults.md) | | +**fields** | **object** | | +**shared_field_data** | **object** | | +**field_order** | **float[][]** | | +**document_md5** | **string** | | +**document_filename** | **string** | | +**document_parse_error** | **bool** | | +**document_state** | **string** | | +**embed_domains** | **string[]** | | +**page_count** | **float** | | +**document_processed** | **bool** | | +**demo** | **bool** | | +**id** | **string** | | +**template_type** | **string** | | +**page_dimensions** | **float[][]** | | +**document_url** | **string** | | +**permanent_document_url** | **string** | | +**path** | **string** | | +**parent_folder_id** | **string** | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FullTemplateDefaults.md b/docs/Model/FullTemplateDefaults.md deleted file mode 100644 index 126f41b..0000000 --- a/docs/Model/FullTemplateDefaults.md +++ /dev/null @@ -1,12 +0,0 @@ -# FullTemplateDefaults - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**color** | **string** | | [optional] -**font_size** | **float** | | [optional] -**typeface** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Model/HtmlTemplateData.md b/docs/Model/HtmlTemplateData.md index b0160fb..88ff8d3 100644 --- a/docs/Model/HtmlTemplateData.md +++ b/docs/Model/HtmlTemplateData.md @@ -1,26 +1,25 @@ -# HtmlTemplateData +# # HtmlTemplateData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**expiration_interval** | **string** | | [optional] -**webhook_url** | **string** | | [optional] -**scss** | **string** | | [optional] -**allow_additional_properties** | **bool** | | [optional] -**expire_after** | **float** | | [optional] -**description** | **string** | | [optional] -**public_submissions** | **bool** | | [optional] -**slack_webhook_url** | **string** | | [optional] -**header_html** | **string** | | [optional] -**public_web_form** | **bool** | | [optional] -**editable_submissions** | **bool** | | [optional] -**expire_submissions** | **bool** | | [optional] -**name** | **string** | | [optional] -**footer_html** | **string** | | [optional] -**html** | **string** | | [optional] -**template_type** | **string** | | [optional] -**redirect_url** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**allow_additional_properties** | **bool** | | [optional] +**description** | **string** | | [optional] +**editable_submissions** | **bool** | | [optional] +**expiration_interval** | **string** | | [optional] +**expire_after** | **float** | | [optional] +**expire_submissions** | **bool** | | [optional] +**footer_html** | **string** | | [optional] +**header_html** | **string** | | [optional] +**html** | **string** | | [optional] +**name** | **string** | | +**public_submissions** | **bool** | | [optional] +**public_web_form** | **bool** | | [optional] +**redirect_url** | **string** | | [optional] +**scss** | **string** | | [optional] +**slack_webhook_url** | **string** | | [optional] +**template_type** | **string** | | [optional] +**webhook_url** | **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/Model/InvalidRequest.md b/docs/Model/InvalidRequest.md index 46b52d9..05406cb 100644 --- a/docs/Model/InvalidRequest.md +++ b/docs/Model/InvalidRequest.md @@ -1,11 +1,10 @@ -# InvalidRequest +# # InvalidRequest ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**status** | **string** | | -**errors** | **string[]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**status** | **string** | | +**errors** | **string[]** | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ListSubmissionsResponse.md b/docs/Model/ListSubmissionsResponse.md index c0393a0..21ee75e 100644 --- a/docs/Model/ListSubmissionsResponse.md +++ b/docs/Model/ListSubmissionsResponse.md @@ -1,12 +1,11 @@ -# ListSubmissionsResponse +# # ListSubmissionsResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**next_cursor** | **string** | | [optional] -**submissions** | [**\DocSpring\Model\Submission[]**](Submission.md) | | [optional] -**limit** | **float** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**submissions** | [**\DocSpring\Model\Submission[]**](Submission.md) | | +**limit** | **float** | | +**next_cursor** | **string** | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MoveFolderData.md b/docs/Model/MoveFolderData.md index 238fc09..199491a 100644 --- a/docs/Model/MoveFolderData.md +++ b/docs/Model/MoveFolderData.md @@ -1,10 +1,9 @@ -# MoveFolderData +# # MoveFolderData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**parent_folder_id** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**parent_folder_id** | **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/Model/MoveTemplateData.md b/docs/Model/MoveTemplateData.md index c36509f..1df3a22 100644 --- a/docs/Model/MoveTemplateData.md +++ b/docs/Model/MoveTemplateData.md @@ -1,10 +1,9 @@ -# MoveTemplateData +# # MoveTemplateData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**parent_folder_id** | **string** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**parent_folder_id** | **string** | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PendingTemplate.md b/docs/Model/PendingTemplate.md index caccc77..ed6fcee 100644 --- a/docs/Model/PendingTemplate.md +++ b/docs/Model/PendingTemplate.md @@ -1,26 +1,25 @@ -# PendingTemplate +# # PendingTemplate ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**expiration_interval** | **string** | | [optional] -**webhook_url** | **string** | | [optional] -**parent_folder_id** | **string** | | [optional] -**expire_after** | **float** | | [optional] -**allow_additional_properties** | **bool** | | [optional] -**description** | **string** | | [optional] -**public_submissions** | **bool** | | [optional] -**slack_webhook_url** | **string** | | [optional] -**path** | **string** | | [optional] -**public_web_form** | **bool** | | [optional] -**editable_submissions** | **bool** | | [optional] -**expire_submissions** | **bool** | | [optional] -**name** | **string** | | [optional] -**template_type** | **string** | | [optional] -**id** | **string** | | [optional] -**locked** | **bool** | | [optional] -**redirect_url** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**id** | **string** | | +**name** | **string** | | +**description** | **string** | | +**template_type** | **string** | | +**public_web_form** | **bool** | | +**public_submissions** | **bool** | | +**expire_submissions** | **bool** | | +**expire_after** | **float** | | [optional] +**locked** | **bool** | | +**expiration_interval** | **string** | | [optional] +**allow_additional_properties** | **bool** | | +**editable_submissions** | **bool** | | +**webhook_url** | **string** | | +**slack_webhook_url** | **string** | | +**redirect_url** | **string** | | +**path** | **string** | | [optional] +**parent_folder_id** | **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/Model/RenameFolderData.md b/docs/Model/RenameFolderData.md index 1a5e9e4..c93c995 100644 --- a/docs/Model/RenameFolderData.md +++ b/docs/Model/RenameFolderData.md @@ -1,10 +1,9 @@ -# RenameFolderData +# # RenameFolderData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**name** | **string** | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Submission.md b/docs/Model/Submission.md index e7095f5..3af37e9 100644 --- a/docs/Model/Submission.md +++ b/docs/Model/Submission.md @@ -1,28 +1,27 @@ -# Submission +# # Submission ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | -**template_id** | **string** | | [optional] -**test** | **bool** | | -**editable** | **bool** | | [optional] -**expired** | **bool** | | -**expires_at** | **string** | | [optional] -**processed_at** | **string** | | [optional] -**state** | **string** | | -**data** | **object** | | [optional] -**metadata** | **object** | | [optional] -**truncated_text** | **object** | | [optional] -**pdf_hash** | **string** | | [optional] -**download_url** | **string** | | [optional] -**permanent_download_url** | **string** | | [optional] -**batch_id** | **string** | | [optional] -**data_requests** | [**\DocSpring\Model\SubmissionDataRequest[]**](SubmissionDataRequest.md) | | [optional] -**actions** | [**\DocSpring\Model\SubmissionAction[]**](SubmissionAction.md) | | [optional] -**source** | **string** | | [optional] -**referrer** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**id** | **string** | | +**template_id** | **string** | | [optional] +**test** | **bool** | | +**editable** | **bool** | | [optional] +**expired** | **bool** | | +**expires_at** | **string** | | [optional] +**processed_at** | **string** | | [optional] +**state** | **string** | | +**data** | **object** | | [optional] +**metadata** | **object** | | [optional] +**truncated_text** | **object** | | [optional] +**pdf_hash** | **string** | | [optional] +**download_url** | **string** | | [optional] +**permanent_download_url** | **string** | | [optional] +**batch_id** | **string** | | [optional] +**data_requests** | [**\DocSpring\Model\SubmissionDataRequest[]**](SubmissionDataRequest.md) | | [optional] +**actions** | [**\DocSpring\Model\SubmissionAction[]**](SubmissionAction.md) | | [optional] +**source** | **string** | | [optional] +**referrer** | **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/Model/SubmissionAction.md b/docs/Model/SubmissionAction.md index 04a1856..6cb95ae 100644 --- a/docs/Model/SubmissionAction.md +++ b/docs/Model/SubmissionAction.md @@ -1,15 +1,14 @@ -# SubmissionAction +# # SubmissionAction ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | -**integration_id** | **string** | | -**state** | **string** | | -**action_category** | **string** | | -**action_type** | **string** | | -**result_data** | **object** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - +**id** | **string** | | +**integration_id** | **string** | | +**state** | **string** | | +**action_category** | **string** | | +**action_type** | **string** | | +**result_data** | **object** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubmissionBatch.md b/docs/Model/SubmissionBatch.md index 228adc2..826d9b9 100644 --- a/docs/Model/SubmissionBatch.md +++ b/docs/Model/SubmissionBatch.md @@ -1,18 +1,17 @@ -# SubmissionBatch +# # SubmissionBatch ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pending_count** | **int** | | [optional] -**completion_percentage** | **int** | | [optional] -**metadata** | **object** | | [optional] -**total_count** | **int** | | [optional] -**submissions** | [**\DocSpring\Model\Submission[]**](Submission.md) | | [optional] -**processed_at** | **string** | | [optional] -**id** | **string** | | [optional] -**state** | **string** | | [optional] -**error_count** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**id** | **string** | | +**total_count** | **int** | | +**pending_count** | **int** | | +**error_count** | **int** | | +**completion_percentage** | **int** | | +**state** | **string** | | +**processed_at** | **string** | | +**metadata** | **object** | | +**submissions** | [**\DocSpring\Model\Submission[]**](Submission.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/Model/SubmissionBatchData.md b/docs/Model/SubmissionBatchData.md index 972a0c3..d4fc0b5 100644 --- a/docs/Model/SubmissionBatchData.md +++ b/docs/Model/SubmissionBatchData.md @@ -1,13 +1,12 @@ -# SubmissionBatchData +# # SubmissionBatchData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**metadata** | **object** | | [optional] -**submissions** | [**\DocSpring\Model\SubmissionDataBatchRequest[]**](SubmissionDataBatchRequest.md) | | -**template_id** | **string** | | [optional] -**test** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**metadata** | **object** | | [optional] +**submissions** | [**\DocSpring\Model\SubmissionDataBatchRequest[]**](SubmissionDataBatchRequest.md) | | +**template_id** | **string** | | [optional] +**test** | **bool** | | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubmissionData.md b/docs/Model/SubmissionData.md index 94f278e..8fa7caf 100644 --- a/docs/Model/SubmissionData.md +++ b/docs/Model/SubmissionData.md @@ -1,18 +1,14 @@ -# SubmissionData +# # SubmissionData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**css** | **string** | | [optional] -**data** | **object** | | -**data_requests** | [**\DocSpring\Model\CreateSubmissionDataRequestData[]**](CreateSubmissionDataRequestData.md) | | [optional] -**expires_in** | **int** | | [optional] -**field_overrides** | **object** | | [optional] -**html** | **string** | | [optional] -**metadata** | **object** | | [optional] -**password** | **string** | | [optional] -**test** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - +**css** | **string** | | [optional] +**data** | **object** | | +**data_requests** | [**\DocSpring\Model\CreateSubmissionDataRequestData[]**](CreateSubmissionDataRequestData.md) | | [optional] +**html** | **string** | | [optional] +**metadata** | **object** | | [optional] +**test** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubmissionDataBatchRequest.md b/docs/Model/SubmissionDataBatchRequest.md index 70e067b..0956626 100644 --- a/docs/Model/SubmissionDataBatchRequest.md +++ b/docs/Model/SubmissionDataBatchRequest.md @@ -1,15 +1,14 @@ -# SubmissionDataBatchRequest +# # SubmissionDataBatchRequest ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**css** | **string** | | [optional] -**metadata** | **object** | | [optional] -**data** | **object** | | [optional] -**test** | **bool** | | [optional] -**html** | **string** | | [optional] -**template_id** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - +**css** | **string** | | [optional] +**data** | **object** | | +**html** | **string** | | [optional] +**metadata** | **object** | | [optional] +**template_id** | **string** | | +**test** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubmissionDataRequest.md b/docs/Model/SubmissionDataRequest.md index b937cc7..5731075 100644 --- a/docs/Model/SubmissionDataRequest.md +++ b/docs/Model/SubmissionDataRequest.md @@ -1,30 +1,29 @@ -# SubmissionDataRequest +# # SubmissionDataRequest ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | -**submission_id** | **string** | | [optional] -**name** | **string** | | -**email** | **string** | | -**order** | **int** | | -**sort_order** | **int** | | -**fields** | **string[]** | | -**metadata** | **object** | | -**state** | **string** | | -**viewed_at** | **string** | | [optional] -**completed_at** | **string** | | [optional] -**auth_type** | **string** | | [optional] -**auth_second_factor_type** | **string** | | [optional] -**auth_provider** | **string** | | [optional] -**auth_session_started_at** | **string** | | [optional] -**auth_session_id_hash** | **string** | | [optional] -**auth_user_id_hash** | **string** | | [optional] -**auth_username_hash** | **string** | | [optional] -**auth_phone_number_hash** | **string** | | [optional] -**ip_address** | **string** | | [optional] -**user_agent** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**id** | **string** | | +**submission_id** | **string** | | [optional] +**name** | **string** | | +**email** | **string** | | +**order** | **int** | | +**sort_order** | **int** | | +**fields** | **string[]** | | +**metadata** | **object** | | +**state** | **string** | | +**viewed_at** | **string** | | [optional] +**completed_at** | **string** | | [optional] +**auth_type** | **string** | | [optional] +**auth_second_factor_type** | **string** | | [optional] +**auth_provider** | **string** | | [optional] +**auth_session_started_at** | **string** | | [optional] +**auth_session_id_hash** | **string** | | [optional] +**auth_user_id_hash** | **string** | | [optional] +**auth_username_hash** | **string** | | [optional] +**auth_phone_number_hash** | **string** | | [optional] +**ip_address** | **string** | | [optional] +**user_agent** | **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/Model/Template.md b/docs/Model/Template.md index 60574b6..0fc9915 100644 --- a/docs/Model/Template.md +++ b/docs/Model/Template.md @@ -1,29 +1,28 @@ -# Template +# # Template ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**expiration_interval** | **string** | | [optional] -**webhook_url** | **string** | | [optional] -**parent_folder_id** | **string** | | [optional] -**expire_after** | **float** | | [optional] -**allow_additional_properties** | **bool** | | [optional] -**description** | **string** | | [optional] -**public_submissions** | **bool** | | [optional] -**slack_webhook_url** | **string** | | [optional] -**path** | **string** | | [optional] -**public_web_form** | **bool** | | [optional] -**editable_submissions** | **bool** | | [optional] -**expire_submissions** | **bool** | | [optional] -**name** | **string** | | [optional] -**permanent_document_url** | **string** | | [optional] -**template_type** | **string** | | [optional] -**id** | **string** | | [optional] -**page_dimensions** | [**float[][]**](array.md) | | [optional] -**locked** | **bool** | | [optional] -**redirect_url** | **string** | | [optional] -**document_url** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**name** | **string** | | +**description** | **string** | | +**public_web_form** | **bool** | | +**public_submissions** | **bool** | | +**expire_submissions** | **bool** | | +**expire_after** | **float** | | +**expiration_interval** | **string** | | +**allow_additional_properties** | **bool** | | +**editable_submissions** | **bool** | | +**locked** | **bool** | | +**webhook_url** | **string** | | +**slack_webhook_url** | **string** | | +**redirect_url** | **string** | | +**id** | **string** | | +**template_type** | **string** | | +**page_dimensions** | **float[][]** | | +**document_url** | **string** | | +**permanent_document_url** | **string** | | +**path** | **string** | | +**parent_folder_id** | **string** | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TemplateData.md b/docs/Model/TemplateData.md index a073c23..0bd5b13 100644 --- a/docs/Model/TemplateData.md +++ b/docs/Model/TemplateData.md @@ -1,25 +1,24 @@ -# TemplateData +# # TemplateData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**expiration_interval** | **string** | | [optional] -**webhook_url** | **string** | | [optional] -**scss** | **string** | | [optional] -**allow_additional_properties** | **bool** | | [optional] -**expire_after** | **float** | | [optional] -**description** | **string** | | [optional] -**public_submissions** | **bool** | | [optional] -**slack_webhook_url** | **string** | | [optional] -**header_html** | **string** | | [optional] -**public_web_form** | **bool** | | [optional] -**editable_submissions** | **bool** | | [optional] -**expire_submissions** | **bool** | | [optional] -**name** | **string** | | [optional] -**footer_html** | **string** | | [optional] -**html** | **string** | | [optional] -**redirect_url** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**allow_additional_properties** | **bool** | | [optional] +**description** | **string** | | [optional] +**editable_submissions** | **bool** | | [optional] +**expiration_interval** | **string** | | [optional] +**expire_after** | **float** | | [optional] +**expire_submissions** | **bool** | | [optional] +**footer_html** | **string** | | [optional] +**header_html** | **string** | | [optional] +**html** | **string** | | [optional] +**name** | **string** | | [optional] +**public_submissions** | **bool** | | [optional] +**public_web_form** | **bool** | | [optional] +**redirect_url** | **string** | | [optional] +**scss** | **string** | | [optional] +**slack_webhook_url** | **string** | | [optional] +**webhook_url** | **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/Model/TemplateDefaults.md b/docs/Model/TemplateDefaults.md new file mode 100644 index 0000000..621f08f --- /dev/null +++ b/docs/Model/TemplateDefaults.md @@ -0,0 +1,11 @@ +# # TemplateDefaults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **string** | | +**font_size** | **float** | | +**typeface** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TemplateDocument.md b/docs/Model/TemplateDocument.md new file mode 100644 index 0000000..16d4027 --- /dev/null +++ b/docs/Model/TemplateDocument.md @@ -0,0 +1,11 @@ +# # TemplateDocument + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | +**metadata** | [**\DocSpring\Model\TemplateDocumentMetadata**](TemplateDocumentMetadata.md) | | +**storage** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TemplateDocumentMetadata.md b/docs/Model/TemplateDocumentMetadata.md new file mode 100644 index 0000000..8934777 --- /dev/null +++ b/docs/Model/TemplateDocumentMetadata.md @@ -0,0 +1,11 @@ +# # TemplateDocumentMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filename** | **string** | | +**mime_type** | **string** | | +**size** | **int** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TemplatestemplateIdaddFieldsFields.md b/docs/Model/TemplatestemplateIdaddFieldsFields.md deleted file mode 100644 index ba455d2..0000000 --- a/docs/Model/TemplatestemplateIdaddFieldsFields.md +++ /dev/null @@ -1,95 +0,0 @@ -# TemplatestemplateIdaddFieldsFields - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**background_color_field_name** | **string** | | [optional] -**uppercase** | **bool** | | [optional] -**metadata** | **string** | | [optional] -**barcode_symbology** | **string** | | [optional] -**min_length** | **float** | | [optional] -**integer** | **bool** | | [optional] -**type** | **string** | | [optional] -**required** | **bool** | | [optional] -**comb_value_offset** | **float** | | [optional] -**image_gravity** | **string** | | [optional] -**overflow** | **string** | | [optional] -**qrcode_color** | **string** | | [optional] -**color_field_required** | **bool** | | [optional] -**background_color_field_required** | **bool** | | [optional] -**id** | **float** | | [optional] -**image_scale_type** | **string** | | [optional] -**exclusive_minimum** | **bool** | | [optional] -**height** | **float** | | [optional] -**number_condition_range_exclusive_max** | **bool** | | [optional] -**invert_boolean_condition** | **bool** | | [optional] -**shape_fill_color_field_name** | **string** | | [optional] -**static** | **bool** | | [optional] -**shape_border_color_field_name** | **string** | | [optional] -**v_alignment** | **string** | | [optional] -**bold** | **bool** | | [optional] -**shape_border_width** | **float** | | [optional] -**comb_number_of_cells** | **float** | | [optional] -**shape_border_color** | **string** | | [optional] -**comb** | **bool** | | [optional] -**typeface** | **string** | | [optional] -**shape_type** | **string** | | [optional] -**condition** | **string** | | [optional] -**display_type** | **string** | | [optional] -**check_color** | **string** | | [optional] -**multiline_lines** | **float** | | [optional] -**multiline** | **bool** | | [optional] -**true_text** | **string** | | [optional] -**name** | **string** | | [optional] -**font_size** | **float** | | [optional] -**page** | **float** | | [optional] -**alignment** | **string** | | [optional] -**max_length** | **float** | | [optional] -**auto_calculate_max_length** | **bool** | | [optional] -**color_field_name** | **string** | | [optional] -**qrcode_color_field_name** | **string** | | [optional] -**number_condition_range_min** | **float** | | [optional] -**color** | **string** | | [optional] -**hidden** | **bool** | | [optional] -**check_color_field_required** | **bool** | | [optional] -**combined_field_format** | **string** | | [optional] -**description** | **string** | | [optional] -**shape_border_color_field_required** | **bool** | | [optional] -**combined_field_names** | **string** | | [optional] -**title** | **string** | | [optional] -**number_condition_range_exclusive_min** | **bool** | | [optional] -**combined_field_separator** | **string** | | [optional] -**exclusive_maximum** | **bool** | | [optional] -**default** | **string** | | [optional] -**combined_field_type** | **string** | | [optional] -**date_time_format** | **string** | | [optional] -**qrcode_color_field_required** | **bool** | | [optional] -**currency** | **bool** | | [optional] -**false_text** | **string** | | [optional] -**placeholder** | **string** | | [optional] -**strikethrough** | **bool** | | [optional] -**character_spacing** | **float** | | [optional] -**number_condition_range_max** | **float** | | [optional] -**background_color** | **string** | | [optional] -**check_color_field_name** | **string** | | [optional] -**check_character** | **string** | | [optional] -**rotation** | **float** | | [optional] -**option_list** | **string** | | [optional] -**shape_fill_color** | **string** | | [optional] -**string_condition_type** | **string** | | [optional] -**shape_fill_color_field_required** | **bool** | | [optional] -**decimal_places** | **float** | | [optional] -**include_time** | **bool** | | [optional] -**width** | **float** | | [optional] -**x** | **float** | | [optional] -**maximum** | **float** | | [optional] -**y** | **float** | | [optional] -**signature_allow_draw** | **bool** | | [optional] -**number_condition_type** | **string** | | [optional] -**opacity** | **float** | | [optional] -**minimum** | **float** | | [optional] -**signature_allow_type** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Model/UpdateDataRequestResponse.md b/docs/Model/UpdateDataRequestResponse.md index d42b4e0..dd63411 100644 --- a/docs/Model/UpdateDataRequestResponse.md +++ b/docs/Model/UpdateDataRequestResponse.md @@ -1,12 +1,11 @@ -# UpdateDataRequestResponse +# # UpdateDataRequestResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data_request** | [**\DocSpring\Model\SubmissionDataRequest**](SubmissionDataRequest.md) | | [optional] -**errors** | **string[]** | | [optional] -**status** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**status** | **string** | | +**errors** | **string[]** | | [optional] +**data_request** | [**\DocSpring\Model\SubmissionDataRequest**](SubmissionDataRequest.md) | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateSubmissionDataRequestData.md b/docs/Model/UpdateSubmissionDataRequestData.md index b2a7441..06f0be2 100644 --- a/docs/Model/UpdateSubmissionDataRequestData.md +++ b/docs/Model/UpdateSubmissionDataRequestData.md @@ -1,22 +1,21 @@ -# UpdateSubmissionDataRequestData +# # UpdateSubmissionDataRequestData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**auth_phone_number_hash** | **string** | | [optional] -**auth_provider** | **string** | | [optional] -**auth_second_factor_type** | **string** | | [optional] -**auth_session_id_hash** | **string** | | [optional] -**auth_session_started_at** | **string** | | [optional] -**auth_type** | **string** | | [optional] -**auth_user_id_hash** | **string** | | [optional] -**auth_username_hash** | **string** | | [optional] -**email** | **string** | | [optional] -**fields** | **string[]** | | [optional] -**metadata** | **object** | | [optional] -**name** | **string** | | [optional] -**order** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**auth_phone_number_hash** | **string** | | [optional] +**auth_provider** | **string** | | [optional] +**auth_second_factor_type** | **string** | | [optional] +**auth_session_id_hash** | **string** | | [optional] +**auth_session_started_at** | **string** | | [optional] +**auth_type** | **string** | | [optional] +**auth_user_id_hash** | **string** | | [optional] +**auth_username_hash** | **string** | | [optional] +**email** | **string** | | [optional] +**fields** | **string[]** | | [optional] +**metadata** | **object** | | [optional] +**name** | **string** | | [optional] +**order** | **int** | | [optional] +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateTemplateData.md b/docs/Model/UpdateTemplateData.md index b6f1bb6..5b3b4c9 100644 --- a/docs/Model/UpdateTemplateData.md +++ b/docs/Model/UpdateTemplateData.md @@ -1,10 +1,9 @@ -# UpdateTemplateData +# # UpdateTemplateData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**template** | [**\DocSpring\Model\TemplateData**](TemplateData.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**template** | [**\DocSpring\Model\TemplateData**](TemplateData.md) | | +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateTemplateResponse.md b/docs/Model/UpdateTemplateResponse.md index aad14ca..14673f6 100644 --- a/docs/Model/UpdateTemplateResponse.md +++ b/docs/Model/UpdateTemplateResponse.md @@ -1,11 +1,10 @@ -# UpdateTemplateResponse +# # UpdateTemplateResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | **string[]** | | [optional] -**status** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**status** | **string** | | +**errors** | **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/Model/UploadTemplateData.md b/docs/Model/UploadTemplateData.md index 4d50d1b..e6d7e28 100644 --- a/docs/Model/UploadTemplateData.md +++ b/docs/Model/UploadTemplateData.md @@ -1,27 +1,26 @@ -# UploadTemplateData +# # UploadTemplateData ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**expiration_interval** | **string** | | [optional] -**webhook_url** | **string** | | [optional] -**scss** | **string** | | [optional] -**allow_additional_properties** | **bool** | | [optional] -**document** | [**\DocSpring\Model\UploadTemplateDataDocument**](UploadTemplateDataDocument.md) | | [optional] -**expire_after** | **float** | | [optional] -**description** | **string** | | [optional] -**public_submissions** | **bool** | | [optional] -**slack_webhook_url** | **string** | | [optional] -**header_html** | **string** | | [optional] -**public_web_form** | **bool** | | [optional] -**editable_submissions** | **bool** | | [optional] -**expire_submissions** | **bool** | | [optional] -**name** | **string** | | [optional] -**footer_html** | **string** | | [optional] -**html** | **string** | | [optional] -**template_type** | **string** | | [optional] -**redirect_url** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +**allow_additional_properties** | **bool** | | [optional] +**description** | **string** | | [optional] +**document** | [**\DocSpring\Model\TemplateDocument**](TemplateDocument.md) | | [optional] +**editable_submissions** | **bool** | | [optional] +**expiration_interval** | **string** | | [optional] +**expire_after** | **float** | | [optional] +**expire_submissions** | **bool** | | [optional] +**footer_html** | **string** | | [optional] +**header_html** | **string** | | [optional] +**html** | **string** | | [optional] +**name** | **string** | | +**public_submissions** | **bool** | | [optional] +**public_web_form** | **bool** | | [optional] +**redirect_url** | **string** | | [optional] +**scss** | **string** | | [optional] +**slack_webhook_url** | **string** | | [optional] +**template_type** | **string** | | [optional] +**webhook_url** | **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/Model/UploadTemplateDataDocument.md b/docs/Model/UploadTemplateDataDocument.md deleted file mode 100644 index 3f6e75c..0000000 --- a/docs/Model/UploadTemplateDataDocument.md +++ /dev/null @@ -1,12 +0,0 @@ -# UploadTemplateDataDocument - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**metadata** | [**\DocSpring\Model\UploadTemplateDataDocumentMetadata**](UploadTemplateDataDocumentMetadata.md) | | [optional] -**id** | **string** | | [optional] -**storage** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Model/UploadTemplateDataDocumentMetadata.md b/docs/Model/UploadTemplateDataDocumentMetadata.md deleted file mode 100644 index a62b088..0000000 --- a/docs/Model/UploadTemplateDataDocumentMetadata.md +++ /dev/null @@ -1,12 +0,0 @@ -# UploadTemplateDataDocumentMetadata - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**filename** | **string** | | [optional] -**size** | **int** | | [optional] -**mime_type** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/git_push.sh b/git_push.sh index 5515e39..cd8c77a 100644 --- a/git_push.sh +++ b/git_push.sh @@ -1,11 +1,17 @@ #!/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-pestore-perl "minor update" +# 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="docspring" @@ -32,14 +38,14 @@ git add . git commit -m "$release_note" # Sets the new remote -git_remote=`git 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://github.com/${git_user_id}/${git_repo_id}.git + 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}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,5 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +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/lib/Api/PDFApi.php b/lib/Api/PDFApi.php index 77afa19..94012f3 100644 --- a/lib/Api/PDFApi.php +++ b/lib/Api/PDFApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'batchGeneratePdfV1' => [ + 'application/json', + ], + 'batchGeneratePdfs' => [ + 'application/json', + ], + 'combinePdfs' => [ + 'application/json', + ], + 'combineSubmissions' => [ + 'application/json', + ], + 'copyTemplate' => [ + 'application/json', + ], + 'createCustomFileFromUpload' => [ + 'application/json', + ], + 'createDataRequestToken' => [ + 'application/json', + ], + 'createFolder' => [ + 'application/json', + ], + 'createHTMLTemplate' => [ + 'application/json', + ], + 'createPDFTemplate' => [ + 'multipart/form-data', + ], + 'createPDFTemplateFromUpload' => [ + 'application/json', + ], + 'deleteFolder' => [ + 'application/json', + ], + 'deleteTemplate' => [ + 'application/json', + ], + 'expireCombinedSubmission' => [ + 'application/json', + ], + 'expireSubmission' => [ + 'application/json', + ], + 'generatePDF' => [ + 'application/json', + ], + 'getCombinedSubmission' => [ + 'application/json', + ], + 'getDataRequest' => [ + 'application/json', + ], + 'getFullTemplate' => [ + 'application/json', + ], + 'getPresignUrl' => [ + 'application/json', + ], + 'getSubmission' => [ + 'application/json', + ], + 'getSubmissionBatch' => [ + 'application/json', + ], + 'getTemplate' => [ + 'application/json', + ], + 'getTemplateSchema' => [ + 'application/json', + ], + 'listCombinedSubmissions' => [ + 'application/json', + ], + 'listFolders' => [ + 'application/json', + ], + 'listSubmissions' => [ + 'application/json', + ], + 'listTemplateSubmissions' => [ + 'application/json', + ], + 'listTemplates' => [ + 'application/json', + ], + 'moveFolderToFolder' => [ + 'application/json', + ], + 'moveTemplateToFolder' => [ + 'application/json', + ], + 'renameFolder' => [ + 'application/json', + ], + 'testAuthentication' => [ + 'application/json', + ], + 'updateDataRequest' => [ + 'application/json', + ], + 'updateTemplate' => [ + 'application/json', + ], + ]; + +/** * @param ClientInterface $client * @param Configuration $config * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( ClientInterface $client = null, Configuration $config = null, - HeaderSelector $selector = null + HeaderSelector $selector = null, + $hostIndex = 0 ) { $this->client = $client ?: new Client(); $this->config = $config ?: new Configuration(); $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; } /** @@ -93,15 +233,16 @@ public function getConfig() * Add new fields to a Template * * @param string $template_id template_id (required) - * @param \DocSpring\Model\AddFieldsData $add_fields_data add_fields_data (required) + * @param \DocSpring\Model\AddFieldsData $data data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addFieldsToTemplate'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \DocSpring\Model\AddFieldsTemplateResponse|\DocSpring\Model\AddFieldsTemplateResponse */ - public function addFieldsToTemplate($template_id, $add_fields_data) + public function addFieldsToTemplate($template_id, $data, string $contentType = self::contentTypes['addFieldsToTemplate'][0]) { - list($response) = $this->addFieldsToTemplateWithHttpInfo($template_id, $add_fields_data); + list($response) = $this->addFieldsToTemplateWithHttpInfo($template_id, $data, $contentType); return $response; } @@ -111,15 +252,16 @@ public function addFieldsToTemplate($template_id, $add_fields_data) * Add new fields to a Template * * @param string $template_id (required) - * @param \DocSpring\Model\AddFieldsData $add_fields_data (required) + * @param \DocSpring\Model\AddFieldsData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addFieldsToTemplate'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \DocSpring\Model\AddFieldsTemplateResponse|\DocSpring\Model\AddFieldsTemplateResponse, HTTP status code, HTTP response headers (array of strings) */ - public function addFieldsToTemplateWithHttpInfo($template_id, $add_fields_data) + public function addFieldsToTemplateWithHttpInfo($template_id, $data, string $contentType = self::contentTypes['addFieldsToTemplate'][0]) { - $request = $this->addFieldsToTemplateRequest($template_id, $add_fields_data); + $request = $this->addFieldsToTemplateRequest($template_id, $data, $contentType); try { $options = $this->createHttpClientOption(); @@ -128,9 +270,16 @@ public function addFieldsToTemplateWithHttpInfo($template_id, $add_fields_data) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -141,21 +290,35 @@ public function addFieldsToTemplateWithHttpInfo($template_id, $add_fields_data) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\DocSpring\Model\AddFieldsTemplateResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AddFieldsTemplateResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -165,9 +328,24 @@ public function addFieldsToTemplateWithHttpInfo($template_id, $add_fields_data) ]; case 422: if ('\DocSpring\Model\AddFieldsTemplateResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AddFieldsTemplateResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -178,11 +356,25 @@ public function addFieldsToTemplateWithHttpInfo($template_id, $add_fields_data) } $returnType = '\DocSpring\Model\AddFieldsTemplateResponse'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -220,14 +412,15 @@ public function addFieldsToTemplateWithHttpInfo($template_id, $add_fields_data) * Add new fields to a Template * * @param string $template_id (required) - * @param \DocSpring\Model\AddFieldsData $add_fields_data (required) + * @param \DocSpring\Model\AddFieldsData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addFieldsToTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addFieldsToTemplateAsync($template_id, $add_fields_data) + public function addFieldsToTemplateAsync($template_id, $data, string $contentType = self::contentTypes['addFieldsToTemplate'][0]) { - return $this->addFieldsToTemplateAsyncWithHttpInfo($template_id, $add_fields_data) + return $this->addFieldsToTemplateAsyncWithHttpInfo($template_id, $data, $contentType) ->then( function ($response) { return $response[0]; @@ -241,25 +434,28 @@ function ($response) { * Add new fields to a Template * * @param string $template_id (required) - * @param \DocSpring\Model\AddFieldsData $add_fields_data (required) + * @param \DocSpring\Model\AddFieldsData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addFieldsToTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addFieldsToTemplateAsyncWithHttpInfo($template_id, $add_fields_data) + public function addFieldsToTemplateAsyncWithHttpInfo($template_id, $data, string $contentType = self::contentTypes['addFieldsToTemplate'][0]) { $returnType = '\DocSpring\Model\AddFieldsTemplateResponse'; - $request = $this->addFieldsToTemplateRequest($template_id, $add_fields_data); + $request = $this->addFieldsToTemplateRequest($template_id, $data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -279,7 +475,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -289,26 +485,30 @@ function ($exception) { * Create request for operation 'addFieldsToTemplate' * * @param string $template_id (required) - * @param \DocSpring\Model\AddFieldsData $add_fields_data (required) + * @param \DocSpring\Model\AddFieldsData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addFieldsToTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function addFieldsToTemplateRequest($template_id, $add_fields_data) + public function addFieldsToTemplateRequest($template_id, $data, string $contentType = self::contentTypes['addFieldsToTemplate'][0]) { + // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $template_id when calling addFieldsToTemplate' ); } - // verify the required parameter 'add_fields_data' is set - if ($add_fields_data === null || (is_array($add_fields_data) && count($add_fields_data) === 0)) { + + // verify the required parameter 'data' is set + if ($data === null || (is_array($data) && count($data) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $add_fields_data when calling addFieldsToTemplate' + 'Missing the required parameter $data when calling addFieldsToTemplate' ); } + $resourcePath = '/templates/{template_id}/add_fields'; $formParams = []; $queryParams = []; @@ -317,6 +517,7 @@ protected function addFieldsToTemplateRequest($template_id, $add_fields_data) $multipart = false; + // path params if ($template_id !== null) { $resourcePath = str_replace( @@ -326,54 +527,47 @@ protected function addFieldsToTemplateRequest($template_id, $add_fields_data) ); } - // body params - $_tempBody = null; - if (isset($add_fields_data)) { - $_tempBody = $add_fields_data; - } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + if (isset($data)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($data)); } else { - $httpBody = $_tempBody; + $httpBody = $data; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -388,10 +582,11 @@ protected function addFieldsToTemplateRequest($template_id, $add_fields_data) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -403,15 +598,16 @@ protected function addFieldsToTemplateRequest($template_id, $add_fields_data) * Generates multiple PDFs * * @param string $template_id template_id (required) - * @param object[] $request_body request_body (required) + * @param \DocSpring\Model\SubmissionData[] $data data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['batchGeneratePdfV1'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\CreateSubmissionResponse[]|\DocSpring\Model\Error|\DocSpring\Model\AuthenticationError|\DocSpring\Model\InvalidRequest[] + * @return \DocSpring\Model\CreateSubmissionResponse[]|\DocSpring\Model\InvalidRequest[]|\DocSpring\Model\AuthenticationError|\DocSpring\Model\ErrorResponse */ - public function batchGeneratePdfV1($template_id, $request_body) + public function batchGeneratePdfV1($template_id, $data, string $contentType = self::contentTypes['batchGeneratePdfV1'][0]) { - list($response) = $this->batchGeneratePdfV1WithHttpInfo($template_id, $request_body); + list($response) = $this->batchGeneratePdfV1WithHttpInfo($template_id, $data, $contentType); return $response; } @@ -421,15 +617,16 @@ public function batchGeneratePdfV1($template_id, $request_body) * Generates multiple PDFs * * @param string $template_id (required) - * @param object[] $request_body (required) + * @param \DocSpring\Model\SubmissionData[] $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['batchGeneratePdfV1'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\CreateSubmissionResponse[]|\DocSpring\Model\Error|\DocSpring\Model\AuthenticationError|\DocSpring\Model\InvalidRequest[], HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\CreateSubmissionResponse[]|\DocSpring\Model\InvalidRequest[]|\DocSpring\Model\AuthenticationError|\DocSpring\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function batchGeneratePdfV1WithHttpInfo($template_id, $request_body) + public function batchGeneratePdfV1WithHttpInfo($template_id, $data, string $contentType = self::contentTypes['batchGeneratePdfV1'][0]) { - $request = $this->batchGeneratePdfV1Request($template_id, $request_body); + $request = $this->batchGeneratePdfV1Request($template_id, $data, $contentType); try { $options = $this->createHttpClientOption(); @@ -438,9 +635,16 @@ public function batchGeneratePdfV1WithHttpInfo($template_id, $request_body) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -451,21 +655,35 @@ public function batchGeneratePdfV1WithHttpInfo($template_id, $request_body) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\DocSpring\Model\CreateSubmissionResponse[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\CreateSubmissionResponse[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -473,23 +691,53 @@ public function batchGeneratePdfV1WithHttpInfo($template_id, $request_body) $response->getStatusCode(), $response->getHeaders() ]; - case 400: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 422: + if ('\DocSpring\Model\InvalidRequest[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\InvalidRequest[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\InvalidRequest[]', []), $response->getStatusCode(), $response->getHeaders() ]; case 401: if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -497,26 +745,55 @@ public function batchGeneratePdfV1WithHttpInfo($template_id, $request_body) $response->getStatusCode(), $response->getHeaders() ]; - case 422: - if ('\DocSpring\Model\InvalidRequest[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 400: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\InvalidRequest[]', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\DocSpring\Model\CreateSubmissionResponse[]'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -535,10 +812,10 @@ public function batchGeneratePdfV1WithHttpInfo($template_id, $request_body) ); $e->setResponseObject($data); break; - case 400: + case 422: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\InvalidRequest[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -551,10 +828,10 @@ public function batchGeneratePdfV1WithHttpInfo($template_id, $request_body) ); $e->setResponseObject($data); break; - case 422: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\InvalidRequest[]', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -570,14 +847,15 @@ public function batchGeneratePdfV1WithHttpInfo($template_id, $request_body) * Generates multiple PDFs * * @param string $template_id (required) - * @param object[] $request_body (required) + * @param \DocSpring\Model\SubmissionData[] $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['batchGeneratePdfV1'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function batchGeneratePdfV1Async($template_id, $request_body) + public function batchGeneratePdfV1Async($template_id, $data, string $contentType = self::contentTypes['batchGeneratePdfV1'][0]) { - return $this->batchGeneratePdfV1AsyncWithHttpInfo($template_id, $request_body) + return $this->batchGeneratePdfV1AsyncWithHttpInfo($template_id, $data, $contentType) ->then( function ($response) { return $response[0]; @@ -591,25 +869,28 @@ function ($response) { * Generates multiple PDFs * * @param string $template_id (required) - * @param object[] $request_body (required) + * @param \DocSpring\Model\SubmissionData[] $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['batchGeneratePdfV1'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function batchGeneratePdfV1AsyncWithHttpInfo($template_id, $request_body) + public function batchGeneratePdfV1AsyncWithHttpInfo($template_id, $data, string $contentType = self::contentTypes['batchGeneratePdfV1'][0]) { $returnType = '\DocSpring\Model\CreateSubmissionResponse[]'; - $request = $this->batchGeneratePdfV1Request($template_id, $request_body); + $request = $this->batchGeneratePdfV1Request($template_id, $data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -629,7 +910,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -639,26 +920,30 @@ function ($exception) { * Create request for operation 'batchGeneratePdfV1' * * @param string $template_id (required) - * @param object[] $request_body (required) + * @param \DocSpring\Model\SubmissionData[] $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['batchGeneratePdfV1'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function batchGeneratePdfV1Request($template_id, $request_body) + public function batchGeneratePdfV1Request($template_id, $data, string $contentType = self::contentTypes['batchGeneratePdfV1'][0]) { + // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $template_id when calling batchGeneratePdfV1' ); } - // verify the required parameter 'request_body' is set - if ($request_body === null || (is_array($request_body) && count($request_body) === 0)) { + + // verify the required parameter 'data' is set + if ($data === null || (is_array($data) && count($data) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $request_body when calling batchGeneratePdfV1' + 'Missing the required parameter $data when calling batchGeneratePdfV1' ); } + $resourcePath = '/templates/{template_id}/submissions/batch'; $formParams = []; $queryParams = []; @@ -667,6 +952,7 @@ protected function batchGeneratePdfV1Request($template_id, $request_body) $multipart = false; + // path params if ($template_id !== null) { $resourcePath = str_replace( @@ -676,54 +962,47 @@ protected function batchGeneratePdfV1Request($template_id, $request_body) ); } - // body params - $_tempBody = null; - if (isset($request_body)) { - $_tempBody = $request_body; - } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + if (isset($data)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($data)); } else { - $httpBody = $_tempBody; + $httpBody = $data; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -738,10 +1017,11 @@ protected function batchGeneratePdfV1Request($template_id, $request_body) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -752,15 +1032,16 @@ protected function batchGeneratePdfV1Request($template_id, $request_body) * * Generates multiple PDFs * - * @param \DocSpring\Model\SubmissionBatchData $submission_batch_data submission_batch_data (required) + * @param \DocSpring\Model\SubmissionBatchData $data data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['batchGeneratePdfs'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\CreateSubmissionBatchResponse|\DocSpring\Model\CreateSubmissionBatchResponse|\DocSpring\Model\Error|\DocSpring\Model\AuthenticationError + * @return \DocSpring\Model\CreateSubmissionBatchResponse|\DocSpring\Model\CreateSubmissionBatchResponse|\DocSpring\Model\AuthenticationError|\DocSpring\Model\ErrorResponse */ - public function batchGeneratePdfs($submission_batch_data) + public function batchGeneratePdfs($data, string $contentType = self::contentTypes['batchGeneratePdfs'][0]) { - list($response) = $this->batchGeneratePdfsWithHttpInfo($submission_batch_data); + list($response) = $this->batchGeneratePdfsWithHttpInfo($data, $contentType); return $response; } @@ -769,15 +1050,16 @@ public function batchGeneratePdfs($submission_batch_data) * * Generates multiple PDFs * - * @param \DocSpring\Model\SubmissionBatchData $submission_batch_data (required) + * @param \DocSpring\Model\SubmissionBatchData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['batchGeneratePdfs'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\CreateSubmissionBatchResponse|\DocSpring\Model\CreateSubmissionBatchResponse|\DocSpring\Model\Error|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\CreateSubmissionBatchResponse|\DocSpring\Model\CreateSubmissionBatchResponse|\DocSpring\Model\AuthenticationError|\DocSpring\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function batchGeneratePdfsWithHttpInfo($submission_batch_data) + public function batchGeneratePdfsWithHttpInfo($data, string $contentType = self::contentTypes['batchGeneratePdfs'][0]) { - $request = $this->batchGeneratePdfsRequest($submission_batch_data); + $request = $this->batchGeneratePdfsRequest($data, $contentType); try { $options = $this->createHttpClientOption(); @@ -786,9 +1068,16 @@ public function batchGeneratePdfsWithHttpInfo($submission_batch_data) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -799,21 +1088,35 @@ public function batchGeneratePdfsWithHttpInfo($submission_batch_data) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { - case 200: + case 201: if ('\DocSpring\Model\CreateSubmissionBatchResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\CreateSubmissionBatchResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -821,11 +1124,26 @@ public function batchGeneratePdfsWithHttpInfo($submission_batch_data) $response->getStatusCode(), $response->getHeaders() ]; - case 201: + case 200: if ('\DocSpring\Model\CreateSubmissionBatchResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\CreateSubmissionBatchResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -833,38 +1151,82 @@ public function batchGeneratePdfsWithHttpInfo($submission_batch_data) $response->getStatusCode(), $response->getHeaders() ]; - case 400: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 400: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\DocSpring\Model\CreateSubmissionBatchResponse'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -875,7 +1237,7 @@ public function batchGeneratePdfsWithHttpInfo($submission_batch_data) } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\DocSpring\Model\CreateSubmissionBatchResponse', @@ -883,7 +1245,7 @@ public function batchGeneratePdfsWithHttpInfo($submission_batch_data) ); $e->setResponseObject($data); break; - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\DocSpring\Model\CreateSubmissionBatchResponse', @@ -891,18 +1253,18 @@ public function batchGeneratePdfsWithHttpInfo($submission_batch_data) ); $e->setResponseObject($data); break; - case 400: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\AuthenticationError', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\AuthenticationError', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -917,14 +1279,15 @@ public function batchGeneratePdfsWithHttpInfo($submission_batch_data) * * Generates multiple PDFs * - * @param \DocSpring\Model\SubmissionBatchData $submission_batch_data (required) + * @param \DocSpring\Model\SubmissionBatchData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['batchGeneratePdfs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function batchGeneratePdfsAsync($submission_batch_data) + public function batchGeneratePdfsAsync($data, string $contentType = self::contentTypes['batchGeneratePdfs'][0]) { - return $this->batchGeneratePdfsAsyncWithHttpInfo($submission_batch_data) + return $this->batchGeneratePdfsAsyncWithHttpInfo($data, $contentType) ->then( function ($response) { return $response[0]; @@ -937,25 +1300,28 @@ function ($response) { * * Generates multiple PDFs * - * @param \DocSpring\Model\SubmissionBatchData $submission_batch_data (required) + * @param \DocSpring\Model\SubmissionBatchData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['batchGeneratePdfs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function batchGeneratePdfsAsyncWithHttpInfo($submission_batch_data) + public function batchGeneratePdfsAsyncWithHttpInfo($data, string $contentType = self::contentTypes['batchGeneratePdfs'][0]) { $returnType = '\DocSpring\Model\CreateSubmissionBatchResponse'; - $request = $this->batchGeneratePdfsRequest($submission_batch_data); + $request = $this->batchGeneratePdfsRequest($data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -975,7 +1341,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -984,20 +1350,23 @@ function ($exception) { /** * Create request for operation 'batchGeneratePdfs' * - * @param \DocSpring\Model\SubmissionBatchData $submission_batch_data (required) + * @param \DocSpring\Model\SubmissionBatchData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['batchGeneratePdfs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function batchGeneratePdfsRequest($submission_batch_data) + public function batchGeneratePdfsRequest($data, string $contentType = self::contentTypes['batchGeneratePdfs'][0]) { - // verify the required parameter 'submission_batch_data' is set - if ($submission_batch_data === null || (is_array($submission_batch_data) && count($submission_batch_data) === 0)) { + + // verify the required parameter 'data' is set + if ($data === null || (is_array($data) && count($data) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $submission_batch_data when calling batchGeneratePdfs' + 'Missing the required parameter $data when calling batchGeneratePdfs' ); } + $resourcePath = '/submissions/batches'; $formParams = []; $queryParams = []; @@ -1007,54 +1376,48 @@ protected function batchGeneratePdfsRequest($submission_batch_data) - // body params - $_tempBody = null; - if (isset($submission_batch_data)) { - $_tempBody = $submission_batch_data; - } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + if (isset($data)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($data)); } else { - $httpBody = $_tempBody; + $httpBody = $data; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -1069,10 +1432,11 @@ protected function batchGeneratePdfsRequest($submission_batch_data) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1083,15 +1447,16 @@ protected function batchGeneratePdfsRequest($submission_batch_data) * * Merge submission PDFs, template PDFs, or custom files * - * @param \DocSpring\Model\CombinePdfsData $combine_pdfs_data combine_pdfs_data (required) + * @param \DocSpring\Model\CombinePdfsData $data data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['combinePdfs'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\CreateCombinedSubmissionResponse|\DocSpring\Model\Error|\DocSpring\Model\AuthenticationError|\DocSpring\Model\InvalidRequest + * @return \DocSpring\Model\CreateCombinedSubmissionResponse|\DocSpring\Model\InvalidRequest|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError */ - public function combinePdfs($combine_pdfs_data) + public function combinePdfs($data, string $contentType = self::contentTypes['combinePdfs'][0]) { - list($response) = $this->combinePdfsWithHttpInfo($combine_pdfs_data); + list($response) = $this->combinePdfsWithHttpInfo($data, $contentType); return $response; } @@ -1100,15 +1465,16 @@ public function combinePdfs($combine_pdfs_data) * * Merge submission PDFs, template PDFs, or custom files * - * @param \DocSpring\Model\CombinePdfsData $combine_pdfs_data (required) + * @param \DocSpring\Model\CombinePdfsData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['combinePdfs'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\CreateCombinedSubmissionResponse|\DocSpring\Model\Error|\DocSpring\Model\AuthenticationError|\DocSpring\Model\InvalidRequest, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\CreateCombinedSubmissionResponse|\DocSpring\Model\InvalidRequest|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function combinePdfsWithHttpInfo($combine_pdfs_data) + public function combinePdfsWithHttpInfo($data, string $contentType = self::contentTypes['combinePdfs'][0]) { - $request = $this->combinePdfsRequest($combine_pdfs_data); + $request = $this->combinePdfsRequest($data, $contentType); try { $options = $this->createHttpClientOption(); @@ -1117,9 +1483,16 @@ public function combinePdfsWithHttpInfo($combine_pdfs_data) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -1130,21 +1503,35 @@ public function combinePdfsWithHttpInfo($combine_pdfs_data) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\DocSpring\Model\CreateCombinedSubmissionResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\CreateCombinedSubmissionResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1152,50 +1539,109 @@ public function combinePdfsWithHttpInfo($combine_pdfs_data) $response->getStatusCode(), $response->getHeaders() ]; - case 400: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 422: + if ('\DocSpring\Model\InvalidRequest' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\InvalidRequest' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\InvalidRequest', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 400: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 422: - if ('\DocSpring\Model\InvalidRequest' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\InvalidRequest', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\DocSpring\Model\CreateCombinedSubmissionResponse'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1214,26 +1660,26 @@ public function combinePdfsWithHttpInfo($combine_pdfs_data) ); $e->setResponseObject($data); break; - case 400: + case 422: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\InvalidRequest', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\AuthenticationError', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 422: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\InvalidRequest', + '\DocSpring\Model\AuthenticationError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1248,14 +1694,15 @@ public function combinePdfsWithHttpInfo($combine_pdfs_data) * * Merge submission PDFs, template PDFs, or custom files * - * @param \DocSpring\Model\CombinePdfsData $combine_pdfs_data (required) + * @param \DocSpring\Model\CombinePdfsData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['combinePdfs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function combinePdfsAsync($combine_pdfs_data) + public function combinePdfsAsync($data, string $contentType = self::contentTypes['combinePdfs'][0]) { - return $this->combinePdfsAsyncWithHttpInfo($combine_pdfs_data) + return $this->combinePdfsAsyncWithHttpInfo($data, $contentType) ->then( function ($response) { return $response[0]; @@ -1268,25 +1715,28 @@ function ($response) { * * Merge submission PDFs, template PDFs, or custom files * - * @param \DocSpring\Model\CombinePdfsData $combine_pdfs_data (required) + * @param \DocSpring\Model\CombinePdfsData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['combinePdfs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function combinePdfsAsyncWithHttpInfo($combine_pdfs_data) + public function combinePdfsAsyncWithHttpInfo($data, string $contentType = self::contentTypes['combinePdfs'][0]) { $returnType = '\DocSpring\Model\CreateCombinedSubmissionResponse'; - $request = $this->combinePdfsRequest($combine_pdfs_data); + $request = $this->combinePdfsRequest($data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1306,7 +1756,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1315,20 +1765,23 @@ function ($exception) { /** * Create request for operation 'combinePdfs' * - * @param \DocSpring\Model\CombinePdfsData $combine_pdfs_data (required) + * @param \DocSpring\Model\CombinePdfsData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['combinePdfs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function combinePdfsRequest($combine_pdfs_data) + public function combinePdfsRequest($data, string $contentType = self::contentTypes['combinePdfs'][0]) { - // verify the required parameter 'combine_pdfs_data' is set - if ($combine_pdfs_data === null || (is_array($combine_pdfs_data) && count($combine_pdfs_data) === 0)) { + + // verify the required parameter 'data' is set + if ($data === null || (is_array($data) && count($data) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $combine_pdfs_data when calling combinePdfs' + 'Missing the required parameter $data when calling combinePdfs' ); } + $resourcePath = '/combined_submissions?v=2'; $formParams = []; $queryParams = []; @@ -1338,54 +1791,48 @@ protected function combinePdfsRequest($combine_pdfs_data) - // body params - $_tempBody = null; - if (isset($combine_pdfs_data)) { - $_tempBody = $combine_pdfs_data; - } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + if (isset($data)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($data)); } else { - $httpBody = $_tempBody; + $httpBody = $data; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -1400,10 +1847,11 @@ protected function combinePdfsRequest($combine_pdfs_data) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1414,15 +1862,16 @@ protected function combinePdfsRequest($combine_pdfs_data) * * Merge generated PDFs together * - * @param \DocSpring\Model\CombinedSubmissionData $combined_submission_data combined_submission_data (required) + * @param \DocSpring\Model\CombinedSubmissionData $data data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['combineSubmissions'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\CreateCombinedSubmissionResponse|\DocSpring\Model\Error|\DocSpring\Model\AuthenticationError|\DocSpring\Model\InvalidRequest + * @return \DocSpring\Model\CreateCombinedSubmissionResponse|\DocSpring\Model\InvalidRequest|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError */ - public function combineSubmissions($combined_submission_data) + public function combineSubmissions($data, string $contentType = self::contentTypes['combineSubmissions'][0]) { - list($response) = $this->combineSubmissionsWithHttpInfo($combined_submission_data); + list($response) = $this->combineSubmissionsWithHttpInfo($data, $contentType); return $response; } @@ -1431,15 +1880,16 @@ public function combineSubmissions($combined_submission_data) * * Merge generated PDFs together * - * @param \DocSpring\Model\CombinedSubmissionData $combined_submission_data (required) + * @param \DocSpring\Model\CombinedSubmissionData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['combineSubmissions'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\CreateCombinedSubmissionResponse|\DocSpring\Model\Error|\DocSpring\Model\AuthenticationError|\DocSpring\Model\InvalidRequest, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\CreateCombinedSubmissionResponse|\DocSpring\Model\InvalidRequest|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function combineSubmissionsWithHttpInfo($combined_submission_data) + public function combineSubmissionsWithHttpInfo($data, string $contentType = self::contentTypes['combineSubmissions'][0]) { - $request = $this->combineSubmissionsRequest($combined_submission_data); + $request = $this->combineSubmissionsRequest($data, $contentType); try { $options = $this->createHttpClientOption(); @@ -1448,9 +1898,16 @@ public function combineSubmissionsWithHttpInfo($combined_submission_data) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -1461,21 +1918,35 @@ public function combineSubmissionsWithHttpInfo($combined_submission_data) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\DocSpring\Model\CreateCombinedSubmissionResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\CreateCombinedSubmissionResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1483,50 +1954,109 @@ public function combineSubmissionsWithHttpInfo($combined_submission_data) $response->getStatusCode(), $response->getHeaders() ]; - case 400: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 422: + if ('\DocSpring\Model\InvalidRequest' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\InvalidRequest' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\InvalidRequest', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 400: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 422: - if ('\DocSpring\Model\InvalidRequest' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\InvalidRequest', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\DocSpring\Model\CreateCombinedSubmissionResponse'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1545,26 +2075,26 @@ public function combineSubmissionsWithHttpInfo($combined_submission_data) ); $e->setResponseObject($data); break; - case 400: + case 422: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\InvalidRequest', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\AuthenticationError', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 422: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\InvalidRequest', + '\DocSpring\Model\AuthenticationError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1579,14 +2109,15 @@ public function combineSubmissionsWithHttpInfo($combined_submission_data) * * Merge generated PDFs together * - * @param \DocSpring\Model\CombinedSubmissionData $combined_submission_data (required) + * @param \DocSpring\Model\CombinedSubmissionData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['combineSubmissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function combineSubmissionsAsync($combined_submission_data) + public function combineSubmissionsAsync($data, string $contentType = self::contentTypes['combineSubmissions'][0]) { - return $this->combineSubmissionsAsyncWithHttpInfo($combined_submission_data) + return $this->combineSubmissionsAsyncWithHttpInfo($data, $contentType) ->then( function ($response) { return $response[0]; @@ -1599,25 +2130,28 @@ function ($response) { * * Merge generated PDFs together * - * @param \DocSpring\Model\CombinedSubmissionData $combined_submission_data (required) + * @param \DocSpring\Model\CombinedSubmissionData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['combineSubmissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function combineSubmissionsAsyncWithHttpInfo($combined_submission_data) + public function combineSubmissionsAsyncWithHttpInfo($data, string $contentType = self::contentTypes['combineSubmissions'][0]) { $returnType = '\DocSpring\Model\CreateCombinedSubmissionResponse'; - $request = $this->combineSubmissionsRequest($combined_submission_data); + $request = $this->combineSubmissionsRequest($data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1637,7 +2171,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1646,20 +2180,23 @@ function ($exception) { /** * Create request for operation 'combineSubmissions' * - * @param \DocSpring\Model\CombinedSubmissionData $combined_submission_data (required) + * @param \DocSpring\Model\CombinedSubmissionData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['combineSubmissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function combineSubmissionsRequest($combined_submission_data) + public function combineSubmissionsRequest($data, string $contentType = self::contentTypes['combineSubmissions'][0]) { - // verify the required parameter 'combined_submission_data' is set - if ($combined_submission_data === null || (is_array($combined_submission_data) && count($combined_submission_data) === 0)) { + + // verify the required parameter 'data' is set + if ($data === null || (is_array($data) && count($data) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $combined_submission_data when calling combineSubmissions' + 'Missing the required parameter $data when calling combineSubmissions' ); } + $resourcePath = '/combined_submissions'; $formParams = []; $queryParams = []; @@ -1669,54 +2206,48 @@ protected function combineSubmissionsRequest($combined_submission_data) - // body params - $_tempBody = null; - if (isset($combined_submission_data)) { - $_tempBody = $combined_submission_data; - } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + if (isset($data)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($data)); } else { - $httpBody = $_tempBody; + $httpBody = $data; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -1731,10 +2262,11 @@ protected function combineSubmissionsRequest($combined_submission_data) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1746,15 +2278,16 @@ protected function combineSubmissionsRequest($combined_submission_data) * Copy a Template * * @param string $template_id template_id (required) - * @param \DocSpring\Model\CopyTemplateData $copy_template_data copy_template_data (required) + * @param \DocSpring\Model\CopyTemplateData $data data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['copyTemplate'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\Template|\DocSpring\Model\Error + * @return \DocSpring\Model\Template|\DocSpring\Model\ErrorResponse */ - public function copyTemplate($template_id, $copy_template_data) + public function copyTemplate($template_id, $data, string $contentType = self::contentTypes['copyTemplate'][0]) { - list($response) = $this->copyTemplateWithHttpInfo($template_id, $copy_template_data); + list($response) = $this->copyTemplateWithHttpInfo($template_id, $data, $contentType); return $response; } @@ -1764,15 +2297,16 @@ public function copyTemplate($template_id, $copy_template_data) * Copy a Template * * @param string $template_id (required) - * @param \DocSpring\Model\CopyTemplateData $copy_template_data (required) + * @param \DocSpring\Model\CopyTemplateData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['copyTemplate'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\Template|\DocSpring\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\Template|\DocSpring\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function copyTemplateWithHttpInfo($template_id, $copy_template_data) + public function copyTemplateWithHttpInfo($template_id, $data, string $contentType = self::contentTypes['copyTemplate'][0]) { - $request = $this->copyTemplateRequest($template_id, $copy_template_data); + $request = $this->copyTemplateRequest($template_id, $data, $contentType); try { $options = $this->createHttpClientOption(); @@ -1781,9 +2315,16 @@ public function copyTemplateWithHttpInfo($template_id, $copy_template_data) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -1794,21 +2335,35 @@ public function copyTemplateWithHttpInfo($template_id, $copy_template_data) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\DocSpring\Model\Template' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\Template' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1817,25 +2372,54 @@ public function copyTemplateWithHttpInfo($template_id, $copy_template_data) $response->getHeaders() ]; case 404: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\DocSpring\Model\Template'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1857,7 +2441,7 @@ public function copyTemplateWithHttpInfo($template_id, $copy_template_data) case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1873,14 +2457,15 @@ public function copyTemplateWithHttpInfo($template_id, $copy_template_data) * Copy a Template * * @param string $template_id (required) - * @param \DocSpring\Model\CopyTemplateData $copy_template_data (required) + * @param \DocSpring\Model\CopyTemplateData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['copyTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function copyTemplateAsync($template_id, $copy_template_data) + public function copyTemplateAsync($template_id, $data, string $contentType = self::contentTypes['copyTemplate'][0]) { - return $this->copyTemplateAsyncWithHttpInfo($template_id, $copy_template_data) + return $this->copyTemplateAsyncWithHttpInfo($template_id, $data, $contentType) ->then( function ($response) { return $response[0]; @@ -1894,25 +2479,28 @@ function ($response) { * Copy a Template * * @param string $template_id (required) - * @param \DocSpring\Model\CopyTemplateData $copy_template_data (required) + * @param \DocSpring\Model\CopyTemplateData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['copyTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function copyTemplateAsyncWithHttpInfo($template_id, $copy_template_data) + public function copyTemplateAsyncWithHttpInfo($template_id, $data, string $contentType = self::contentTypes['copyTemplate'][0]) { $returnType = '\DocSpring\Model\Template'; - $request = $this->copyTemplateRequest($template_id, $copy_template_data); + $request = $this->copyTemplateRequest($template_id, $data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1932,7 +2520,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -1942,26 +2530,30 @@ function ($exception) { * Create request for operation 'copyTemplate' * * @param string $template_id (required) - * @param \DocSpring\Model\CopyTemplateData $copy_template_data (required) + * @param \DocSpring\Model\CopyTemplateData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['copyTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function copyTemplateRequest($template_id, $copy_template_data) + public function copyTemplateRequest($template_id, $data, string $contentType = self::contentTypes['copyTemplate'][0]) { + // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $template_id when calling copyTemplate' ); } - // verify the required parameter 'copy_template_data' is set - if ($copy_template_data === null || (is_array($copy_template_data) && count($copy_template_data) === 0)) { + + // verify the required parameter 'data' is set + if ($data === null || (is_array($data) && count($data) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $copy_template_data when calling copyTemplate' + 'Missing the required parameter $data when calling copyTemplate' ); } + $resourcePath = '/templates/{template_id}/copy'; $formParams = []; $queryParams = []; @@ -1970,6 +2562,7 @@ protected function copyTemplateRequest($template_id, $copy_template_data) $multipart = false; + // path params if ($template_id !== null) { $resourcePath = str_replace( @@ -1979,54 +2572,47 @@ protected function copyTemplateRequest($template_id, $copy_template_data) ); } - // body params - $_tempBody = null; - if (isset($copy_template_data)) { - $_tempBody = $copy_template_data; - } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + if (isset($data)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($data)); } else { - $httpBody = $_tempBody; + $httpBody = $data; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -2041,10 +2627,11 @@ protected function copyTemplateRequest($template_id, $copy_template_data) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2055,15 +2642,16 @@ protected function copyTemplateRequest($template_id, $copy_template_data) * * Create a new custom file from a cached presign upload * - * @param \DocSpring\Model\CreateCustomFileData $create_custom_file_data create_custom_file_data (required) + * @param \DocSpring\Model\CreateCustomFileData $data data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCustomFileFromUpload'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \DocSpring\Model\CreateCustomFileResponse|\DocSpring\Model\AuthenticationError */ - public function createCustomFileFromUpload($create_custom_file_data) + public function createCustomFileFromUpload($data, string $contentType = self::contentTypes['createCustomFileFromUpload'][0]) { - list($response) = $this->createCustomFileFromUploadWithHttpInfo($create_custom_file_data); + list($response) = $this->createCustomFileFromUploadWithHttpInfo($data, $contentType); return $response; } @@ -2072,15 +2660,16 @@ public function createCustomFileFromUpload($create_custom_file_data) * * Create a new custom file from a cached presign upload * - * @param \DocSpring\Model\CreateCustomFileData $create_custom_file_data (required) + * @param \DocSpring\Model\CreateCustomFileData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCustomFileFromUpload'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \DocSpring\Model\CreateCustomFileResponse|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function createCustomFileFromUploadWithHttpInfo($create_custom_file_data) + public function createCustomFileFromUploadWithHttpInfo($data, string $contentType = self::contentTypes['createCustomFileFromUpload'][0]) { - $request = $this->createCustomFileFromUploadRequest($create_custom_file_data); + $request = $this->createCustomFileFromUploadRequest($data, $contentType); try { $options = $this->createHttpClientOption(); @@ -2089,9 +2678,16 @@ public function createCustomFileFromUploadWithHttpInfo($create_custom_file_data) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -2102,21 +2698,35 @@ public function createCustomFileFromUploadWithHttpInfo($create_custom_file_data) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\DocSpring\Model\CreateCustomFileResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\CreateCustomFileResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2126,9 +2736,24 @@ public function createCustomFileFromUploadWithHttpInfo($create_custom_file_data) ]; case 401: if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2139,11 +2764,25 @@ public function createCustomFileFromUploadWithHttpInfo($create_custom_file_data) } $returnType = '\DocSpring\Model\CreateCustomFileResponse'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2180,14 +2819,15 @@ public function createCustomFileFromUploadWithHttpInfo($create_custom_file_data) * * Create a new custom file from a cached presign upload * - * @param \DocSpring\Model\CreateCustomFileData $create_custom_file_data (required) + * @param \DocSpring\Model\CreateCustomFileData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCustomFileFromUpload'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCustomFileFromUploadAsync($create_custom_file_data) + public function createCustomFileFromUploadAsync($data, string $contentType = self::contentTypes['createCustomFileFromUpload'][0]) { - return $this->createCustomFileFromUploadAsyncWithHttpInfo($create_custom_file_data) + return $this->createCustomFileFromUploadAsyncWithHttpInfo($data, $contentType) ->then( function ($response) { return $response[0]; @@ -2200,25 +2840,28 @@ function ($response) { * * Create a new custom file from a cached presign upload * - * @param \DocSpring\Model\CreateCustomFileData $create_custom_file_data (required) + * @param \DocSpring\Model\CreateCustomFileData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCustomFileFromUpload'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createCustomFileFromUploadAsyncWithHttpInfo($create_custom_file_data) + public function createCustomFileFromUploadAsyncWithHttpInfo($data, string $contentType = self::contentTypes['createCustomFileFromUpload'][0]) { $returnType = '\DocSpring\Model\CreateCustomFileResponse'; - $request = $this->createCustomFileFromUploadRequest($create_custom_file_data); + $request = $this->createCustomFileFromUploadRequest($data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2238,7 +2881,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -2247,20 +2890,23 @@ function ($exception) { /** * Create request for operation 'createCustomFileFromUpload' * - * @param \DocSpring\Model\CreateCustomFileData $create_custom_file_data (required) + * @param \DocSpring\Model\CreateCustomFileData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createCustomFileFromUpload'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createCustomFileFromUploadRequest($create_custom_file_data) + public function createCustomFileFromUploadRequest($data, string $contentType = self::contentTypes['createCustomFileFromUpload'][0]) { - // verify the required parameter 'create_custom_file_data' is set - if ($create_custom_file_data === null || (is_array($create_custom_file_data) && count($create_custom_file_data) === 0)) { + + // verify the required parameter 'data' is set + if ($data === null || (is_array($data) && count($data) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $create_custom_file_data when calling createCustomFileFromUpload' + 'Missing the required parameter $data when calling createCustomFileFromUpload' ); } + $resourcePath = '/custom_files'; $formParams = []; $queryParams = []; @@ -2270,54 +2916,48 @@ protected function createCustomFileFromUploadRequest($create_custom_file_data) - // body params - $_tempBody = null; - if (isset($create_custom_file_data)) { - $_tempBody = $create_custom_file_data; - } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + if (isset($data)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($data)); } else { - $httpBody = $_tempBody; + $httpBody = $data; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -2332,10 +2972,11 @@ protected function createCustomFileFromUploadRequest($create_custom_file_data) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2347,14 +2988,15 @@ protected function createCustomFileFromUploadRequest($create_custom_file_data) * Creates a new data request token for form authentication * * @param string $data_request_id data_request_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDataRequestToken'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \DocSpring\Model\CreateSubmissionDataRequestTokenResponse|\DocSpring\Model\AuthenticationError */ - public function createDataRequestToken($data_request_id) + public function createDataRequestToken($data_request_id, string $contentType = self::contentTypes['createDataRequestToken'][0]) { - list($response) = $this->createDataRequestTokenWithHttpInfo($data_request_id); + list($response) = $this->createDataRequestTokenWithHttpInfo($data_request_id, $contentType); return $response; } @@ -2364,14 +3006,15 @@ public function createDataRequestToken($data_request_id) * Creates a new data request token for form authentication * * @param string $data_request_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDataRequestToken'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \DocSpring\Model\CreateSubmissionDataRequestTokenResponse|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function createDataRequestTokenWithHttpInfo($data_request_id) + public function createDataRequestTokenWithHttpInfo($data_request_id, string $contentType = self::contentTypes['createDataRequestToken'][0]) { - $request = $this->createDataRequestTokenRequest($data_request_id); + $request = $this->createDataRequestTokenRequest($data_request_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2380,9 +3023,16 @@ public function createDataRequestTokenWithHttpInfo($data_request_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -2393,21 +3043,35 @@ public function createDataRequestTokenWithHttpInfo($data_request_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\DocSpring\Model\CreateSubmissionDataRequestTokenResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\CreateSubmissionDataRequestTokenResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2417,9 +3081,24 @@ public function createDataRequestTokenWithHttpInfo($data_request_id) ]; case 401: if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2430,11 +3109,25 @@ public function createDataRequestTokenWithHttpInfo($data_request_id) } $returnType = '\DocSpring\Model\CreateSubmissionDataRequestTokenResponse'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2472,13 +3165,14 @@ public function createDataRequestTokenWithHttpInfo($data_request_id) * Creates a new data request token for form authentication * * @param string $data_request_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDataRequestToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createDataRequestTokenAsync($data_request_id) + public function createDataRequestTokenAsync($data_request_id, string $contentType = self::contentTypes['createDataRequestToken'][0]) { - return $this->createDataRequestTokenAsyncWithHttpInfo($data_request_id) + return $this->createDataRequestTokenAsyncWithHttpInfo($data_request_id, $contentType) ->then( function ($response) { return $response[0]; @@ -2492,24 +3186,27 @@ function ($response) { * Creates a new data request token for form authentication * * @param string $data_request_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDataRequestToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createDataRequestTokenAsyncWithHttpInfo($data_request_id) + public function createDataRequestTokenAsyncWithHttpInfo($data_request_id, string $contentType = self::contentTypes['createDataRequestToken'][0]) { $returnType = '\DocSpring\Model\CreateSubmissionDataRequestTokenResponse'; - $request = $this->createDataRequestTokenRequest($data_request_id); + $request = $this->createDataRequestTokenRequest($data_request_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2529,7 +3226,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -2539,12 +3236,14 @@ function ($exception) { * Create request for operation 'createDataRequestToken' * * @param string $data_request_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDataRequestToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createDataRequestTokenRequest($data_request_id) + public function createDataRequestTokenRequest($data_request_id, string $contentType = self::contentTypes['createDataRequestToken'][0]) { + // verify the required parameter 'data_request_id' is set if ($data_request_id === null || (is_array($data_request_id) && count($data_request_id) === 0)) { throw new \InvalidArgumentException( @@ -2552,6 +3251,7 @@ protected function createDataRequestTokenRequest($data_request_id) ); } + $resourcePath = '/data_requests/{data_request_id}/tokens'; $formParams = []; $queryParams = []; @@ -2560,6 +3260,7 @@ protected function createDataRequestTokenRequest($data_request_id) $multipart = false; + // path params if ($data_request_id !== null) { $resourcePath = str_replace( @@ -2569,51 +3270,40 @@ protected function createDataRequestTokenRequest($data_request_id) ); } - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -2628,10 +3318,11 @@ protected function createDataRequestTokenRequest($data_request_id) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2642,15 +3333,16 @@ protected function createDataRequestTokenRequest($data_request_id) * * Create a folder * - * @param \DocSpring\Model\CreateFolderData $create_folder_data create_folder_data (required) + * @param \DocSpring\Model\CreateFolderData $data data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFolder'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\Folder|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error|\DocSpring\Model\Folder + * @return \DocSpring\Model\Folder|\DocSpring\Model\ErrorResponse|\DocSpring\Model\Folder|\DocSpring\Model\AuthenticationError */ - public function createFolder($create_folder_data) + public function createFolder($data, string $contentType = self::contentTypes['createFolder'][0]) { - list($response) = $this->createFolderWithHttpInfo($create_folder_data); + list($response) = $this->createFolderWithHttpInfo($data, $contentType); return $response; } @@ -2659,15 +3351,16 @@ public function createFolder($create_folder_data) * * Create a folder * - * @param \DocSpring\Model\CreateFolderData $create_folder_data (required) + * @param \DocSpring\Model\CreateFolderData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFolder'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\Folder|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error|\DocSpring\Model\Folder, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\Folder|\DocSpring\Model\ErrorResponse|\DocSpring\Model\Folder|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function createFolderWithHttpInfo($create_folder_data) + public function createFolderWithHttpInfo($data, string $contentType = self::contentTypes['createFolder'][0]) { - $request = $this->createFolderRequest($create_folder_data); + $request = $this->createFolderRequest($data, $contentType); try { $options = $this->createHttpClientOption(); @@ -2676,9 +3369,16 @@ public function createFolderWithHttpInfo($create_folder_data) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -2689,21 +3389,35 @@ public function createFolderWithHttpInfo($create_folder_data) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { - case 200: + case 422: if ('\DocSpring\Model\Folder' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\Folder' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2711,50 +3425,109 @@ public function createFolderWithHttpInfo($create_folder_data) $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 404: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 404: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 200: + if ('\DocSpring\Model\Folder' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\Folder' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\Folder', []), $response->getStatusCode(), $response->getHeaders() ]; - case 422: - if ('\DocSpring\Model\Folder' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Folder', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\DocSpring\Model\Folder'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2765,7 +3538,7 @@ public function createFolderWithHttpInfo($create_folder_data) } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 422: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\DocSpring\Model\Folder', @@ -2773,26 +3546,26 @@ public function createFolderWithHttpInfo($create_folder_data) ); $e->setResponseObject($data); break; - case 401: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\AuthenticationError', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 404: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\Folder', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 422: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Folder', + '\DocSpring\Model\AuthenticationError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2807,14 +3580,15 @@ public function createFolderWithHttpInfo($create_folder_data) * * Create a folder * - * @param \DocSpring\Model\CreateFolderData $create_folder_data (required) + * @param \DocSpring\Model\CreateFolderData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createFolderAsync($create_folder_data) + public function createFolderAsync($data, string $contentType = self::contentTypes['createFolder'][0]) { - return $this->createFolderAsyncWithHttpInfo($create_folder_data) + return $this->createFolderAsyncWithHttpInfo($data, $contentType) ->then( function ($response) { return $response[0]; @@ -2827,25 +3601,28 @@ function ($response) { * * Create a folder * - * @param \DocSpring\Model\CreateFolderData $create_folder_data (required) + * @param \DocSpring\Model\CreateFolderData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createFolderAsyncWithHttpInfo($create_folder_data) + public function createFolderAsyncWithHttpInfo($data, string $contentType = self::contentTypes['createFolder'][0]) { $returnType = '\DocSpring\Model\Folder'; - $request = $this->createFolderRequest($create_folder_data); + $request = $this->createFolderRequest($data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2865,7 +3642,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -2874,20 +3651,23 @@ function ($exception) { /** * Create request for operation 'createFolder' * - * @param \DocSpring\Model\CreateFolderData $create_folder_data (required) + * @param \DocSpring\Model\CreateFolderData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createFolderRequest($create_folder_data) + public function createFolderRequest($data, string $contentType = self::contentTypes['createFolder'][0]) { - // verify the required parameter 'create_folder_data' is set - if ($create_folder_data === null || (is_array($create_folder_data) && count($create_folder_data) === 0)) { + + // verify the required parameter 'data' is set + if ($data === null || (is_array($data) && count($data) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $create_folder_data when calling createFolder' + 'Missing the required parameter $data when calling createFolder' ); } + $resourcePath = '/folders/'; $formParams = []; $queryParams = []; @@ -2897,54 +3677,48 @@ protected function createFolderRequest($create_folder_data) - // body params - $_tempBody = null; - if (isset($create_folder_data)) { - $_tempBody = $create_folder_data; - } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + if (isset($data)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($data)); } else { - $httpBody = $_tempBody; + $httpBody = $data; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -2959,10 +3733,11 @@ protected function createFolderRequest($create_folder_data) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2973,15 +3748,16 @@ protected function createFolderRequest($create_folder_data) * * Create a new HTML template * - * @param \DocSpring\Model\CreateHtmlTemplateData $create_html_template_data create_html_template_data (required) + * @param \DocSpring\Model\CreateHtmlTemplateData $data data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createHTMLTemplate'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \DocSpring\Model\PendingTemplate|\DocSpring\Model\AuthenticationError */ - public function createHTMLTemplate($create_html_template_data) + public function createHTMLTemplate($data, string $contentType = self::contentTypes['createHTMLTemplate'][0]) { - list($response) = $this->createHTMLTemplateWithHttpInfo($create_html_template_data); + list($response) = $this->createHTMLTemplateWithHttpInfo($data, $contentType); return $response; } @@ -2990,15 +3766,16 @@ public function createHTMLTemplate($create_html_template_data) * * Create a new HTML template * - * @param \DocSpring\Model\CreateHtmlTemplateData $create_html_template_data (required) + * @param \DocSpring\Model\CreateHtmlTemplateData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createHTMLTemplate'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \DocSpring\Model\PendingTemplate|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function createHTMLTemplateWithHttpInfo($create_html_template_data) + public function createHTMLTemplateWithHttpInfo($data, string $contentType = self::contentTypes['createHTMLTemplate'][0]) { - $request = $this->createHTMLTemplateRequest($create_html_template_data); + $request = $this->createHTMLTemplateRequest($data, $contentType); try { $options = $this->createHttpClientOption(); @@ -3007,9 +3784,16 @@ public function createHTMLTemplateWithHttpInfo($create_html_template_data) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -3020,21 +3804,35 @@ public function createHTMLTemplateWithHttpInfo($create_html_template_data) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\DocSpring\Model\PendingTemplate' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\PendingTemplate' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3044,9 +3842,24 @@ public function createHTMLTemplateWithHttpInfo($create_html_template_data) ]; case 401: if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3057,11 +3870,25 @@ public function createHTMLTemplateWithHttpInfo($create_html_template_data) } $returnType = '\DocSpring\Model\PendingTemplate'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3098,14 +3925,15 @@ public function createHTMLTemplateWithHttpInfo($create_html_template_data) * * Create a new HTML template * - * @param \DocSpring\Model\CreateHtmlTemplateData $create_html_template_data (required) + * @param \DocSpring\Model\CreateHtmlTemplateData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createHTMLTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createHTMLTemplateAsync($create_html_template_data) + public function createHTMLTemplateAsync($data, string $contentType = self::contentTypes['createHTMLTemplate'][0]) { - return $this->createHTMLTemplateAsyncWithHttpInfo($create_html_template_data) + return $this->createHTMLTemplateAsyncWithHttpInfo($data, $contentType) ->then( function ($response) { return $response[0]; @@ -3118,25 +3946,28 @@ function ($response) { * * Create a new HTML template * - * @param \DocSpring\Model\CreateHtmlTemplateData $create_html_template_data (required) + * @param \DocSpring\Model\CreateHtmlTemplateData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createHTMLTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createHTMLTemplateAsyncWithHttpInfo($create_html_template_data) + public function createHTMLTemplateAsyncWithHttpInfo($data, string $contentType = self::contentTypes['createHTMLTemplate'][0]) { $returnType = '\DocSpring\Model\PendingTemplate'; - $request = $this->createHTMLTemplateRequest($create_html_template_data); + $request = $this->createHTMLTemplateRequest($data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3156,7 +3987,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -3165,20 +3996,23 @@ function ($exception) { /** * Create request for operation 'createHTMLTemplate' * - * @param \DocSpring\Model\CreateHtmlTemplateData $create_html_template_data (required) + * @param \DocSpring\Model\CreateHtmlTemplateData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createHTMLTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createHTMLTemplateRequest($create_html_template_data) + public function createHTMLTemplateRequest($data, string $contentType = self::contentTypes['createHTMLTemplate'][0]) { - // verify the required parameter 'create_html_template_data' is set - if ($create_html_template_data === null || (is_array($create_html_template_data) && count($create_html_template_data) === 0)) { + + // verify the required parameter 'data' is set + if ($data === null || (is_array($data) && count($data) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $create_html_template_data when calling createHTMLTemplate' + 'Missing the required parameter $data when calling createHTMLTemplate' ); } + $resourcePath = '/templates?desc=html'; $formParams = []; $queryParams = []; @@ -3188,54 +4022,48 @@ protected function createHTMLTemplateRequest($create_html_template_data) - // body params - $_tempBody = null; - if (isset($create_html_template_data)) { - $_tempBody = $create_html_template_data; - } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + if (isset($data)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($data)); } else { - $httpBody = $_tempBody; + $httpBody = $data; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -3250,10 +4078,11 @@ protected function createHTMLTemplateRequest($create_html_template_data) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3267,14 +4096,15 @@ protected function createHTMLTemplateRequest($create_html_template_data) * @param \SplFileObject $template_document template_document (required) * @param string $template_name template_name (required) * @param string $template_parent_folder_id template_parent_folder_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPDFTemplate'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \DocSpring\Model\PendingTemplate|\DocSpring\Model\AuthenticationError */ - public function createPDFTemplate($template_document, $template_name, $template_parent_folder_id = null) + public function createPDFTemplate($template_document, $template_name, $template_parent_folder_id = null, string $contentType = self::contentTypes['createPDFTemplate'][0]) { - list($response) = $this->createPDFTemplateWithHttpInfo($template_document, $template_name, $template_parent_folder_id); + list($response) = $this->createPDFTemplateWithHttpInfo($template_document, $template_name, $template_parent_folder_id, $contentType); return $response; } @@ -3286,14 +4116,15 @@ public function createPDFTemplate($template_document, $template_name, $template_ * @param \SplFileObject $template_document (required) * @param string $template_name (required) * @param string $template_parent_folder_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPDFTemplate'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \DocSpring\Model\PendingTemplate|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function createPDFTemplateWithHttpInfo($template_document, $template_name, $template_parent_folder_id = null) + public function createPDFTemplateWithHttpInfo($template_document, $template_name, $template_parent_folder_id = null, string $contentType = self::contentTypes['createPDFTemplate'][0]) { - $request = $this->createPDFTemplateRequest($template_document, $template_name, $template_parent_folder_id); + $request = $this->createPDFTemplateRequest($template_document, $template_name, $template_parent_folder_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -3302,9 +4133,16 @@ public function createPDFTemplateWithHttpInfo($template_document, $template_name } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -3315,21 +4153,35 @@ public function createPDFTemplateWithHttpInfo($template_document, $template_name sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\DocSpring\Model\PendingTemplate' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\PendingTemplate' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3339,9 +4191,24 @@ public function createPDFTemplateWithHttpInfo($template_document, $template_name ]; case 401: if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3352,11 +4219,25 @@ public function createPDFTemplateWithHttpInfo($template_document, $template_name } $returnType = '\DocSpring\Model\PendingTemplate'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3396,13 +4277,14 @@ public function createPDFTemplateWithHttpInfo($template_document, $template_name * @param \SplFileObject $template_document (required) * @param string $template_name (required) * @param string $template_parent_folder_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPDFTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPDFTemplateAsync($template_document, $template_name, $template_parent_folder_id = null) + public function createPDFTemplateAsync($template_document, $template_name, $template_parent_folder_id = null, string $contentType = self::contentTypes['createPDFTemplate'][0]) { - return $this->createPDFTemplateAsyncWithHttpInfo($template_document, $template_name, $template_parent_folder_id) + return $this->createPDFTemplateAsyncWithHttpInfo($template_document, $template_name, $template_parent_folder_id, $contentType) ->then( function ($response) { return $response[0]; @@ -3418,24 +4300,27 @@ function ($response) { * @param \SplFileObject $template_document (required) * @param string $template_name (required) * @param string $template_parent_folder_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPDFTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPDFTemplateAsyncWithHttpInfo($template_document, $template_name, $template_parent_folder_id = null) + public function createPDFTemplateAsyncWithHttpInfo($template_document, $template_name, $template_parent_folder_id = null, string $contentType = self::contentTypes['createPDFTemplate'][0]) { $returnType = '\DocSpring\Model\PendingTemplate'; - $request = $this->createPDFTemplateRequest($template_document, $template_name, $template_parent_folder_id); + $request = $this->createPDFTemplateRequest($template_document, $template_name, $template_parent_folder_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3455,7 +4340,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -3467,18 +4352,21 @@ function ($exception) { * @param \SplFileObject $template_document (required) * @param string $template_name (required) * @param string $template_parent_folder_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPDFTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createPDFTemplateRequest($template_document, $template_name, $template_parent_folder_id = null) + public function createPDFTemplateRequest($template_document, $template_name, $template_parent_folder_id = null, string $contentType = self::contentTypes['createPDFTemplate'][0]) { + // verify the required parameter 'template_document' is set if ($template_document === null || (is_array($template_document) && count($template_document) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $template_document when calling createPDFTemplate' ); } + // verify the required parameter 'template_name' is set if ($template_name === null || (is_array($template_name) && count($template_name) === 0)) { throw new \InvalidArgumentException( @@ -3486,6 +4374,8 @@ protected function createPDFTemplateRequest($template_document, $template_name, ); } + + $resourcePath = '/templates'; $formParams = []; $queryParams = []; @@ -3495,10 +4385,18 @@ protected function createPDFTemplateRequest($template_document, $template_name, + // form params if ($template_document !== null) { $multipart = true; - $formParams['template[document]'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($template_document), 'rb'); + $formParams['template[document]'] = []; + $paramFiles = is_array($template_document) ? $template_document : [$template_document]; + foreach ($paramFiles as $paramFile) { + $formParams['template[document]'][] = \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } } // form params if ($template_name !== null) { @@ -3508,51 +4406,40 @@ protected function createPDFTemplateRequest($template_document, $template_name, if ($template_parent_folder_id !== null) { $formParams['template[parent_folder_id]'] = ObjectSerializer::toFormValue($template_parent_folder_id); } - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['multipart/form-data'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -3567,10 +4454,11 @@ protected function createPDFTemplateRequest($template_document, $template_name, $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3581,15 +4469,16 @@ protected function createPDFTemplateRequest($template_document, $template_name, * * Create a new PDF template from a cached presign upload * - * @param \DocSpring\Model\CreateTemplateFromUploadData $create_template_from_upload_data create_template_from_upload_data (required) + * @param \DocSpring\Model\CreateTemplateFromUploadData $data data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPDFTemplateFromUpload'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \DocSpring\Model\PendingTemplate|\DocSpring\Model\AuthenticationError */ - public function createPDFTemplateFromUpload($create_template_from_upload_data) + public function createPDFTemplateFromUpload($data, string $contentType = self::contentTypes['createPDFTemplateFromUpload'][0]) { - list($response) = $this->createPDFTemplateFromUploadWithHttpInfo($create_template_from_upload_data); + list($response) = $this->createPDFTemplateFromUploadWithHttpInfo($data, $contentType); return $response; } @@ -3598,15 +4487,16 @@ public function createPDFTemplateFromUpload($create_template_from_upload_data) * * Create a new PDF template from a cached presign upload * - * @param \DocSpring\Model\CreateTemplateFromUploadData $create_template_from_upload_data (required) + * @param \DocSpring\Model\CreateTemplateFromUploadData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPDFTemplateFromUpload'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \DocSpring\Model\PendingTemplate|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function createPDFTemplateFromUploadWithHttpInfo($create_template_from_upload_data) + public function createPDFTemplateFromUploadWithHttpInfo($data, string $contentType = self::contentTypes['createPDFTemplateFromUpload'][0]) { - $request = $this->createPDFTemplateFromUploadRequest($create_template_from_upload_data); + $request = $this->createPDFTemplateFromUploadRequest($data, $contentType); try { $options = $this->createHttpClientOption(); @@ -3615,9 +4505,16 @@ public function createPDFTemplateFromUploadWithHttpInfo($create_template_from_up } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -3628,21 +4525,35 @@ public function createPDFTemplateFromUploadWithHttpInfo($create_template_from_up sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 201: if ('\DocSpring\Model\PendingTemplate' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\PendingTemplate' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3652,9 +4563,24 @@ public function createPDFTemplateFromUploadWithHttpInfo($create_template_from_up ]; case 401: if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3665,11 +4591,25 @@ public function createPDFTemplateFromUploadWithHttpInfo($create_template_from_up } $returnType = '\DocSpring\Model\PendingTemplate'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3706,14 +4646,15 @@ public function createPDFTemplateFromUploadWithHttpInfo($create_template_from_up * * Create a new PDF template from a cached presign upload * - * @param \DocSpring\Model\CreateTemplateFromUploadData $create_template_from_upload_data (required) + * @param \DocSpring\Model\CreateTemplateFromUploadData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPDFTemplateFromUpload'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPDFTemplateFromUploadAsync($create_template_from_upload_data) + public function createPDFTemplateFromUploadAsync($data, string $contentType = self::contentTypes['createPDFTemplateFromUpload'][0]) { - return $this->createPDFTemplateFromUploadAsyncWithHttpInfo($create_template_from_upload_data) + return $this->createPDFTemplateFromUploadAsyncWithHttpInfo($data, $contentType) ->then( function ($response) { return $response[0]; @@ -3726,25 +4667,28 @@ function ($response) { * * Create a new PDF template from a cached presign upload * - * @param \DocSpring\Model\CreateTemplateFromUploadData $create_template_from_upload_data (required) + * @param \DocSpring\Model\CreateTemplateFromUploadData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPDFTemplateFromUpload'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPDFTemplateFromUploadAsyncWithHttpInfo($create_template_from_upload_data) + public function createPDFTemplateFromUploadAsyncWithHttpInfo($data, string $contentType = self::contentTypes['createPDFTemplateFromUpload'][0]) { $returnType = '\DocSpring\Model\PendingTemplate'; - $request = $this->createPDFTemplateFromUploadRequest($create_template_from_upload_data); + $request = $this->createPDFTemplateFromUploadRequest($data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3764,7 +4708,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -3773,20 +4717,23 @@ function ($exception) { /** * Create request for operation 'createPDFTemplateFromUpload' * - * @param \DocSpring\Model\CreateTemplateFromUploadData $create_template_from_upload_data (required) + * @param \DocSpring\Model\CreateTemplateFromUploadData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPDFTemplateFromUpload'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createPDFTemplateFromUploadRequest($create_template_from_upload_data) + public function createPDFTemplateFromUploadRequest($data, string $contentType = self::contentTypes['createPDFTemplateFromUpload'][0]) { - // verify the required parameter 'create_template_from_upload_data' is set - if ($create_template_from_upload_data === null || (is_array($create_template_from_upload_data) && count($create_template_from_upload_data) === 0)) { + + // verify the required parameter 'data' is set + if ($data === null || (is_array($data) && count($data) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $create_template_from_upload_data when calling createPDFTemplateFromUpload' + 'Missing the required parameter $data when calling createPDFTemplateFromUpload' ); } + $resourcePath = '/templates?desc=cached_upload'; $formParams = []; $queryParams = []; @@ -3796,54 +4743,48 @@ protected function createPDFTemplateFromUploadRequest($create_template_from_uplo - // body params - $_tempBody = null; - if (isset($create_template_from_upload_data)) { - $_tempBody = $create_template_from_upload_data; - } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + if (isset($data)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($data)); } else { - $httpBody = $_tempBody; + $httpBody = $data; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -3858,10 +4799,11 @@ protected function createPDFTemplateFromUploadRequest($create_template_from_uplo $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3873,14 +4815,15 @@ protected function createPDFTemplateFromUploadRequest($create_template_from_uplo * Delete a folder * * @param string $folder_id folder_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFolder'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\Folder|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error|\DocSpring\Model\Error + * @return \DocSpring\Model\ErrorResponse|\DocSpring\Model\ErrorResponse|\DocSpring\Model\Folder|\DocSpring\Model\AuthenticationError */ - public function deleteFolder($folder_id) + public function deleteFolder($folder_id, string $contentType = self::contentTypes['deleteFolder'][0]) { - list($response) = $this->deleteFolderWithHttpInfo($folder_id); + list($response) = $this->deleteFolderWithHttpInfo($folder_id, $contentType); return $response; } @@ -3890,14 +4833,15 @@ public function deleteFolder($folder_id) * Delete a folder * * @param string $folder_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFolder'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\Folder|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error|\DocSpring\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\ErrorResponse|\DocSpring\Model\ErrorResponse|\DocSpring\Model\Folder|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function deleteFolderWithHttpInfo($folder_id) + public function deleteFolderWithHttpInfo($folder_id, string $contentType = self::contentTypes['deleteFolder'][0]) { - $request = $this->deleteFolderRequest($folder_id); + $request = $this->deleteFolderRequest($folder_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -3906,9 +4850,16 @@ public function deleteFolderWithHttpInfo($folder_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -3919,72 +4870,145 @@ public function deleteFolderWithHttpInfo($folder_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { - case 200: - if ('\DocSpring\Model\Folder' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 404: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Folder', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 422: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 404: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 200: + if ('\DocSpring\Model\Folder' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\Folder' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\Folder', []), $response->getStatusCode(), $response->getHeaders() ]; - case 422: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\DocSpring\Model\Folder'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3995,34 +5019,34 @@ public function deleteFolderWithHttpInfo($folder_id) } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Folder', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 422: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\AuthenticationError', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 404: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\Folder', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 422: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\AuthenticationError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4038,13 +5062,14 @@ public function deleteFolderWithHttpInfo($folder_id) * Delete a folder * * @param string $folder_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteFolderAsync($folder_id) + public function deleteFolderAsync($folder_id, string $contentType = self::contentTypes['deleteFolder'][0]) { - return $this->deleteFolderAsyncWithHttpInfo($folder_id) + return $this->deleteFolderAsyncWithHttpInfo($folder_id, $contentType) ->then( function ($response) { return $response[0]; @@ -4058,24 +5083,27 @@ function ($response) { * Delete a folder * * @param string $folder_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteFolderAsyncWithHttpInfo($folder_id) + public function deleteFolderAsyncWithHttpInfo($folder_id, string $contentType = self::contentTypes['deleteFolder'][0]) { $returnType = '\DocSpring\Model\Folder'; - $request = $this->deleteFolderRequest($folder_id); + $request = $this->deleteFolderRequest($folder_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4095,7 +5123,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -4105,12 +5133,14 @@ function ($exception) { * Create request for operation 'deleteFolder' * * @param string $folder_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteFolderRequest($folder_id) + public function deleteFolderRequest($folder_id, string $contentType = self::contentTypes['deleteFolder'][0]) { + // verify the required parameter 'folder_id' is set if ($folder_id === null || (is_array($folder_id) && count($folder_id) === 0)) { throw new \InvalidArgumentException( @@ -4118,6 +5148,7 @@ protected function deleteFolderRequest($folder_id) ); } + $resourcePath = '/folders/{folder_id}'; $formParams = []; $queryParams = []; @@ -4126,6 +5157,7 @@ protected function deleteFolderRequest($folder_id) $multipart = false; + // path params if ($folder_id !== null) { $resourcePath = str_replace( @@ -4135,51 +5167,40 @@ protected function deleteFolderRequest($folder_id) ); } - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -4194,46 +5215,49 @@ protected function deleteFolderRequest($folder_id) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); } /** - * Operation expireCombinedSubmission + * Operation deleteTemplate * - * Expire a combined submission + * Delete a template * - * @param string $combined_submission_id combined_submission_id (required) + * @param string $template_id template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTemplate'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\CombinedSubmission|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error|\DocSpring\Model\Error + * @return \DocSpring\Model\DeleteTemplateResponse|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError */ - public function expireCombinedSubmission($combined_submission_id) + public function deleteTemplate($template_id, string $contentType = self::contentTypes['deleteTemplate'][0]) { - list($response) = $this->expireCombinedSubmissionWithHttpInfo($combined_submission_id); + list($response) = $this->deleteTemplateWithHttpInfo($template_id, $contentType); return $response; } /** - * Operation expireCombinedSubmissionWithHttpInfo + * Operation deleteTemplateWithHttpInfo * - * Expire a combined submission + * Delete a template * - * @param string $combined_submission_id (required) + * @param string $template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTemplate'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\CombinedSubmission|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error|\DocSpring\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\DeleteTemplateResponse|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function expireCombinedSubmissionWithHttpInfo($combined_submission_id) + public function deleteTemplateWithHttpInfo($template_id, string $contentType = self::contentTypes['deleteTemplate'][0]) { - $request = $this->expireCombinedSubmissionRequest($combined_submission_id); + $request = $this->deleteTemplateRequest($template_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -4242,9 +5266,16 @@ public function expireCombinedSubmissionWithHttpInfo($combined_submission_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -4255,72 +5286,118 @@ public function expireCombinedSubmissionWithHttpInfo($combined_submission_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\DocSpring\Model\CombinedSubmission' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - } - - return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\CombinedSubmission', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 401: - if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\DocSpring\Model\DeleteTemplateResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\DeleteTemplateResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\DeleteTemplateResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 403: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 404: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 404: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\DocSpring\Model\CombinedSubmission'; - $responseBody = $response->getBody(); + $returnType = '\DocSpring\Model\DeleteTemplateResponse'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4334,31 +5411,23 @@ public function expireCombinedSubmissionWithHttpInfo($combined_submission_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\CombinedSubmission', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 401: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\DocSpring\Model\AuthenticationError', + '\DocSpring\Model\DeleteTemplateResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 403: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 404: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\AuthenticationError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4369,18 +5438,19 @@ public function expireCombinedSubmissionWithHttpInfo($combined_submission_id) } /** - * Operation expireCombinedSubmissionAsync + * Operation deleteTemplateAsync * - * Expire a combined submission + * Delete a template * - * @param string $combined_submission_id (required) + * @param string $template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function expireCombinedSubmissionAsync($combined_submission_id) + public function deleteTemplateAsync($template_id, string $contentType = self::contentTypes['deleteTemplate'][0]) { - return $this->expireCombinedSubmissionAsyncWithHttpInfo($combined_submission_id) + return $this->deleteTemplateAsyncWithHttpInfo($template_id, $contentType) ->then( function ($response) { return $response[0]; @@ -4389,29 +5459,32 @@ function ($response) { } /** - * Operation expireCombinedSubmissionAsyncWithHttpInfo + * Operation deleteTemplateAsyncWithHttpInfo * - * Expire a combined submission + * Delete a template * - * @param string $combined_submission_id (required) + * @param string $template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function expireCombinedSubmissionAsyncWithHttpInfo($combined_submission_id) + public function deleteTemplateAsyncWithHttpInfo($template_id, string $contentType = self::contentTypes['deleteTemplate'][0]) { - $returnType = '\DocSpring\Model\CombinedSubmission'; - $request = $this->expireCombinedSubmissionRequest($combined_submission_id); + $returnType = '\DocSpring\Model\DeleteTemplateResponse'; + $request = $this->deleteTemplateRequest($template_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4431,30 +5504,33 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'expireCombinedSubmission' + * Create request for operation 'deleteTemplate' * - * @param string $combined_submission_id (required) + * @param string $template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function expireCombinedSubmissionRequest($combined_submission_id) + public function deleteTemplateRequest($template_id, string $contentType = self::contentTypes['deleteTemplate'][0]) { - // verify the required parameter 'combined_submission_id' is set - if ($combined_submission_id === null || (is_array($combined_submission_id) && count($combined_submission_id) === 0)) { + + // verify the required parameter 'template_id' is set + if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $combined_submission_id when calling expireCombinedSubmission' + 'Missing the required parameter $template_id when calling deleteTemplate' ); } - $resourcePath = '/combined_submissions/{combined_submission_id}'; + + $resourcePath = '/templates/{template_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4462,60 +5538,50 @@ protected function expireCombinedSubmissionRequest($combined_submission_id) $multipart = false; + // path params - if ($combined_submission_id !== null) { + if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'combined_submission_id' . '}', - ObjectSerializer::toPathValue($combined_submission_id), + '{' . 'template_id' . '}', + ObjectSerializer::toPathValue($template_id), $resourcePath ); } - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -4530,46 +5596,49 @@ protected function expireCombinedSubmissionRequest($combined_submission_id) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); } /** - * Operation expireSubmission + * Operation expireCombinedSubmission * - * Expire a PDF submission + * Expire a combined submission * - * @param string $submission_id submission_id (required) + * @param string $combined_submission_id combined_submission_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['expireCombinedSubmission'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\Submission|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error|\DocSpring\Model\Error + * @return \DocSpring\Model\CombinedSubmission|\DocSpring\Model\ErrorResponse|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError */ - public function expireSubmission($submission_id) + public function expireCombinedSubmission($combined_submission_id, string $contentType = self::contentTypes['expireCombinedSubmission'][0]) { - list($response) = $this->expireSubmissionWithHttpInfo($submission_id); + list($response) = $this->expireCombinedSubmissionWithHttpInfo($combined_submission_id, $contentType); return $response; } /** - * Operation expireSubmissionWithHttpInfo + * Operation expireCombinedSubmissionWithHttpInfo * - * Expire a PDF submission + * Expire a combined submission * - * @param string $submission_id (required) + * @param string $combined_submission_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['expireCombinedSubmission'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\Submission|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error|\DocSpring\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\CombinedSubmission|\DocSpring\Model\ErrorResponse|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function expireSubmissionWithHttpInfo($submission_id) + public function expireCombinedSubmissionWithHttpInfo($combined_submission_id, string $contentType = self::contentTypes['expireCombinedSubmission'][0]) { - $request = $this->expireSubmissionRequest($submission_id); + $request = $this->expireCombinedSubmissionRequest($combined_submission_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -4578,9 +5647,16 @@ public function expireSubmissionWithHttpInfo($submission_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -4591,72 +5667,145 @@ public function expireSubmissionWithHttpInfo($submission_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\DocSpring\Model\Submission' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + if ('\DocSpring\Model\CombinedSubmission' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\CombinedSubmission' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Submission', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\CombinedSubmission', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 404: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; case 403: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 404: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\DocSpring\Model\Submission'; - $responseBody = $response->getBody(); + $returnType = '\DocSpring\Model\CombinedSubmission'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4670,15 +5819,15 @@ public function expireSubmissionWithHttpInfo($submission_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Submission', + '\DocSpring\Model\CombinedSubmission', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\AuthenticationError', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4686,15 +5835,15 @@ public function expireSubmissionWithHttpInfo($submission_id) case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 404: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\AuthenticationError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4705,18 +5854,19 @@ public function expireSubmissionWithHttpInfo($submission_id) } /** - * Operation expireSubmissionAsync + * Operation expireCombinedSubmissionAsync * - * Expire a PDF submission + * Expire a combined submission * - * @param string $submission_id (required) + * @param string $combined_submission_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['expireCombinedSubmission'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function expireSubmissionAsync($submission_id) + public function expireCombinedSubmissionAsync($combined_submission_id, string $contentType = self::contentTypes['expireCombinedSubmission'][0]) { - return $this->expireSubmissionAsyncWithHttpInfo($submission_id) + return $this->expireCombinedSubmissionAsyncWithHttpInfo($combined_submission_id, $contentType) ->then( function ($response) { return $response[0]; @@ -4725,29 +5875,32 @@ function ($response) { } /** - * Operation expireSubmissionAsyncWithHttpInfo + * Operation expireCombinedSubmissionAsyncWithHttpInfo * - * Expire a PDF submission + * Expire a combined submission * - * @param string $submission_id (required) + * @param string $combined_submission_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['expireCombinedSubmission'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function expireSubmissionAsyncWithHttpInfo($submission_id) + public function expireCombinedSubmissionAsyncWithHttpInfo($combined_submission_id, string $contentType = self::contentTypes['expireCombinedSubmission'][0]) { - $returnType = '\DocSpring\Model\Submission'; - $request = $this->expireSubmissionRequest($submission_id); + $returnType = '\DocSpring\Model\CombinedSubmission'; + $request = $this->expireCombinedSubmissionRequest($combined_submission_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4767,30 +5920,33 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'expireSubmission' + * Create request for operation 'expireCombinedSubmission' * - * @param string $submission_id (required) + * @param string $combined_submission_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['expireCombinedSubmission'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function expireSubmissionRequest($submission_id) + public function expireCombinedSubmissionRequest($combined_submission_id, string $contentType = self::contentTypes['expireCombinedSubmission'][0]) { - // verify the required parameter 'submission_id' is set - if ($submission_id === null || (is_array($submission_id) && count($submission_id) === 0)) { + + // verify the required parameter 'combined_submission_id' is set + if ($combined_submission_id === null || (is_array($combined_submission_id) && count($combined_submission_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $submission_id when calling expireSubmission' + 'Missing the required parameter $combined_submission_id when calling expireCombinedSubmission' ); } - $resourcePath = '/submissions/{submission_id}'; + + $resourcePath = '/combined_submissions/{combined_submission_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4798,60 +5954,50 @@ protected function expireSubmissionRequest($submission_id) $multipart = false; + // path params - if ($submission_id !== null) { + if ($combined_submission_id !== null) { $resourcePath = str_replace( - '{' . 'submission_id' . '}', - ObjectSerializer::toPathValue($submission_id), + '{' . 'combined_submission_id' . '}', + ObjectSerializer::toPathValue($combined_submission_id), $resourcePath ); } - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -4866,48 +6012,49 @@ protected function expireSubmissionRequest($submission_id) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); } /** - * Operation generatePDF + * Operation expireSubmission * - * Generates a new PDF + * Expire a PDF submission * - * @param string $template_id template_id (required) - * @param \DocSpring\Model\SubmissionData $submission_data submission_data (required) + * @param string $submission_id submission_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['expireSubmission'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\CreateSubmissionResponse|\DocSpring\Model\Error|\DocSpring\Model\AuthenticationError|\DocSpring\Model\InvalidRequest + * @return \DocSpring\Model\Submission|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError|\DocSpring\Model\ErrorResponse */ - public function generatePDF($template_id, $submission_data) + public function expireSubmission($submission_id, string $contentType = self::contentTypes['expireSubmission'][0]) { - list($response) = $this->generatePDFWithHttpInfo($template_id, $submission_data); + list($response) = $this->expireSubmissionWithHttpInfo($submission_id, $contentType); return $response; } /** - * Operation generatePDFWithHttpInfo + * Operation expireSubmissionWithHttpInfo * - * Generates a new PDF + * Expire a PDF submission * - * @param string $template_id (required) - * @param \DocSpring\Model\SubmissionData $submission_data (required) + * @param string $submission_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['expireSubmission'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\CreateSubmissionResponse|\DocSpring\Model\Error|\DocSpring\Model\AuthenticationError|\DocSpring\Model\InvalidRequest, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\Submission|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError|\DocSpring\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function generatePDFWithHttpInfo($template_id, $submission_data) + public function expireSubmissionWithHttpInfo($submission_id, string $contentType = self::contentTypes['expireSubmission'][0]) { - $request = $this->generatePDFRequest($template_id, $submission_data); + $request = $this->expireSubmissionRequest($submission_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -4916,9 +6063,16 @@ public function generatePDFWithHttpInfo($template_id, $submission_data) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -4929,45 +6083,89 @@ public function generatePDFWithHttpInfo($template_id, $submission_data) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { - case 201: - if ('\DocSpring\Model\CreateSubmissionResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 200: + if ('\DocSpring\Model\Submission' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\Submission' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\CreateSubmissionResponse', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\Submission', []), $response->getStatusCode(), $response->getHeaders() ]; - case 400: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 404: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; case 401: if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4975,26 +6173,55 @@ public function generatePDFWithHttpInfo($template_id, $submission_data) $response->getStatusCode(), $response->getHeaders() ]; - case 422: - if ('\DocSpring\Model\InvalidRequest' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 403: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\InvalidRequest', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\DocSpring\Model\CreateSubmissionResponse'; - $responseBody = $response->getBody(); + $returnType = '\DocSpring\Model\Submission'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5005,18 +6232,18 @@ public function generatePDFWithHttpInfo($template_id, $submission_data) } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\CreateSubmissionResponse', + '\DocSpring\Model\Submission', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 400: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5029,10 +6256,10 @@ public function generatePDFWithHttpInfo($template_id, $submission_data) ); $e->setResponseObject($data); break; - case 422: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\InvalidRequest', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5043,19 +6270,19 @@ public function generatePDFWithHttpInfo($template_id, $submission_data) } /** - * Operation generatePDFAsync + * Operation expireSubmissionAsync * - * Generates a new PDF + * Expire a PDF submission * - * @param string $template_id (required) - * @param \DocSpring\Model\SubmissionData $submission_data (required) + * @param string $submission_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['expireSubmission'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generatePDFAsync($template_id, $submission_data) + public function expireSubmissionAsync($submission_id, string $contentType = self::contentTypes['expireSubmission'][0]) { - return $this->generatePDFAsyncWithHttpInfo($template_id, $submission_data) + return $this->expireSubmissionAsyncWithHttpInfo($submission_id, $contentType) ->then( function ($response) { return $response[0]; @@ -5064,30 +6291,32 @@ function ($response) { } /** - * Operation generatePDFAsyncWithHttpInfo + * Operation expireSubmissionAsyncWithHttpInfo * - * Generates a new PDF + * Expire a PDF submission * - * @param string $template_id (required) - * @param \DocSpring\Model\SubmissionData $submission_data (required) + * @param string $submission_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['expireSubmission'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function generatePDFAsyncWithHttpInfo($template_id, $submission_data) + public function expireSubmissionAsyncWithHttpInfo($submission_id, string $contentType = self::contentTypes['expireSubmission'][0]) { - $returnType = '\DocSpring\Model\CreateSubmissionResponse'; - $request = $this->generatePDFRequest($template_id, $submission_data); + $returnType = '\DocSpring\Model\Submission'; + $request = $this->expireSubmissionRequest($submission_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5107,37 +6336,33 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'generatePDF' + * Create request for operation 'expireSubmission' * - * @param string $template_id (required) - * @param \DocSpring\Model\SubmissionData $submission_data (required) + * @param string $submission_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['expireSubmission'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function generatePDFRequest($template_id, $submission_data) + public function expireSubmissionRequest($submission_id, string $contentType = self::contentTypes['expireSubmission'][0]) { - // verify the required parameter 'template_id' is set - if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $template_id when calling generatePDF' - ); - } - // verify the required parameter 'submission_data' is set - if ($submission_data === null || (is_array($submission_data) && count($submission_data) === 0)) { + + // verify the required parameter 'submission_id' is set + if ($submission_id === null || (is_array($submission_id) && count($submission_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $submission_data when calling generatePDF' + 'Missing the required parameter $submission_id when calling expireSubmission' ); } - $resourcePath = '/templates/{template_id}/submissions'; + + $resourcePath = '/submissions/{submission_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5145,63 +6370,50 @@ protected function generatePDFRequest($template_id, $submission_data) $multipart = false; + // path params - if ($template_id !== null) { + if ($submission_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', - ObjectSerializer::toPathValue($template_id), + '{' . 'submission_id' . '}', + ObjectSerializer::toPathValue($submission_id), $resourcePath ); } - // body params - $_tempBody = null; - if (isset($submission_data)) { - $_tempBody = $submission_data; - } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -5216,46 +6428,51 @@ protected function generatePDFRequest($template_id, $submission_data) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); } /** - * Operation getCombinedSubmission + * Operation generatePDF * - * Check the status of a combined submission (merged PDFs) + * Generates a new PDF * - * @param string $combined_submission_id combined_submission_id (required) + * @param string $template_id template_id (required) + * @param \DocSpring\Model\CreateSubmissionData $submission submission (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePDF'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\CombinedSubmission|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error + * @return \DocSpring\Model\CreateSubmissionResponse|\DocSpring\Model\ErrorResponse|\DocSpring\Model\InvalidRequest|\DocSpring\Model\AuthenticationError */ - public function getCombinedSubmission($combined_submission_id) + public function generatePDF($template_id, $submission, string $contentType = self::contentTypes['generatePDF'][0]) { - list($response) = $this->getCombinedSubmissionWithHttpInfo($combined_submission_id); + list($response) = $this->generatePDFWithHttpInfo($template_id, $submission, $contentType); return $response; } /** - * Operation getCombinedSubmissionWithHttpInfo + * Operation generatePDFWithHttpInfo * - * Check the status of a combined submission (merged PDFs) + * Generates a new PDF * - * @param string $combined_submission_id (required) + * @param string $template_id (required) + * @param \DocSpring\Model\CreateSubmissionData $submission (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePDF'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\CombinedSubmission|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\CreateSubmissionResponse|\DocSpring\Model\ErrorResponse|\DocSpring\Model\InvalidRequest|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function getCombinedSubmissionWithHttpInfo($combined_submission_id) + public function generatePDFWithHttpInfo($template_id, $submission, string $contentType = self::contentTypes['generatePDF'][0]) { - $request = $this->getCombinedSubmissionRequest($combined_submission_id); + $request = $this->generatePDFRequest($template_id, $submission, $contentType); try { $options = $this->createHttpClientOption(); @@ -5264,9 +6481,16 @@ public function getCombinedSubmissionWithHttpInfo($combined_submission_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -5277,60 +6501,145 @@ public function getCombinedSubmissionWithHttpInfo($combined_submission_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { - case 200: - if ('\DocSpring\Model\CombinedSubmission' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 201: + if ('\DocSpring\Model\CreateSubmissionResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\CreateSubmissionResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\CombinedSubmission', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\CreateSubmissionResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 400: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 404: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 422: + if ('\DocSpring\Model\InvalidRequest' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\InvalidRequest' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\DocSpring\Model\InvalidRequest', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\DocSpring\Model\CombinedSubmission'; - $responseBody = $response->getBody(); + $returnType = '\DocSpring\Model\CreateSubmissionResponse'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5341,26 +6650,34 @@ public function getCombinedSubmissionWithHttpInfo($combined_submission_id) } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\CombinedSubmission', + '\DocSpring\Model\CreateSubmissionResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\AuthenticationError', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 404: + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DocSpring\Model\InvalidRequest', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\AuthenticationError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5371,18 +6688,20 @@ public function getCombinedSubmissionWithHttpInfo($combined_submission_id) } /** - * Operation getCombinedSubmissionAsync + * Operation generatePDFAsync * - * Check the status of a combined submission (merged PDFs) + * Generates a new PDF * - * @param string $combined_submission_id (required) + * @param string $template_id (required) + * @param \DocSpring\Model\CreateSubmissionData $submission (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePDF'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCombinedSubmissionAsync($combined_submission_id) + public function generatePDFAsync($template_id, $submission, string $contentType = self::contentTypes['generatePDF'][0]) { - return $this->getCombinedSubmissionAsyncWithHttpInfo($combined_submission_id) + return $this->generatePDFAsyncWithHttpInfo($template_id, $submission, $contentType) ->then( function ($response) { return $response[0]; @@ -5391,29 +6710,33 @@ function ($response) { } /** - * Operation getCombinedSubmissionAsyncWithHttpInfo + * Operation generatePDFAsyncWithHttpInfo * - * Check the status of a combined submission (merged PDFs) + * Generates a new PDF * - * @param string $combined_submission_id (required) + * @param string $template_id (required) + * @param \DocSpring\Model\CreateSubmissionData $submission (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePDF'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCombinedSubmissionAsyncWithHttpInfo($combined_submission_id) + public function generatePDFAsyncWithHttpInfo($template_id, $submission, string $contentType = self::contentTypes['generatePDF'][0]) { - $returnType = '\DocSpring\Model\CombinedSubmission'; - $request = $this->getCombinedSubmissionRequest($combined_submission_id); + $returnType = '\DocSpring\Model\CreateSubmissionResponse'; + $request = $this->generatePDFRequest($template_id, $submission, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5433,30 +6756,41 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'getCombinedSubmission' + * Create request for operation 'generatePDF' * - * @param string $combined_submission_id (required) + * @param string $template_id (required) + * @param \DocSpring\Model\CreateSubmissionData $submission (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['generatePDF'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCombinedSubmissionRequest($combined_submission_id) + public function generatePDFRequest($template_id, $submission, string $contentType = self::contentTypes['generatePDF'][0]) { - // verify the required parameter 'combined_submission_id' is set - if ($combined_submission_id === null || (is_array($combined_submission_id) && count($combined_submission_id) === 0)) { + + // verify the required parameter 'template_id' is set + if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $combined_submission_id when calling getCombinedSubmission' + 'Missing the required parameter $template_id when calling generatePDF' ); } - $resourcePath = '/combined_submissions/{combined_submission_id}'; + // verify the required parameter 'submission' is set + if ($submission === null || (is_array($submission) && count($submission) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $submission when calling generatePDF' + ); + } + + + $resourcePath = '/templates/{template_id}/submissions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5464,60 +6798,57 @@ protected function getCombinedSubmissionRequest($combined_submission_id) $multipart = false; + // path params - if ($combined_submission_id !== null) { + if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'combined_submission_id' . '}', - ObjectSerializer::toPathValue($combined_submission_id), + '{' . 'template_id' . '}', + ObjectSerializer::toPathValue($template_id), $resourcePath ); } - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + if (isset($submission)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($submission)); } else { - $httpBody = $_tempBody; + $httpBody = $submission; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -5532,46 +6863,49 @@ protected function getCombinedSubmissionRequest($combined_submission_id) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); } /** - * Operation getDataRequest + * Operation getCombinedSubmission * - * Look up a submission data request + * Check the status of a combined submission (merged PDFs) * - * @param string $data_request_id data_request_id (required) + * @param string $combined_submission_id combined_submission_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCombinedSubmission'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\SubmissionDataRequest|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error + * @return \DocSpring\Model\CombinedSubmission|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError */ - public function getDataRequest($data_request_id) + public function getCombinedSubmission($combined_submission_id, string $contentType = self::contentTypes['getCombinedSubmission'][0]) { - list($response) = $this->getDataRequestWithHttpInfo($data_request_id); + list($response) = $this->getCombinedSubmissionWithHttpInfo($combined_submission_id, $contentType); return $response; } /** - * Operation getDataRequestWithHttpInfo + * Operation getCombinedSubmissionWithHttpInfo * - * Look up a submission data request + * Check the status of a combined submission (merged PDFs) * - * @param string $data_request_id (required) + * @param string $combined_submission_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCombinedSubmission'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\SubmissionDataRequest|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\CombinedSubmission|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function getDataRequestWithHttpInfo($data_request_id) + public function getCombinedSubmissionWithHttpInfo($combined_submission_id, string $contentType = self::contentTypes['getCombinedSubmission'][0]) { - $request = $this->getDataRequestRequest($data_request_id); + $request = $this->getCombinedSubmissionRequest($combined_submission_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -5580,9 +6914,16 @@ public function getDataRequestWithHttpInfo($data_request_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -5593,60 +6934,118 @@ public function getDataRequestWithHttpInfo($data_request_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\DocSpring\Model\SubmissionDataRequest' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + if ('\DocSpring\Model\CombinedSubmission' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\CombinedSubmission' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\SubmissionDataRequest', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\CombinedSubmission', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 404: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 404: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\DocSpring\Model\SubmissionDataRequest'; - $responseBody = $response->getBody(); + $returnType = '\DocSpring\Model\CombinedSubmission'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5660,23 +7059,23 @@ public function getDataRequestWithHttpInfo($data_request_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\SubmissionDataRequest', + '\DocSpring\Model\CombinedSubmission', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\AuthenticationError', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 404: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\AuthenticationError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5687,18 +7086,19 @@ public function getDataRequestWithHttpInfo($data_request_id) } /** - * Operation getDataRequestAsync + * Operation getCombinedSubmissionAsync * - * Look up a submission data request + * Check the status of a combined submission (merged PDFs) * - * @param string $data_request_id (required) + * @param string $combined_submission_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCombinedSubmission'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDataRequestAsync($data_request_id) + public function getCombinedSubmissionAsync($combined_submission_id, string $contentType = self::contentTypes['getCombinedSubmission'][0]) { - return $this->getDataRequestAsyncWithHttpInfo($data_request_id) + return $this->getCombinedSubmissionAsyncWithHttpInfo($combined_submission_id, $contentType) ->then( function ($response) { return $response[0]; @@ -5707,29 +7107,32 @@ function ($response) { } /** - * Operation getDataRequestAsyncWithHttpInfo + * Operation getCombinedSubmissionAsyncWithHttpInfo * - * Look up a submission data request + * Check the status of a combined submission (merged PDFs) * - * @param string $data_request_id (required) + * @param string $combined_submission_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCombinedSubmission'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getDataRequestAsyncWithHttpInfo($data_request_id) + public function getCombinedSubmissionAsyncWithHttpInfo($combined_submission_id, string $contentType = self::contentTypes['getCombinedSubmission'][0]) { - $returnType = '\DocSpring\Model\SubmissionDataRequest'; - $request = $this->getDataRequestRequest($data_request_id); + $returnType = '\DocSpring\Model\CombinedSubmission'; + $request = $this->getCombinedSubmissionRequest($combined_submission_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5749,30 +7152,33 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'getDataRequest' + * Create request for operation 'getCombinedSubmission' * - * @param string $data_request_id (required) + * @param string $combined_submission_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCombinedSubmission'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getDataRequestRequest($data_request_id) + public function getCombinedSubmissionRequest($combined_submission_id, string $contentType = self::contentTypes['getCombinedSubmission'][0]) { - // verify the required parameter 'data_request_id' is set - if ($data_request_id === null || (is_array($data_request_id) && count($data_request_id) === 0)) { + + // verify the required parameter 'combined_submission_id' is set + if ($combined_submission_id === null || (is_array($combined_submission_id) && count($combined_submission_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $data_request_id when calling getDataRequest' + 'Missing the required parameter $combined_submission_id when calling getCombinedSubmission' ); } - $resourcePath = '/data_requests/{data_request_id}'; + + $resourcePath = '/combined_submissions/{combined_submission_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5780,60 +7186,50 @@ protected function getDataRequestRequest($data_request_id) $multipart = false; + // path params - if ($data_request_id !== null) { + if ($combined_submission_id !== null) { $resourcePath = str_replace( - '{' . 'data_request_id' . '}', - ObjectSerializer::toPathValue($data_request_id), + '{' . 'combined_submission_id' . '}', + ObjectSerializer::toPathValue($combined_submission_id), $resourcePath ); } - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -5848,46 +7244,49 @@ protected function getDataRequestRequest($data_request_id) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); } /** - * Operation getFullTemplate + * Operation getDataRequest * - * Fetch the full template attributes + * Look up a submission data request * - * @param string $template_id template_id (required) + * @param string $data_request_id data_request_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDataRequest'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\FullTemplate|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error + * @return \DocSpring\Model\SubmissionDataRequest|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError */ - public function getFullTemplate($template_id) + public function getDataRequest($data_request_id, string $contentType = self::contentTypes['getDataRequest'][0]) { - list($response) = $this->getFullTemplateWithHttpInfo($template_id); + list($response) = $this->getDataRequestWithHttpInfo($data_request_id, $contentType); return $response; } /** - * Operation getFullTemplateWithHttpInfo + * Operation getDataRequestWithHttpInfo * - * Fetch the full template attributes + * Look up a submission data request * - * @param string $template_id (required) + * @param string $data_request_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDataRequest'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\FullTemplate|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\SubmissionDataRequest|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function getFullTemplateWithHttpInfo($template_id) + public function getDataRequestWithHttpInfo($data_request_id, string $contentType = self::contentTypes['getDataRequest'][0]) { - $request = $this->getFullTemplateRequest($template_id); + $request = $this->getDataRequestRequest($data_request_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -5896,9 +7295,16 @@ public function getFullTemplateWithHttpInfo($template_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -5909,60 +7315,118 @@ public function getFullTemplateWithHttpInfo($template_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\DocSpring\Model\FullTemplate' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + if ('\DocSpring\Model\SubmissionDataRequest' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\SubmissionDataRequest' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\FullTemplate', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\SubmissionDataRequest', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 404: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 404: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\DocSpring\Model\FullTemplate'; - $responseBody = $response->getBody(); + $returnType = '\DocSpring\Model\SubmissionDataRequest'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5976,23 +7440,23 @@ public function getFullTemplateWithHttpInfo($template_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\FullTemplate', + '\DocSpring\Model\SubmissionDataRequest', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\AuthenticationError', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 404: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\AuthenticationError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6003,18 +7467,19 @@ public function getFullTemplateWithHttpInfo($template_id) } /** - * Operation getFullTemplateAsync + * Operation getDataRequestAsync * - * Fetch the full template attributes + * Look up a submission data request * - * @param string $template_id (required) + * @param string $data_request_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDataRequest'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFullTemplateAsync($template_id) + public function getDataRequestAsync($data_request_id, string $contentType = self::contentTypes['getDataRequest'][0]) { - return $this->getFullTemplateAsyncWithHttpInfo($template_id) + return $this->getDataRequestAsyncWithHttpInfo($data_request_id, $contentType) ->then( function ($response) { return $response[0]; @@ -6023,29 +7488,32 @@ function ($response) { } /** - * Operation getFullTemplateAsyncWithHttpInfo + * Operation getDataRequestAsyncWithHttpInfo * - * Fetch the full template attributes + * Look up a submission data request * - * @param string $template_id (required) + * @param string $data_request_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDataRequest'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getFullTemplateAsyncWithHttpInfo($template_id) + public function getDataRequestAsyncWithHttpInfo($data_request_id, string $contentType = self::contentTypes['getDataRequest'][0]) { - $returnType = '\DocSpring\Model\FullTemplate'; - $request = $this->getFullTemplateRequest($template_id); + $returnType = '\DocSpring\Model\SubmissionDataRequest'; + $request = $this->getDataRequestRequest($data_request_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6065,30 +7533,33 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'getFullTemplate' + * Create request for operation 'getDataRequest' * - * @param string $template_id (required) + * @param string $data_request_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDataRequest'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getFullTemplateRequest($template_id) + public function getDataRequestRequest($data_request_id, string $contentType = self::contentTypes['getDataRequest'][0]) { - // verify the required parameter 'template_id' is set - if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { + + // verify the required parameter 'data_request_id' is set + if ($data_request_id === null || (is_array($data_request_id) && count($data_request_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $template_id when calling getFullTemplate' + 'Missing the required parameter $data_request_id when calling getDataRequest' ); } - $resourcePath = '/templates/{template_id}?full=true'; + + $resourcePath = '/data_requests/{data_request_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6096,60 +7567,50 @@ protected function getFullTemplateRequest($template_id) $multipart = false; + // path params - if ($template_id !== null) { + if ($data_request_id !== null) { $resourcePath = str_replace( - '{' . 'template_id' . '}', - ObjectSerializer::toPathValue($template_id), + '{' . 'data_request_id' . '}', + ObjectSerializer::toPathValue($data_request_id), $resourcePath ); } - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -6164,44 +7625,49 @@ protected function getFullTemplateRequest($template_id) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); } /** - * Operation getPresignUrl + * Operation getFullTemplate * - * Get a presigned URL so that you can upload a file to our AWS S3 bucket + * Fetch the full template attributes * + * @param string $template_id template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFullTemplate'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return map[string,object]|\DocSpring\Model\AuthenticationError + * @return \DocSpring\Model\FullTemplate|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError */ - public function getPresignUrl() + public function getFullTemplate($template_id, string $contentType = self::contentTypes['getFullTemplate'][0]) { - list($response) = $this->getPresignUrlWithHttpInfo(); + list($response) = $this->getFullTemplateWithHttpInfo($template_id, $contentType); return $response; } /** - * Operation getPresignUrlWithHttpInfo + * Operation getFullTemplateWithHttpInfo * - * Get a presigned URL so that you can upload a file to our AWS S3 bucket + * Fetch the full template attributes * + * @param string $template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFullTemplate'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of map[string,object]|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\FullTemplate|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function getPresignUrlWithHttpInfo() + public function getFullTemplateWithHttpInfo($template_id, string $contentType = self::contentTypes['getFullTemplate'][0]) { - $request = $this->getPresignUrlRequest(); + $request = $this->getFullTemplateRequest($template_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -6210,9 +7676,16 @@ public function getPresignUrlWithHttpInfo() } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -6223,33 +7696,89 @@ public function getPresignUrlWithHttpInfo() sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('map[string,object]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\DocSpring\Model\FullTemplate' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\FullTemplate' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\DocSpring\Model\FullTemplate', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, 'map[string,object]', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; case 401: if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6259,12 +7788,26 @@ public function getPresignUrlWithHttpInfo() ]; } - $returnType = 'map[string,object]'; - $responseBody = $response->getBody(); + $returnType = '\DocSpring\Model\FullTemplate'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6278,7 +7821,15 @@ public function getPresignUrlWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'map[string,object]', + '\DocSpring\Model\FullTemplate', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6297,17 +7848,19 @@ public function getPresignUrlWithHttpInfo() } /** - * Operation getPresignUrlAsync + * Operation getFullTemplateAsync * - * Get a presigned URL so that you can upload a file to our AWS S3 bucket + * Fetch the full template attributes * + * @param string $template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFullTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPresignUrlAsync() + public function getFullTemplateAsync($template_id, string $contentType = self::contentTypes['getFullTemplate'][0]) { - return $this->getPresignUrlAsyncWithHttpInfo() + return $this->getFullTemplateAsyncWithHttpInfo($template_id, $contentType) ->then( function ($response) { return $response[0]; @@ -6316,28 +7869,32 @@ function ($response) { } /** - * Operation getPresignUrlAsyncWithHttpInfo + * Operation getFullTemplateAsyncWithHttpInfo * - * Get a presigned URL so that you can upload a file to our AWS S3 bucket + * Fetch the full template attributes * + * @param string $template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFullTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPresignUrlAsyncWithHttpInfo() + public function getFullTemplateAsyncWithHttpInfo($template_id, string $contentType = self::contentTypes['getFullTemplate'][0]) { - $returnType = 'map[string,object]'; - $request = $this->getPresignUrlRequest(); + $returnType = '\DocSpring\Model\FullTemplate'; + $request = $this->getFullTemplateRequest($template_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6357,76 +7914,806 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'getPresignUrl' + * Create request for operation 'getFullTemplate' * + * @param string $template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFullTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getPresignUrlRequest() + public function getFullTemplateRequest($template_id, string $contentType = self::contentTypes['getFullTemplate'][0]) { - $resourcePath = '/uploads/presign'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; + // verify the required parameter 'template_id' is set + if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $template_id when calling getFullTemplate' + ); + } + + + $resourcePath = '/templates/{template_id}?full=true'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($template_id !== null) { + $resourcePath = str_replace( + '{' . 'template_id' . '}', + ObjectSerializer::toPathValue($template_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPresignUrl + * + * Get a presigned URL so that you can upload a file to our AWS S3 bucket + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPresignUrl'] to see the possible values for this operation + * + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return object|\DocSpring\Model\AuthenticationError + */ + public function getPresignUrl(string $contentType = self::contentTypes['getPresignUrl'][0]) + { + list($response) = $this->getPresignUrlWithHttpInfo($contentType); + return $response; + } + + /** + * Operation getPresignUrlWithHttpInfo + * + * Get a presigned URL so that you can upload a file to our AWS S3 bucket + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPresignUrl'] to see the possible values for this operation + * + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of object|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) + */ + public function getPresignUrlWithHttpInfo(string $contentType = self::contentTypes['getPresignUrl'][0]) + { + $request = $this->getPresignUrlRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + 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 ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('object' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'object'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DocSpring\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPresignUrlAsync + * + * Get a presigned URL so that you can upload a file to our AWS S3 bucket + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPresignUrl'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPresignUrlAsync(string $contentType = self::contentTypes['getPresignUrl'][0]) + { + return $this->getPresignUrlAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPresignUrlAsyncWithHttpInfo + * + * Get a presigned URL so that you can upload a file to our AWS S3 bucket + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPresignUrl'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPresignUrlAsyncWithHttpInfo(string $contentType = self::contentTypes['getPresignUrl'][0]) + { + $returnType = 'object'; + $request = $this->getPresignUrlRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPresignUrl' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPresignUrl'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPresignUrlRequest(string $contentType = self::contentTypes['getPresignUrl'][0]) + { + + + $resourcePath = '/uploads/presign'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; $multipart = false; - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getSubmission + * + * Check the status of a PDF + * + * @param string $submission_id submission_id (required) + * @param bool $include_data include_data (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubmission'] to see the possible values for this operation + * + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \DocSpring\Model\Submission|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError + */ + public function getSubmission($submission_id, $include_data = null, string $contentType = self::contentTypes['getSubmission'][0]) + { + list($response) = $this->getSubmissionWithHttpInfo($submission_id, $include_data, $contentType); + return $response; + } + + /** + * Operation getSubmissionWithHttpInfo + * + * Check the status of a PDF + * + * @param string $submission_id (required) + * @param bool $include_data (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubmission'] to see the possible values for this operation + * + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \DocSpring\Model\Submission|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) + */ + public function getSubmissionWithHttpInfo($submission_id, $include_data = null, string $contentType = self::contentTypes['getSubmission'][0]) + { + $request = $this->getSubmissionRequest($submission_id, $include_data, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + 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 ('\DocSpring\Model\Submission' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\Submission' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\DocSpring\Model\Submission', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\DocSpring\Model\Submission'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DocSpring\Model\Submission', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DocSpring\Model\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DocSpring\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getSubmissionAsync + * + * Check the status of a PDF + * + * @param string $submission_id (required) + * @param bool $include_data (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubmission'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSubmissionAsync($submission_id, $include_data = null, string $contentType = self::contentTypes['getSubmission'][0]) + { + return $this->getSubmissionAsyncWithHttpInfo($submission_id, $include_data, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getSubmissionAsyncWithHttpInfo + * + * Check the status of a PDF + * + * @param string $submission_id (required) + * @param bool $include_data (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubmission'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSubmissionAsyncWithHttpInfo($submission_id, $include_data = null, string $contentType = self::contentTypes['getSubmission'][0]) + { + $returnType = '\DocSpring\Model\Submission'; + $request = $this->getSubmissionRequest($submission_id, $include_data, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getSubmission' + * + * @param string $submission_id (required) + * @param bool $include_data (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubmission'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getSubmissionRequest($submission_id, $include_data = null, string $contentType = self::contentTypes['getSubmission'][0]) + { + + // verify the required parameter 'submission_id' is set + if ($submission_id === null || (is_array($submission_id) && count($submission_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $submission_id when calling getSubmission' ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] + } + + + + $resourcePath = '/submissions/{submission_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_data, + 'include_data', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + + + // path params + if ($submission_id !== null) { + $resourcePath = str_replace( + '{' . 'submission_id' . '}', + ObjectSerializer::toPathValue($submission_id), + $resourcePath ); } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -6441,48 +8728,51 @@ protected function getPresignUrlRequest() $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); } /** - * Operation getSubmission + * Operation getSubmissionBatch * - * Check the status of a PDF + * Check the status of a submission batch job * - * @param string $submission_id submission_id (required) - * @param bool $include_data include_data (optional) + * @param string $submission_batch_id submission_batch_id (required) + * @param bool $include_submissions include_submissions (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubmissionBatch'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\Submission|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error + * @return \DocSpring\Model\SubmissionBatch|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError */ - public function getSubmission($submission_id, $include_data = null) + public function getSubmissionBatch($submission_batch_id, $include_submissions = null, string $contentType = self::contentTypes['getSubmissionBatch'][0]) { - list($response) = $this->getSubmissionWithHttpInfo($submission_id, $include_data); + list($response) = $this->getSubmissionBatchWithHttpInfo($submission_batch_id, $include_submissions, $contentType); return $response; } /** - * Operation getSubmissionWithHttpInfo + * Operation getSubmissionBatchWithHttpInfo * - * Check the status of a PDF + * Check the status of a submission batch job * - * @param string $submission_id (required) - * @param bool $include_data (optional) + * @param string $submission_batch_id (required) + * @param bool $include_submissions (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubmissionBatch'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\Submission|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\SubmissionBatch|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function getSubmissionWithHttpInfo($submission_id, $include_data = null) + public function getSubmissionBatchWithHttpInfo($submission_batch_id, $include_submissions = null, string $contentType = self::contentTypes['getSubmissionBatch'][0]) { - $request = $this->getSubmissionRequest($submission_id, $include_data); + $request = $this->getSubmissionBatchRequest($submission_batch_id, $include_submissions, $contentType); try { $options = $this->createHttpClientOption(); @@ -6491,9 +8781,16 @@ public function getSubmissionWithHttpInfo($submission_id, $include_data = null) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -6504,60 +8801,118 @@ public function getSubmissionWithHttpInfo($submission_id, $include_data = null) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\DocSpring\Model\Submission' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + if ('\DocSpring\Model\SubmissionBatch' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\SubmissionBatch' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Submission', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\SubmissionBatch', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 404: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 404: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\DocSpring\Model\Submission'; - $responseBody = $response->getBody(); + $returnType = '\DocSpring\Model\SubmissionBatch'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6571,23 +8926,23 @@ public function getSubmissionWithHttpInfo($submission_id, $include_data = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Submission', + '\DocSpring\Model\SubmissionBatch', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\AuthenticationError', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 404: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\AuthenticationError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6598,19 +8953,20 @@ public function getSubmissionWithHttpInfo($submission_id, $include_data = null) } /** - * Operation getSubmissionAsync + * Operation getSubmissionBatchAsync * - * Check the status of a PDF + * Check the status of a submission batch job * - * @param string $submission_id (required) - * @param bool $include_data (optional) + * @param string $submission_batch_id (required) + * @param bool $include_submissions (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubmissionBatch'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSubmissionAsync($submission_id, $include_data = null) + public function getSubmissionBatchAsync($submission_batch_id, $include_submissions = null, string $contentType = self::contentTypes['getSubmissionBatch'][0]) { - return $this->getSubmissionAsyncWithHttpInfo($submission_id, $include_data) + return $this->getSubmissionBatchAsyncWithHttpInfo($submission_batch_id, $include_submissions, $contentType) ->then( function ($response) { return $response[0]; @@ -6619,30 +8975,33 @@ function ($response) { } /** - * Operation getSubmissionAsyncWithHttpInfo + * Operation getSubmissionBatchAsyncWithHttpInfo * - * Check the status of a PDF + * Check the status of a submission batch job * - * @param string $submission_id (required) - * @param bool $include_data (optional) + * @param string $submission_batch_id (required) + * @param bool $include_submissions (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubmissionBatch'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSubmissionAsyncWithHttpInfo($submission_id, $include_data = null) + public function getSubmissionBatchAsyncWithHttpInfo($submission_batch_id, $include_submissions = null, string $contentType = self::contentTypes['getSubmissionBatch'][0]) { - $returnType = '\DocSpring\Model\Submission'; - $request = $this->getSubmissionRequest($submission_id, $include_data); + $returnType = '\DocSpring\Model\SubmissionBatch'; + $request = $this->getSubmissionBatchRequest($submission_batch_id, $include_submissions, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6662,31 +9021,35 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'getSubmission' + * Create request for operation 'getSubmissionBatch' * - * @param string $submission_id (required) - * @param bool $include_data (optional) + * @param string $submission_batch_id (required) + * @param bool $include_submissions (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getSubmissionBatch'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getSubmissionRequest($submission_id, $include_data = null) + public function getSubmissionBatchRequest($submission_batch_id, $include_submissions = null, string $contentType = self::contentTypes['getSubmissionBatch'][0]) { - // verify the required parameter 'submission_id' is set - if ($submission_id === null || (is_array($submission_id) && count($submission_id) === 0)) { + + // verify the required parameter 'submission_batch_id' is set + if ($submission_batch_id === null || (is_array($submission_batch_id) && count($submission_batch_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $submission_id when calling getSubmission' + 'Missing the required parameter $submission_batch_id when calling getSubmissionBatch' ); } - $resourcePath = '/submissions/{submission_id}'; + + + $resourcePath = '/submissions/batches/{submission_batch_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6694,64 +9057,59 @@ protected function getSubmissionRequest($submission_id, $include_data = null) $multipart = false; // query params - if ($include_data !== null) { - $queryParams['include_data'] = ObjectSerializer::toQueryValue($include_data); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_submissions, + 'include_submissions', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // path params - if ($submission_id !== null) { + if ($submission_batch_id !== null) { $resourcePath = str_replace( - '{' . 'submission_id' . '}', - ObjectSerializer::toPathValue($submission_id), + '{' . 'submission_batch_id' . '}', + ObjectSerializer::toPathValue($submission_batch_id), $resourcePath ); } - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -6766,48 +9124,49 @@ protected function getSubmissionRequest($submission_id, $include_data = null) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); } /** - * Operation getSubmissionBatch + * Operation getTemplate * - * Check the status of a submission batch job + * Check the status of an uploaded template * - * @param string $submission_batch_id submission_batch_id (required) - * @param bool $include_submissions include_submissions (optional) + * @param string $template_id template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTemplate'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\SubmissionBatch|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error + * @return \DocSpring\Model\Template|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError */ - public function getSubmissionBatch($submission_batch_id, $include_submissions = null) + public function getTemplate($template_id, string $contentType = self::contentTypes['getTemplate'][0]) { - list($response) = $this->getSubmissionBatchWithHttpInfo($submission_batch_id, $include_submissions); + list($response) = $this->getTemplateWithHttpInfo($template_id, $contentType); return $response; } /** - * Operation getSubmissionBatchWithHttpInfo + * Operation getTemplateWithHttpInfo * - * Check the status of a submission batch job + * Check the status of an uploaded template * - * @param string $submission_batch_id (required) - * @param bool $include_submissions (optional) + * @param string $template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTemplate'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\SubmissionBatch|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\Template|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function getSubmissionBatchWithHttpInfo($submission_batch_id, $include_submissions = null) + public function getTemplateWithHttpInfo($template_id, string $contentType = self::contentTypes['getTemplate'][0]) { - $request = $this->getSubmissionBatchRequest($submission_batch_id, $include_submissions); + $request = $this->getTemplateRequest($template_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -6816,9 +9175,16 @@ public function getSubmissionBatchWithHttpInfo($submission_batch_id, $include_su } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -6829,60 +9195,118 @@ public function getSubmissionBatchWithHttpInfo($submission_batch_id, $include_su sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\DocSpring\Model\SubmissionBatch' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + if ('\DocSpring\Model\Template' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\Template' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\SubmissionBatch', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\Template', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 404: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 404: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\DocSpring\Model\SubmissionBatch'; - $responseBody = $response->getBody(); + $returnType = '\DocSpring\Model\Template'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6896,23 +9320,23 @@ public function getSubmissionBatchWithHttpInfo($submission_batch_id, $include_su case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\SubmissionBatch', + '\DocSpring\Model\Template', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\AuthenticationError', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 404: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\AuthenticationError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6923,19 +9347,19 @@ public function getSubmissionBatchWithHttpInfo($submission_batch_id, $include_su } /** - * Operation getSubmissionBatchAsync + * Operation getTemplateAsync * - * Check the status of a submission batch job + * Check the status of an uploaded template * - * @param string $submission_batch_id (required) - * @param bool $include_submissions (optional) + * @param string $template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSubmissionBatchAsync($submission_batch_id, $include_submissions = null) + public function getTemplateAsync($template_id, string $contentType = self::contentTypes['getTemplate'][0]) { - return $this->getSubmissionBatchAsyncWithHttpInfo($submission_batch_id, $include_submissions) + return $this->getTemplateAsyncWithHttpInfo($template_id, $contentType) ->then( function ($response) { return $response[0]; @@ -6944,30 +9368,32 @@ function ($response) { } /** - * Operation getSubmissionBatchAsyncWithHttpInfo + * Operation getTemplateAsyncWithHttpInfo * - * Check the status of a submission batch job + * Check the status of an uploaded template * - * @param string $submission_batch_id (required) - * @param bool $include_submissions (optional) + * @param string $template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSubmissionBatchAsyncWithHttpInfo($submission_batch_id, $include_submissions = null) + public function getTemplateAsyncWithHttpInfo($template_id, string $contentType = self::contentTypes['getTemplate'][0]) { - $returnType = '\DocSpring\Model\SubmissionBatch'; - $request = $this->getSubmissionBatchRequest($submission_batch_id, $include_submissions); + $returnType = '\DocSpring\Model\Template'; + $request = $this->getTemplateRequest($template_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6987,96 +9413,84 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'getSubmissionBatch' + * Create request for operation 'getTemplate' * - * @param string $submission_batch_id (required) - * @param bool $include_submissions (optional) + * @param string $template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getSubmissionBatchRequest($submission_batch_id, $include_submissions = null) + public function getTemplateRequest($template_id, string $contentType = self::contentTypes['getTemplate'][0]) { - // verify the required parameter 'submission_batch_id' is set - if ($submission_batch_id === null || (is_array($submission_batch_id) && count($submission_batch_id) === 0)) { + + // verify the required parameter 'template_id' is set + if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $submission_batch_id when calling getSubmissionBatch' + 'Missing the required parameter $template_id when calling getTemplate' ); } - $resourcePath = '/submissions/batches/{submission_batch_id}'; + + $resourcePath = '/templates/{template_id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($include_submissions !== null) { - $queryParams['include_submissions'] = ObjectSerializer::toQueryValue($include_submissions); - } + // path params - if ($submission_batch_id !== null) { + if ($template_id !== null) { $resourcePath = str_replace( - '{' . 'submission_batch_id' . '}', - ObjectSerializer::toPathValue($submission_batch_id), + '{' . 'template_id' . '}', + ObjectSerializer::toPathValue($template_id), $resourcePath ); } - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -7091,46 +9505,49 @@ protected function getSubmissionBatchRequest($submission_batch_id, $include_subm $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); } /** - * Operation getTemplate + * Operation getTemplateSchema * - * Check the status of an uploaded template + * Fetch the JSON schema for a template * * @param string $template_id template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTemplateSchema'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\Template|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error + * @return object|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError */ - public function getTemplate($template_id) + public function getTemplateSchema($template_id, string $contentType = self::contentTypes['getTemplateSchema'][0]) { - list($response) = $this->getTemplateWithHttpInfo($template_id); + list($response) = $this->getTemplateSchemaWithHttpInfo($template_id, $contentType); return $response; } /** - * Operation getTemplateWithHttpInfo + * Operation getTemplateSchemaWithHttpInfo * - * Check the status of an uploaded template + * Fetch the JSON schema for a template * * @param string $template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTemplateSchema'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\Template|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of object|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function getTemplateWithHttpInfo($template_id) + public function getTemplateSchemaWithHttpInfo($template_id, string $contentType = self::contentTypes['getTemplateSchema'][0]) { - $request = $this->getTemplateRequest($template_id); + $request = $this->getTemplateSchemaRequest($template_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -7139,9 +9556,16 @@ public function getTemplateWithHttpInfo($template_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -7152,60 +9576,118 @@ public function getTemplateWithHttpInfo($template_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\DocSpring\Model\Template' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('object' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Template', []), + ObjectSerializer::deserialize($content, 'object', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 404: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 404: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\DocSpring\Model\Template'; - $responseBody = $response->getBody(); + $returnType = 'object'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7219,23 +9701,23 @@ public function getTemplateWithHttpInfo($template_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Template', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\AuthenticationError', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 404: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\AuthenticationError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7246,18 +9728,19 @@ public function getTemplateWithHttpInfo($template_id) } /** - * Operation getTemplateAsync + * Operation getTemplateSchemaAsync * - * Check the status of an uploaded template + * Fetch the JSON schema for a template * * @param string $template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTemplateSchema'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTemplateAsync($template_id) + public function getTemplateSchemaAsync($template_id, string $contentType = self::contentTypes['getTemplateSchema'][0]) { - return $this->getTemplateAsyncWithHttpInfo($template_id) + return $this->getTemplateSchemaAsyncWithHttpInfo($template_id, $contentType) ->then( function ($response) { return $response[0]; @@ -7266,29 +9749,32 @@ function ($response) { } /** - * Operation getTemplateAsyncWithHttpInfo + * Operation getTemplateSchemaAsyncWithHttpInfo * - * Check the status of an uploaded template + * Fetch the JSON schema for a template * * @param string $template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTemplateSchema'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTemplateAsyncWithHttpInfo($template_id) + public function getTemplateSchemaAsyncWithHttpInfo($template_id, string $contentType = self::contentTypes['getTemplateSchema'][0]) { - $returnType = '\DocSpring\Model\Template'; - $request = $this->getTemplateRequest($template_id); + $returnType = 'object'; + $request = $this->getTemplateSchemaRequest($template_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7308,30 +9794,33 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'getTemplate' + * Create request for operation 'getTemplateSchema' * * @param string $template_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTemplateSchema'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getTemplateRequest($template_id) + public function getTemplateSchemaRequest($template_id, string $contentType = self::contentTypes['getTemplateSchema'][0]) { + // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $template_id when calling getTemplate' + 'Missing the required parameter $template_id when calling getTemplateSchema' ); } - $resourcePath = '/templates/{template_id}'; + + $resourcePath = '/templates/{template_id}/schema'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7339,6 +9828,7 @@ protected function getTemplateRequest($template_id) $multipart = false; + // path params if ($template_id !== null) { $resourcePath = str_replace( @@ -7348,51 +9838,40 @@ protected function getTemplateRequest($template_id) ); } - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -7407,46 +9886,51 @@ protected function getTemplateRequest($template_id) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); } /** - * Operation getTemplateSchema + * Operation listCombinedSubmissions * - * Fetch the JSON schema for a template + * Get a list of all combined submissions * - * @param string $template_id template_id (required) + * @param int $page Default: 1 (optional) + * @param int $per_page Default: 50 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listCombinedSubmissions'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return map[string,object]|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error + * @return \DocSpring\Model\CombinedSubmission[]|\DocSpring\Model\AuthenticationError */ - public function getTemplateSchema($template_id) + public function listCombinedSubmissions($page = null, $per_page = null, string $contentType = self::contentTypes['listCombinedSubmissions'][0]) { - list($response) = $this->getTemplateSchemaWithHttpInfo($template_id); + list($response) = $this->listCombinedSubmissionsWithHttpInfo($page, $per_page, $contentType); return $response; } /** - * Operation getTemplateSchemaWithHttpInfo + * Operation listCombinedSubmissionsWithHttpInfo * - * Fetch the JSON schema for a template + * Get a list of all combined submissions * - * @param string $template_id (required) + * @param int $page Default: 1 (optional) + * @param int $per_page Default: 50 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listCombinedSubmissions'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of map[string,object]|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\CombinedSubmission[]|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function getTemplateSchemaWithHttpInfo($template_id) + public function listCombinedSubmissionsWithHttpInfo($page = null, $per_page = null, string $contentType = self::contentTypes['listCombinedSubmissions'][0]) { - $request = $this->getTemplateSchemaRequest($template_id); + $request = $this->listCombinedSubmissionsRequest($page, $per_page, $contentType); try { $options = $this->createHttpClientOption(); @@ -7455,9 +9939,16 @@ public function getTemplateSchemaWithHttpInfo($template_id) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -7468,33 +9959,62 @@ public function getTemplateSchemaWithHttpInfo($template_id) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('map[string,object]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\DocSpring\Model\CombinedSubmission[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\CombinedSubmission[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, 'map[string,object]', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\CombinedSubmission[]', []), $response->getStatusCode(), $response->getHeaders() ]; case 401: if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7502,26 +10022,28 @@ public function getTemplateSchemaWithHttpInfo($template_id) $response->getStatusCode(), $response->getHeaders() ]; - case 404: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - } - - return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; } - $returnType = 'map[string,object]'; - $responseBody = $response->getBody(); + $returnType = '\DocSpring\Model\CombinedSubmission[]'; if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7535,7 +10057,7 @@ public function getTemplateSchemaWithHttpInfo($template_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'map[string,object]', + '\DocSpring\Model\CombinedSubmission[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7548,32 +10070,26 @@ public function getTemplateSchemaWithHttpInfo($template_id) ); $e->setResponseObject($data); break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\DocSpring\Model\Error', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation getTemplateSchemaAsync + * Operation listCombinedSubmissionsAsync * - * Fetch the JSON schema for a template + * Get a list of all combined submissions * - * @param string $template_id (required) + * @param int $page Default: 1 (optional) + * @param int $per_page Default: 50 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listCombinedSubmissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTemplateSchemaAsync($template_id) + public function listCombinedSubmissionsAsync($page = null, $per_page = null, string $contentType = self::contentTypes['listCombinedSubmissions'][0]) { - return $this->getTemplateSchemaAsyncWithHttpInfo($template_id) + return $this->listCombinedSubmissionsAsyncWithHttpInfo($page, $per_page, $contentType) ->then( function ($response) { return $response[0]; @@ -7582,29 +10098,33 @@ function ($response) { } /** - * Operation getTemplateSchemaAsyncWithHttpInfo + * Operation listCombinedSubmissionsAsyncWithHttpInfo * - * Fetch the JSON schema for a template + * Get a list of all combined submissions * - * @param string $template_id (required) + * @param int $page Default: 1 (optional) + * @param int $per_page Default: 50 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listCombinedSubmissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTemplateSchemaAsyncWithHttpInfo($template_id) + public function listCombinedSubmissionsAsyncWithHttpInfo($page = null, $per_page = null, string $contentType = self::contentTypes['listCombinedSubmissions'][0]) { - $returnType = 'map[string,object]'; - $request = $this->getTemplateSchemaRequest($template_id); + $returnType = '\DocSpring\Model\CombinedSubmission[]'; + $request = $this->listCombinedSubmissionsRequest($page, $per_page, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7624,91 +10144,99 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'getTemplateSchema' + * Create request for operation 'listCombinedSubmissions' * - * @param string $template_id (required) + * @param int $page Default: 1 (optional) + * @param int $per_page Default: 50 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listCombinedSubmissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getTemplateSchemaRequest($template_id) + public function listCombinedSubmissionsRequest($page = null, $per_page = null, string $contentType = self::contentTypes['listCombinedSubmissions'][0]) { - // verify the required parameter 'template_id' is set - if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $template_id when calling getTemplateSchema' - ); + + if ($page !== null && $page < 1) { + throw new \InvalidArgumentException('invalid value for "$page" when calling PDFApi.listCombinedSubmissions, must be bigger than or equal to 1.'); + } + + if ($per_page !== null && $per_page > 50) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling PDFApi.listCombinedSubmissions, must be smaller than or equal to 50.'); + } + if ($per_page !== null && $per_page < 1) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling PDFApi.listCombinedSubmissions, must be bigger than or equal to 1.'); } + - $resourcePath = '/templates/{template_id}/schema'; + $resourcePath = '/combined_submissions'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $per_page, + 'per_page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // path params - if ($template_id !== null) { - $resourcePath = str_replace( - '{' . 'template_id' . '}', - ObjectSerializer::toPathValue($template_id), - $resourcePath - ); - } - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -7723,10 +10251,11 @@ protected function getTemplateSchemaRequest($template_id) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -7738,14 +10267,15 @@ protected function getTemplateSchemaRequest($template_id) * Get a list of all folders * * @param string $parent_folder_id Filter By Folder Id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFolders'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \DocSpring\Model\Folder[]|\DocSpring\Model\AuthenticationError */ - public function listFolders($parent_folder_id = null) + public function listFolders($parent_folder_id = null, string $contentType = self::contentTypes['listFolders'][0]) { - list($response) = $this->listFoldersWithHttpInfo($parent_folder_id); + list($response) = $this->listFoldersWithHttpInfo($parent_folder_id, $contentType); return $response; } @@ -7755,14 +10285,15 @@ public function listFolders($parent_folder_id = null) * Get a list of all folders * * @param string $parent_folder_id Filter By Folder Id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFolders'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \DocSpring\Model\Folder[]|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function listFoldersWithHttpInfo($parent_folder_id = null) + public function listFoldersWithHttpInfo($parent_folder_id = null, string $contentType = self::contentTypes['listFolders'][0]) { - $request = $this->listFoldersRequest($parent_folder_id); + $request = $this->listFoldersRequest($parent_folder_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -7771,9 +10302,16 @@ public function listFoldersWithHttpInfo($parent_folder_id = null) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -7784,21 +10322,35 @@ public function listFoldersWithHttpInfo($parent_folder_id = null) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\DocSpring\Model\Folder[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\Folder[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7808,9 +10360,24 @@ public function listFoldersWithHttpInfo($parent_folder_id = null) ]; case 401: if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7821,11 +10388,25 @@ public function listFoldersWithHttpInfo($parent_folder_id = null) } $returnType = '\DocSpring\Model\Folder[]'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7863,13 +10444,14 @@ public function listFoldersWithHttpInfo($parent_folder_id = null) * Get a list of all folders * * @param string $parent_folder_id Filter By Folder Id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFolders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listFoldersAsync($parent_folder_id = null) + public function listFoldersAsync($parent_folder_id = null, string $contentType = self::contentTypes['listFolders'][0]) { - return $this->listFoldersAsyncWithHttpInfo($parent_folder_id) + return $this->listFoldersAsyncWithHttpInfo($parent_folder_id, $contentType) ->then( function ($response) { return $response[0]; @@ -7883,24 +10465,27 @@ function ($response) { * Get a list of all folders * * @param string $parent_folder_id Filter By Folder Id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFolders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listFoldersAsyncWithHttpInfo($parent_folder_id = null) + public function listFoldersAsyncWithHttpInfo($parent_folder_id = null, string $contentType = self::contentTypes['listFolders'][0]) { $returnType = '\DocSpring\Model\Folder[]'; - $request = $this->listFoldersRequest($parent_folder_id); + $request = $this->listFoldersRequest($parent_folder_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7920,7 +10505,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -7930,13 +10515,16 @@ function ($exception) { * Create request for operation 'listFolders' * * @param string $parent_folder_id Filter By Folder Id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listFolders'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listFoldersRequest($parent_folder_id = null) + public function listFoldersRequest($parent_folder_id = null, string $contentType = self::contentTypes['listFolders'][0]) { + + $resourcePath = '/folders/'; $formParams = []; $queryParams = []; @@ -7945,56 +10533,51 @@ protected function listFoldersRequest($parent_folder_id = null) $multipart = false; // query params - if ($parent_folder_id !== null) { - $queryParams['parent_folder_id'] = ObjectSerializer::toQueryValue($parent_folder_id); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $parent_folder_id, + 'parent_folder_id', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -8009,10 +10592,11 @@ protected function listFoldersRequest($parent_folder_id = null) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -8029,14 +10613,15 @@ protected function listFoldersRequest($parent_folder_id = null) * @param string $created_before created_before (optional) * @param string $type type (optional) * @param bool $include_data include_data (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSubmissions'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\ListSubmissionsResponse|\DocSpring\Model\Error|\DocSpring\Model\AuthenticationError + * @return \DocSpring\Model\ListSubmissionsResponse|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError */ - public function listSubmissions($cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null) + public function listSubmissions($cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null, string $contentType = self::contentTypes['listSubmissions'][0]) { - list($response) = $this->listSubmissionsWithHttpInfo($cursor, $limit, $created_after, $created_before, $type, $include_data); + list($response) = $this->listSubmissionsWithHttpInfo($cursor, $limit, $created_after, $created_before, $type, $include_data, $contentType); return $response; } @@ -8051,14 +10636,15 @@ public function listSubmissions($cursor = null, $limit = null, $created_after = * @param string $created_before (optional) * @param string $type (optional) * @param bool $include_data (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSubmissions'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\ListSubmissionsResponse|\DocSpring\Model\Error|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\ListSubmissionsResponse|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function listSubmissionsWithHttpInfo($cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null) + public function listSubmissionsWithHttpInfo($cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null, string $contentType = self::contentTypes['listSubmissions'][0]) { - $request = $this->listSubmissionsRequest($cursor, $limit, $created_after, $created_before, $type, $include_data); + $request = $this->listSubmissionsRequest($cursor, $limit, $created_after, $created_before, $type, $include_data, $contentType); try { $options = $this->createHttpClientOption(); @@ -8067,9 +10653,16 @@ public function listSubmissionsWithHttpInfo($cursor = null, $limit = null, $crea } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -8080,21 +10673,35 @@ public function listSubmissionsWithHttpInfo($cursor = null, $limit = null, $crea sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\DocSpring\Model\ListSubmissionsResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ListSubmissionsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8103,22 +10710,52 @@ public function listSubmissionsWithHttpInfo($cursor = null, $limit = null, $crea $response->getHeaders() ]; case 400: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; case 401: if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8129,11 +10766,25 @@ public function listSubmissionsWithHttpInfo($cursor = null, $limit = null, $crea } $returnType = '\DocSpring\Model\ListSubmissionsResponse'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8155,7 +10806,7 @@ public function listSubmissionsWithHttpInfo($cursor = null, $limit = null, $crea case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8184,13 +10835,14 @@ public function listSubmissionsWithHttpInfo($cursor = null, $limit = null, $crea * @param string $created_before (optional) * @param string $type (optional) * @param bool $include_data (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSubmissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listSubmissionsAsync($cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null) + public function listSubmissionsAsync($cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null, string $contentType = self::contentTypes['listSubmissions'][0]) { - return $this->listSubmissionsAsyncWithHttpInfo($cursor, $limit, $created_after, $created_before, $type, $include_data) + return $this->listSubmissionsAsyncWithHttpInfo($cursor, $limit, $created_after, $created_before, $type, $include_data, $contentType) ->then( function ($response) { return $response[0]; @@ -8209,24 +10861,27 @@ function ($response) { * @param string $created_before (optional) * @param string $type (optional) * @param bool $include_data (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSubmissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listSubmissionsAsyncWithHttpInfo($cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null) + public function listSubmissionsAsyncWithHttpInfo($cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null, string $contentType = self::contentTypes['listSubmissions'][0]) { $returnType = '\DocSpring\Model\ListSubmissionsResponse'; - $request = $this->listSubmissionsRequest($cursor, $limit, $created_after, $created_before, $type, $include_data); + $request = $this->listSubmissionsRequest($cursor, $limit, $created_after, $created_before, $type, $include_data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -8246,7 +10901,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -8261,13 +10916,21 @@ function ($exception) { * @param string $created_before (optional) * @param string $type (optional) * @param bool $include_data (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listSubmissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listSubmissionsRequest($cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null) + public function listSubmissionsRequest($cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null, string $contentType = self::contentTypes['listSubmissions'][0]) { + + + + + + + $resourcePath = '/submissions'; $formParams = []; $queryParams = []; @@ -8276,76 +10939,96 @@ protected function listSubmissionsRequest($cursor = null, $limit = null, $create $multipart = false; // query params - if ($cursor !== null) { - $queryParams['cursor'] = ObjectSerializer::toQueryValue($cursor); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cursor, + 'cursor', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // query params - if ($limit !== null) { - $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'number', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // query params - if ($created_after !== null) { - $queryParams['created_after'] = ObjectSerializer::toQueryValue($created_after); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $created_after, + 'created_after', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // query params - if ($created_before !== null) { - $queryParams['created_before'] = ObjectSerializer::toQueryValue($created_before); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $created_before, + 'created_before', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // query params - if ($type !== null) { - $queryParams['type'] = ObjectSerializer::toQueryValue($type); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $type, + 'type', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // query params - if ($include_data !== null) { - $queryParams['include_data'] = ObjectSerializer::toQueryValue($include_data); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_data, + 'include_data', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -8360,17 +11043,18 @@ protected function listSubmissionsRequest($cursor = null, $limit = null, $create $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); } /** - * Operation listSubmissions_0 + * Operation listTemplateSubmissions * * List all submissions for a given template * @@ -8381,19 +11065,20 @@ protected function listSubmissionsRequest($cursor = null, $limit = null, $create * @param string $created_before created_before (optional) * @param string $type type (optional) * @param bool $include_data include_data (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTemplateSubmissions'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\ListSubmissionsResponse|\DocSpring\Model\Error + * @return \DocSpring\Model\ListSubmissionsResponse|\DocSpring\Model\ErrorResponse */ - public function listSubmissions_0($template_id, $cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null) + public function listTemplateSubmissions($template_id, $cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null, string $contentType = self::contentTypes['listTemplateSubmissions'][0]) { - list($response) = $this->listSubmissions_0WithHttpInfo($template_id, $cursor, $limit, $created_after, $created_before, $type, $include_data); + list($response) = $this->listTemplateSubmissionsWithHttpInfo($template_id, $cursor, $limit, $created_after, $created_before, $type, $include_data, $contentType); return $response; } /** - * Operation listSubmissions_0WithHttpInfo + * Operation listTemplateSubmissionsWithHttpInfo * * List all submissions for a given template * @@ -8404,14 +11089,15 @@ public function listSubmissions_0($template_id, $cursor = null, $limit = null, $ * @param string $created_before (optional) * @param string $type (optional) * @param bool $include_data (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTemplateSubmissions'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\ListSubmissionsResponse|\DocSpring\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\ListSubmissionsResponse|\DocSpring\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listSubmissions_0WithHttpInfo($template_id, $cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null) + public function listTemplateSubmissionsWithHttpInfo($template_id, $cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null, string $contentType = self::contentTypes['listTemplateSubmissions'][0]) { - $request = $this->listSubmissions_0Request($template_id, $cursor, $limit, $created_after, $created_before, $type, $include_data); + $request = $this->listTemplateSubmissionsRequest($template_id, $cursor, $limit, $created_after, $created_before, $type, $include_data, $contentType); try { $options = $this->createHttpClientOption(); @@ -8420,9 +11106,16 @@ public function listSubmissions_0WithHttpInfo($template_id, $cursor = null, $lim } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -8433,21 +11126,35 @@ public function listSubmissions_0WithHttpInfo($template_id, $cursor = null, $lim sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\DocSpring\Model\ListSubmissionsResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ListSubmissionsResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8456,25 +11163,54 @@ public function listSubmissions_0WithHttpInfo($template_id, $cursor = null, $lim $response->getHeaders() ]; case 404: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\DocSpring\Model\ListSubmissionsResponse'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8496,7 +11232,7 @@ public function listSubmissions_0WithHttpInfo($template_id, $cursor = null, $lim case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8507,7 +11243,7 @@ public function listSubmissions_0WithHttpInfo($template_id, $cursor = null, $lim } /** - * Operation listSubmissions_0Async + * Operation listTemplateSubmissionsAsync * * List all submissions for a given template * @@ -8518,13 +11254,14 @@ public function listSubmissions_0WithHttpInfo($template_id, $cursor = null, $lim * @param string $created_before (optional) * @param string $type (optional) * @param bool $include_data (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTemplateSubmissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listSubmissions_0Async($template_id, $cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null) + public function listTemplateSubmissionsAsync($template_id, $cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null, string $contentType = self::contentTypes['listTemplateSubmissions'][0]) { - return $this->listSubmissions_0AsyncWithHttpInfo($template_id, $cursor, $limit, $created_after, $created_before, $type, $include_data) + return $this->listTemplateSubmissionsAsyncWithHttpInfo($template_id, $cursor, $limit, $created_after, $created_before, $type, $include_data, $contentType) ->then( function ($response) { return $response[0]; @@ -8533,7 +11270,7 @@ function ($response) { } /** - * Operation listSubmissions_0AsyncWithHttpInfo + * Operation listTemplateSubmissionsAsyncWithHttpInfo * * List all submissions for a given template * @@ -8544,24 +11281,27 @@ function ($response) { * @param string $created_before (optional) * @param string $type (optional) * @param bool $include_data (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTemplateSubmissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listSubmissions_0AsyncWithHttpInfo($template_id, $cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null) + public function listTemplateSubmissionsAsyncWithHttpInfo($template_id, $cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null, string $contentType = self::contentTypes['listTemplateSubmissions'][0]) { $returnType = '\DocSpring\Model\ListSubmissionsResponse'; - $request = $this->listSubmissions_0Request($template_id, $cursor, $limit, $created_after, $created_before, $type, $include_data); + $request = $this->listTemplateSubmissionsRequest($template_id, $cursor, $limit, $created_after, $created_before, $type, $include_data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -8581,14 +11321,14 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); } /** - * Create request for operation 'listSubmissions_0' + * Create request for operation 'listTemplateSubmissions' * * @param string $template_id (required) * @param string $cursor (optional) @@ -8597,19 +11337,28 @@ function ($exception) { * @param string $created_before (optional) * @param string $type (optional) * @param bool $include_data (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTemplateSubmissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listSubmissions_0Request($template_id, $cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null) + public function listTemplateSubmissionsRequest($template_id, $cursor = null, $limit = null, $created_after = null, $created_before = null, $type = null, $include_data = null, string $contentType = self::contentTypes['listTemplateSubmissions'][0]) { + // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $template_id when calling listSubmissions_0' + 'Missing the required parameter $template_id when calling listTemplateSubmissions' ); } + + + + + + + $resourcePath = '/templates/{template_id}/submissions'; $formParams = []; $queryParams = []; @@ -8618,29 +11367,60 @@ protected function listSubmissions_0Request($template_id, $cursor = null, $limit $multipart = false; // query params - if ($cursor !== null) { - $queryParams['cursor'] = ObjectSerializer::toQueryValue($cursor); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cursor, + 'cursor', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // query params - if ($limit !== null) { - $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'number', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // query params - if ($created_after !== null) { - $queryParams['created_after'] = ObjectSerializer::toQueryValue($created_after); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $created_after, + 'created_after', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // query params - if ($created_before !== null) { - $queryParams['created_before'] = ObjectSerializer::toQueryValue($created_before); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $created_before, + 'created_before', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // query params - if ($type !== null) { - $queryParams['type'] = ObjectSerializer::toQueryValue($type); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $type, + 'type', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // query params - if ($include_data !== null) { - $queryParams['include_data'] = ObjectSerializer::toQueryValue($include_data); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_data, + 'include_data', // param base name + 'boolean', // openApiType + '', // style + false, // explode + false // required + ) ?? []); + // path params if ($template_id !== null) { @@ -8651,51 +11431,40 @@ protected function listSubmissions_0Request($template_id, $cursor = null, $limit ); } - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -8710,10 +11479,11 @@ protected function listSubmissions_0Request($template_id, $cursor = null, $limit $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -8728,14 +11498,15 @@ protected function listSubmissions_0Request($template_id, $cursor = null, $limit * @param string $parent_folder_id Filter By Folder Id (optional) * @param int $page Default: 1 (optional) * @param int $per_page Default: 50 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTemplates'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\Template[]|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error + * @return \DocSpring\Model\Template[]|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError */ - public function listTemplates($query = null, $parent_folder_id = null, $page = null, $per_page = null) + public function listTemplates($query = null, $parent_folder_id = null, $page = null, $per_page = null, string $contentType = self::contentTypes['listTemplates'][0]) { - list($response) = $this->listTemplatesWithHttpInfo($query, $parent_folder_id, $page, $per_page); + list($response) = $this->listTemplatesWithHttpInfo($query, $parent_folder_id, $page, $per_page, $contentType); return $response; } @@ -8748,14 +11519,15 @@ public function listTemplates($query = null, $parent_folder_id = null, $page = n * @param string $parent_folder_id Filter By Folder Id (optional) * @param int $page Default: 1 (optional) * @param int $per_page Default: 50 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTemplates'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\Template[]|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\Template[]|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function listTemplatesWithHttpInfo($query = null, $parent_folder_id = null, $page = null, $per_page = null) + public function listTemplatesWithHttpInfo($query = null, $parent_folder_id = null, $page = null, $per_page = null, string $contentType = self::contentTypes['listTemplates'][0]) { - $request = $this->listTemplatesRequest($query, $parent_folder_id, $page, $per_page); + $request = $this->listTemplatesRequest($query, $parent_folder_id, $page, $per_page, $contentType); try { $options = $this->createHttpClientOption(); @@ -8764,9 +11536,16 @@ public function listTemplatesWithHttpInfo($query = null, $parent_folder_id = nul } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -8777,21 +11556,35 @@ public function listTemplatesWithHttpInfo($query = null, $parent_folder_id = nul sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\DocSpring\Model\Template[]' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\Template[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8799,38 +11592,82 @@ public function listTemplatesWithHttpInfo($query = null, $parent_folder_id = nul $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 404: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 404: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\DocSpring\Model\Template[]'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8849,18 +11686,18 @@ public function listTemplatesWithHttpInfo($query = null, $parent_folder_id = nul ); $e->setResponseObject($data); break; - case 401: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\AuthenticationError', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 404: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\AuthenticationError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8879,13 +11716,14 @@ public function listTemplatesWithHttpInfo($query = null, $parent_folder_id = nul * @param string $parent_folder_id Filter By Folder Id (optional) * @param int $page Default: 1 (optional) * @param int $per_page Default: 50 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTemplates'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listTemplatesAsync($query = null, $parent_folder_id = null, $page = null, $per_page = null) + public function listTemplatesAsync($query = null, $parent_folder_id = null, $page = null, $per_page = null, string $contentType = self::contentTypes['listTemplates'][0]) { - return $this->listTemplatesAsyncWithHttpInfo($query, $parent_folder_id, $page, $per_page) + return $this->listTemplatesAsyncWithHttpInfo($query, $parent_folder_id, $page, $per_page, $contentType) ->then( function ($response) { return $response[0]; @@ -8902,24 +11740,27 @@ function ($response) { * @param string $parent_folder_id Filter By Folder Id (optional) * @param int $page Default: 1 (optional) * @param int $per_page Default: 50 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTemplates'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listTemplatesAsyncWithHttpInfo($query = null, $parent_folder_id = null, $page = null, $per_page = null) + public function listTemplatesAsyncWithHttpInfo($query = null, $parent_folder_id = null, $page = null, $per_page = null, string $contentType = self::contentTypes['listTemplates'][0]) { $returnType = '\DocSpring\Model\Template[]'; - $request = $this->listTemplatesRequest($query, $parent_folder_id, $page, $per_page); + $request = $this->listTemplatesRequest($query, $parent_folder_id, $page, $per_page, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -8939,7 +11780,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -8952,23 +11793,27 @@ function ($exception) { * @param string $parent_folder_id Filter By Folder Id (optional) * @param int $page Default: 1 (optional) * @param int $per_page Default: 50 (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listTemplates'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listTemplatesRequest($query = null, $parent_folder_id = null, $page = null, $per_page = null) + public function listTemplatesRequest($query = null, $parent_folder_id = null, $page = null, $per_page = null, string $contentType = self::contentTypes['listTemplates'][0]) { + + + if ($page !== null && $page < 1) { throw new \InvalidArgumentException('invalid value for "$page" when calling PDFApi.listTemplates, must be bigger than or equal to 1.'); } - + if ($per_page !== null && $per_page > 50) { throw new \InvalidArgumentException('invalid value for "$per_page" when calling PDFApi.listTemplates, must be smaller than or equal to 50.'); } if ($per_page !== null && $per_page < 1) { throw new \InvalidArgumentException('invalid value for "$per_page" when calling PDFApi.listTemplates, must be bigger than or equal to 1.'); } - + $resourcePath = '/templates'; $formParams = []; @@ -8978,68 +11823,78 @@ protected function listTemplatesRequest($query = null, $parent_folder_id = null, $multipart = false; // query params - if ($query !== null) { - $queryParams['query'] = ObjectSerializer::toQueryValue($query); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $query, + 'query', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // query params - if ($parent_folder_id !== null) { - $queryParams['parent_folder_id'] = ObjectSerializer::toQueryValue($parent_folder_id); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $parent_folder_id, + 'parent_folder_id', // param base name + 'string', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // query params - if ($page !== null) { - $queryParams['page'] = ObjectSerializer::toQueryValue($page); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); // query params - if ($per_page !== null) { - $queryParams['per_page'] = ObjectSerializer::toQueryValue($per_page); - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $per_page, + 'per_page', // param base name + 'integer', // openApiType + '', // style + false, // explode + false // required + ) ?? []); - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -9054,10 +11909,11 @@ protected function listTemplatesRequest($query = null, $parent_folder_id = null, $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -9069,15 +11925,16 @@ protected function listTemplatesRequest($query = null, $parent_folder_id = null, * Move a folder * * @param string $folder_id folder_id (required) - * @param \DocSpring\Model\MoveFolderData $move_folder_data move_folder_data (required) + * @param \DocSpring\Model\MoveFolderData $data data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveFolderToFolder'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\Folder|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error + * @return \DocSpring\Model\ErrorResponse|\DocSpring\Model\Folder|\DocSpring\Model\AuthenticationError */ - public function moveFolderToFolder($folder_id, $move_folder_data) + public function moveFolderToFolder($folder_id, $data, string $contentType = self::contentTypes['moveFolderToFolder'][0]) { - list($response) = $this->moveFolderToFolderWithHttpInfo($folder_id, $move_folder_data); + list($response) = $this->moveFolderToFolderWithHttpInfo($folder_id, $data, $contentType); return $response; } @@ -9087,15 +11944,16 @@ public function moveFolderToFolder($folder_id, $move_folder_data) * Move a folder * * @param string $folder_id (required) - * @param \DocSpring\Model\MoveFolderData $move_folder_data (required) + * @param \DocSpring\Model\MoveFolderData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveFolderToFolder'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\Folder|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\ErrorResponse|\DocSpring\Model\Folder|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function moveFolderToFolderWithHttpInfo($folder_id, $move_folder_data) + public function moveFolderToFolderWithHttpInfo($folder_id, $data, string $contentType = self::contentTypes['moveFolderToFolder'][0]) { - $request = $this->moveFolderToFolderRequest($folder_id, $move_folder_data); + $request = $this->moveFolderToFolderRequest($folder_id, $data, $contentType); try { $options = $this->createHttpClientOption(); @@ -9104,9 +11962,16 @@ public function moveFolderToFolderWithHttpInfo($folder_id, $move_folder_data) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -9117,60 +11982,118 @@ public function moveFolderToFolderWithHttpInfo($folder_id, $move_folder_data) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { - case 200: - if ('\DocSpring\Model\Folder' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + case 404: + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Folder', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 200: + if ('\DocSpring\Model\Folder' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\Folder' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\Folder', []), $response->getStatusCode(), $response->getHeaders() ]; - case 404: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\DocSpring\Model\Folder'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9181,26 +12104,26 @@ public function moveFolderToFolderWithHttpInfo($folder_id, $move_folder_data) } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Folder', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\AuthenticationError', + '\DocSpring\Model\Folder', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 404: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\AuthenticationError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9216,14 +12139,15 @@ public function moveFolderToFolderWithHttpInfo($folder_id, $move_folder_data) * Move a folder * * @param string $folder_id (required) - * @param \DocSpring\Model\MoveFolderData $move_folder_data (required) + * @param \DocSpring\Model\MoveFolderData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveFolderToFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function moveFolderToFolderAsync($folder_id, $move_folder_data) + public function moveFolderToFolderAsync($folder_id, $data, string $contentType = self::contentTypes['moveFolderToFolder'][0]) { - return $this->moveFolderToFolderAsyncWithHttpInfo($folder_id, $move_folder_data) + return $this->moveFolderToFolderAsyncWithHttpInfo($folder_id, $data, $contentType) ->then( function ($response) { return $response[0]; @@ -9237,25 +12161,28 @@ function ($response) { * Move a folder * * @param string $folder_id (required) - * @param \DocSpring\Model\MoveFolderData $move_folder_data (required) + * @param \DocSpring\Model\MoveFolderData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveFolderToFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function moveFolderToFolderAsyncWithHttpInfo($folder_id, $move_folder_data) + public function moveFolderToFolderAsyncWithHttpInfo($folder_id, $data, string $contentType = self::contentTypes['moveFolderToFolder'][0]) { $returnType = '\DocSpring\Model\Folder'; - $request = $this->moveFolderToFolderRequest($folder_id, $move_folder_data); + $request = $this->moveFolderToFolderRequest($folder_id, $data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -9275,7 +12202,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -9285,26 +12212,30 @@ function ($exception) { * Create request for operation 'moveFolderToFolder' * * @param string $folder_id (required) - * @param \DocSpring\Model\MoveFolderData $move_folder_data (required) + * @param \DocSpring\Model\MoveFolderData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveFolderToFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function moveFolderToFolderRequest($folder_id, $move_folder_data) + public function moveFolderToFolderRequest($folder_id, $data, string $contentType = self::contentTypes['moveFolderToFolder'][0]) { + // verify the required parameter 'folder_id' is set if ($folder_id === null || (is_array($folder_id) && count($folder_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $folder_id when calling moveFolderToFolder' ); } - // verify the required parameter 'move_folder_data' is set - if ($move_folder_data === null || (is_array($move_folder_data) && count($move_folder_data) === 0)) { + + // verify the required parameter 'data' is set + if ($data === null || (is_array($data) && count($data) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $move_folder_data when calling moveFolderToFolder' + 'Missing the required parameter $data when calling moveFolderToFolder' ); } + $resourcePath = '/folders/{folder_id}/move'; $formParams = []; $queryParams = []; @@ -9313,6 +12244,7 @@ protected function moveFolderToFolderRequest($folder_id, $move_folder_data) $multipart = false; + // path params if ($folder_id !== null) { $resourcePath = str_replace( @@ -9322,54 +12254,47 @@ protected function moveFolderToFolderRequest($folder_id, $move_folder_data) ); } - // body params - $_tempBody = null; - if (isset($move_folder_data)) { - $_tempBody = $move_folder_data; - } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + if (isset($data)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($data)); } else { - $httpBody = $_tempBody; + $httpBody = $data; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -9384,10 +12309,11 @@ protected function moveFolderToFolderRequest($folder_id, $move_folder_data) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -9399,15 +12325,16 @@ protected function moveFolderToFolderRequest($folder_id, $move_folder_data) * Move Template to folder * * @param string $template_id template_id (required) - * @param \DocSpring\Model\MoveTemplateData $move_template_data move_template_data (required) + * @param \DocSpring\Model\MoveTemplateData $data data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveTemplateToFolder'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\Template|\DocSpring\Model\Error + * @return \DocSpring\Model\Template|\DocSpring\Model\ErrorResponse */ - public function moveTemplateToFolder($template_id, $move_template_data) + public function moveTemplateToFolder($template_id, $data, string $contentType = self::contentTypes['moveTemplateToFolder'][0]) { - list($response) = $this->moveTemplateToFolderWithHttpInfo($template_id, $move_template_data); + list($response) = $this->moveTemplateToFolderWithHttpInfo($template_id, $data, $contentType); return $response; } @@ -9417,15 +12344,16 @@ public function moveTemplateToFolder($template_id, $move_template_data) * Move Template to folder * * @param string $template_id (required) - * @param \DocSpring\Model\MoveTemplateData $move_template_data (required) + * @param \DocSpring\Model\MoveTemplateData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveTemplateToFolder'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\Template|\DocSpring\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\Template|\DocSpring\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function moveTemplateToFolderWithHttpInfo($template_id, $move_template_data) + public function moveTemplateToFolderWithHttpInfo($template_id, $data, string $contentType = self::contentTypes['moveTemplateToFolder'][0]) { - $request = $this->moveTemplateToFolderRequest($template_id, $move_template_data); + $request = $this->moveTemplateToFolderRequest($template_id, $data, $contentType); try { $options = $this->createHttpClientOption(); @@ -9434,9 +12362,16 @@ public function moveTemplateToFolderWithHttpInfo($template_id, $move_template_da } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -9447,21 +12382,35 @@ public function moveTemplateToFolderWithHttpInfo($template_id, $move_template_da sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\DocSpring\Model\Template' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\Template' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9470,25 +12419,54 @@ public function moveTemplateToFolderWithHttpInfo($template_id, $move_template_da $response->getHeaders() ]; case 404: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\DocSpring\Model\Template'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9510,7 +12488,7 @@ public function moveTemplateToFolderWithHttpInfo($template_id, $move_template_da case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9526,14 +12504,15 @@ public function moveTemplateToFolderWithHttpInfo($template_id, $move_template_da * Move Template to folder * * @param string $template_id (required) - * @param \DocSpring\Model\MoveTemplateData $move_template_data (required) + * @param \DocSpring\Model\MoveTemplateData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveTemplateToFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function moveTemplateToFolderAsync($template_id, $move_template_data) + public function moveTemplateToFolderAsync($template_id, $data, string $contentType = self::contentTypes['moveTemplateToFolder'][0]) { - return $this->moveTemplateToFolderAsyncWithHttpInfo($template_id, $move_template_data) + return $this->moveTemplateToFolderAsyncWithHttpInfo($template_id, $data, $contentType) ->then( function ($response) { return $response[0]; @@ -9547,25 +12526,28 @@ function ($response) { * Move Template to folder * * @param string $template_id (required) - * @param \DocSpring\Model\MoveTemplateData $move_template_data (required) + * @param \DocSpring\Model\MoveTemplateData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveTemplateToFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function moveTemplateToFolderAsyncWithHttpInfo($template_id, $move_template_data) + public function moveTemplateToFolderAsyncWithHttpInfo($template_id, $data, string $contentType = self::contentTypes['moveTemplateToFolder'][0]) { $returnType = '\DocSpring\Model\Template'; - $request = $this->moveTemplateToFolderRequest($template_id, $move_template_data); + $request = $this->moveTemplateToFolderRequest($template_id, $data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -9585,7 +12567,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -9595,26 +12577,30 @@ function ($exception) { * Create request for operation 'moveTemplateToFolder' * * @param string $template_id (required) - * @param \DocSpring\Model\MoveTemplateData $move_template_data (required) + * @param \DocSpring\Model\MoveTemplateData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveTemplateToFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function moveTemplateToFolderRequest($template_id, $move_template_data) + public function moveTemplateToFolderRequest($template_id, $data, string $contentType = self::contentTypes['moveTemplateToFolder'][0]) { + // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $template_id when calling moveTemplateToFolder' ); } - // verify the required parameter 'move_template_data' is set - if ($move_template_data === null || (is_array($move_template_data) && count($move_template_data) === 0)) { + + // verify the required parameter 'data' is set + if ($data === null || (is_array($data) && count($data) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $move_template_data when calling moveTemplateToFolder' + 'Missing the required parameter $data when calling moveTemplateToFolder' ); } + $resourcePath = '/templates/{template_id}/move'; $formParams = []; $queryParams = []; @@ -9623,6 +12609,7 @@ protected function moveTemplateToFolderRequest($template_id, $move_template_data $multipart = false; + // path params if ($template_id !== null) { $resourcePath = str_replace( @@ -9632,54 +12619,47 @@ protected function moveTemplateToFolderRequest($template_id, $move_template_data ); } - // body params - $_tempBody = null; - if (isset($move_template_data)) { - $_tempBody = $move_template_data; - } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + if (isset($data)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($data)); } else { - $httpBody = $_tempBody; + $httpBody = $data; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -9694,10 +12674,11 @@ protected function moveTemplateToFolderRequest($template_id, $move_template_data $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -9709,15 +12690,16 @@ protected function moveTemplateToFolderRequest($template_id, $move_template_data * Rename a folder * * @param string $folder_id folder_id (required) - * @param \DocSpring\Model\RenameFolderData $rename_folder_data rename_folder_data (required) + * @param \DocSpring\Model\RenameFolderData $data data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['renameFolder'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ - public function renameFolder($folder_id, $rename_folder_data) + public function renameFolder($folder_id, $data, string $contentType = self::contentTypes['renameFolder'][0]) { - $this->renameFolderWithHttpInfo($folder_id, $rename_folder_data); + $this->renameFolderWithHttpInfo($folder_id, $data, $contentType); } /** @@ -9726,15 +12708,16 @@ public function renameFolder($folder_id, $rename_folder_data) * Rename a folder * * @param string $folder_id (required) - * @param \DocSpring\Model\RenameFolderData $rename_folder_data (required) + * @param \DocSpring\Model\RenameFolderData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['renameFolder'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function renameFolderWithHttpInfo($folder_id, $rename_folder_data) + public function renameFolderWithHttpInfo($folder_id, $data, string $contentType = self::contentTypes['renameFolder'][0]) { - $request = $this->renameFolderRequest($folder_id, $rename_folder_data); + $request = $this->renameFolderRequest($folder_id, $data, $contentType); try { $options = $this->createHttpClientOption(); @@ -9743,9 +12726,16 @@ public function renameFolderWithHttpInfo($folder_id, $rename_folder_data) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -9756,11 +12746,11 @@ public function renameFolderWithHttpInfo($folder_id, $rename_folder_data) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } @@ -9787,14 +12777,15 @@ public function renameFolderWithHttpInfo($folder_id, $rename_folder_data) * Rename a folder * * @param string $folder_id (required) - * @param \DocSpring\Model\RenameFolderData $rename_folder_data (required) + * @param \DocSpring\Model\RenameFolderData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['renameFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function renameFolderAsync($folder_id, $rename_folder_data) + public function renameFolderAsync($folder_id, $data, string $contentType = self::contentTypes['renameFolder'][0]) { - return $this->renameFolderAsyncWithHttpInfo($folder_id, $rename_folder_data) + return $this->renameFolderAsyncWithHttpInfo($folder_id, $data, $contentType) ->then( function ($response) { return $response[0]; @@ -9808,15 +12799,16 @@ function ($response) { * Rename a folder * * @param string $folder_id (required) - * @param \DocSpring\Model\RenameFolderData $rename_folder_data (required) + * @param \DocSpring\Model\RenameFolderData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['renameFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function renameFolderAsyncWithHttpInfo($folder_id, $rename_folder_data) + public function renameFolderAsyncWithHttpInfo($folder_id, $data, string $contentType = self::contentTypes['renameFolder'][0]) { $returnType = ''; - $request = $this->renameFolderRequest($folder_id, $rename_folder_data); + $request = $this->renameFolderRequest($folder_id, $data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9835,7 +12827,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -9845,26 +12837,30 @@ function ($exception) { * Create request for operation 'renameFolder' * * @param string $folder_id (required) - * @param \DocSpring\Model\RenameFolderData $rename_folder_data (required) + * @param \DocSpring\Model\RenameFolderData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['renameFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function renameFolderRequest($folder_id, $rename_folder_data) + public function renameFolderRequest($folder_id, $data, string $contentType = self::contentTypes['renameFolder'][0]) { + // verify the required parameter 'folder_id' is set if ($folder_id === null || (is_array($folder_id) && count($folder_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $folder_id when calling renameFolder' ); } - // verify the required parameter 'rename_folder_data' is set - if ($rename_folder_data === null || (is_array($rename_folder_data) && count($rename_folder_data) === 0)) { + + // verify the required parameter 'data' is set + if ($data === null || (is_array($data) && count($data) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $rename_folder_data when calling renameFolder' + 'Missing the required parameter $data when calling renameFolder' ); } + $resourcePath = '/folders/{folder_id}/rename'; $formParams = []; $queryParams = []; @@ -9873,6 +12869,7 @@ protected function renameFolderRequest($folder_id, $rename_folder_data) $multipart = false; + // path params if ($folder_id !== null) { $resourcePath = str_replace( @@ -9882,54 +12879,47 @@ protected function renameFolderRequest($folder_id, $rename_folder_data) ); } - // body params - $_tempBody = null; - if (isset($rename_folder_data)) { - $_tempBody = $rename_folder_data; - } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + if (isset($data)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($data)); } else { - $httpBody = $_tempBody; + $httpBody = $data; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -9944,10 +12934,11 @@ protected function renameFolderRequest($folder_id, $rename_folder_data) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -9958,14 +12949,15 @@ protected function renameFolderRequest($folder_id, $rename_folder_data) * * Test Authentication * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testAuthentication'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \DocSpring\Model\AuthenticationSuccessResponse|\DocSpring\Model\AuthenticationError */ - public function testAuthentication() + public function testAuthentication(string $contentType = self::contentTypes['testAuthentication'][0]) { - list($response) = $this->testAuthenticationWithHttpInfo(); + list($response) = $this->testAuthenticationWithHttpInfo($contentType); return $response; } @@ -9974,14 +12966,15 @@ public function testAuthentication() * * Test Authentication * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testAuthentication'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \DocSpring\Model\AuthenticationSuccessResponse|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function testAuthenticationWithHttpInfo() + public function testAuthenticationWithHttpInfo(string $contentType = self::contentTypes['testAuthentication'][0]) { - $request = $this->testAuthenticationRequest(); + $request = $this->testAuthenticationRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -9990,9 +12983,16 @@ public function testAuthenticationWithHttpInfo() } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -10003,21 +13003,35 @@ public function testAuthenticationWithHttpInfo() sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\DocSpring\Model\AuthenticationSuccessResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationSuccessResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10027,9 +13041,24 @@ public function testAuthenticationWithHttpInfo() ]; case 401: if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10040,11 +13069,25 @@ public function testAuthenticationWithHttpInfo() } $returnType = '\DocSpring\Model\AuthenticationSuccessResponse'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10081,13 +13124,14 @@ public function testAuthenticationWithHttpInfo() * * Test Authentication * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testAuthentication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testAuthenticationAsync() + public function testAuthenticationAsync(string $contentType = self::contentTypes['testAuthentication'][0]) { - return $this->testAuthenticationAsyncWithHttpInfo() + return $this->testAuthenticationAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -10100,24 +13144,27 @@ function ($response) { * * Test Authentication * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testAuthentication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testAuthenticationAsyncWithHttpInfo() + public function testAuthenticationAsyncWithHttpInfo(string $contentType = self::contentTypes['testAuthentication'][0]) { $returnType = '\DocSpring\Model\AuthenticationSuccessResponse'; - $request = $this->testAuthenticationRequest(); + $request = $this->testAuthenticationRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -10137,7 +13184,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -10146,13 +13193,15 @@ function ($exception) { /** * Create request for operation 'testAuthentication' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['testAuthentication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function testAuthenticationRequest() + public function testAuthenticationRequest(string $contentType = self::contentTypes['testAuthentication'][0]) { + $resourcePath = '/authentication'; $formParams = []; $queryParams = []; @@ -10162,51 +13211,41 @@ protected function testAuthenticationRequest() - // body params - $_tempBody = null; - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); - } else { - $httpBody = $_tempBody; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -10221,10 +13260,11 @@ protected function testAuthenticationRequest() $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -10236,15 +13276,16 @@ protected function testAuthenticationRequest() * Update a submission data request * * @param string $data_request_id data_request_id (required) - * @param \DocSpring\Model\UpdateSubmissionDataRequestData $update_submission_data_request_data update_submission_data_request_data (required) + * @param \DocSpring\Model\UpdateSubmissionDataRequestData $data data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDataRequest'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \DocSpring\Model\UpdateDataRequestResponse|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error|\DocSpring\Model\InvalidRequest + * @return \DocSpring\Model\UpdateDataRequestResponse|\DocSpring\Model\InvalidRequest|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError */ - public function updateDataRequest($data_request_id, $update_submission_data_request_data) + public function updateDataRequest($data_request_id, $data, string $contentType = self::contentTypes['updateDataRequest'][0]) { - list($response) = $this->updateDataRequestWithHttpInfo($data_request_id, $update_submission_data_request_data); + list($response) = $this->updateDataRequestWithHttpInfo($data_request_id, $data, $contentType); return $response; } @@ -10254,15 +13295,16 @@ public function updateDataRequest($data_request_id, $update_submission_data_requ * Update a submission data request * * @param string $data_request_id (required) - * @param \DocSpring\Model\UpdateSubmissionDataRequestData $update_submission_data_request_data (required) + * @param \DocSpring\Model\UpdateSubmissionDataRequestData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDataRequest'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \DocSpring\Model\UpdateDataRequestResponse|\DocSpring\Model\AuthenticationError|\DocSpring\Model\Error|\DocSpring\Model\InvalidRequest, HTTP status code, HTTP response headers (array of strings) + * @return array of \DocSpring\Model\UpdateDataRequestResponse|\DocSpring\Model\InvalidRequest|\DocSpring\Model\ErrorResponse|\DocSpring\Model\AuthenticationError, HTTP status code, HTTP response headers (array of strings) */ - public function updateDataRequestWithHttpInfo($data_request_id, $update_submission_data_request_data) + public function updateDataRequestWithHttpInfo($data_request_id, $data, string $contentType = self::contentTypes['updateDataRequest'][0]) { - $request = $this->updateDataRequestRequest($data_request_id, $update_submission_data_request_data); + $request = $this->updateDataRequestRequest($data_request_id, $data, $contentType); try { $options = $this->createHttpClientOption(); @@ -10271,9 +13313,16 @@ public function updateDataRequestWithHttpInfo($data_request_id, $update_submissi } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -10284,21 +13333,35 @@ public function updateDataRequestWithHttpInfo($data_request_id, $update_submissi sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\DocSpring\Model\UpdateDataRequestResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\UpdateDataRequestResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10306,50 +13369,109 @@ public function updateDataRequestWithHttpInfo($data_request_id, $update_submissi $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 422: + if ('\DocSpring\Model\InvalidRequest' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\InvalidRequest' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\InvalidRequest', []), $response->getStatusCode(), $response->getHeaders() ]; case 404: - if ('\DocSpring\Model\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + if ('\DocSpring\Model\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ('\DocSpring\Model\ErrorResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\Error', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\ErrorResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 422: - if ('\DocSpring\Model\InvalidRequest' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + case 401: + if ('\DocSpring\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\AuthenticationError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\DocSpring\Model\InvalidRequest', []), + ObjectSerializer::deserialize($content, '\DocSpring\Model\AuthenticationError', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\DocSpring\Model\UpdateDataRequestResponse'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10368,10 +13490,10 @@ public function updateDataRequestWithHttpInfo($data_request_id, $update_submissi ); $e->setResponseObject($data); break; - case 401: + case 422: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\AuthenticationError', + '\DocSpring\Model\InvalidRequest', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10379,15 +13501,15 @@ public function updateDataRequestWithHttpInfo($data_request_id, $update_submissi case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\Error', + '\DocSpring\Model\ErrorResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 422: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DocSpring\Model\InvalidRequest', + '\DocSpring\Model\AuthenticationError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10403,14 +13525,15 @@ public function updateDataRequestWithHttpInfo($data_request_id, $update_submissi * Update a submission data request * * @param string $data_request_id (required) - * @param \DocSpring\Model\UpdateSubmissionDataRequestData $update_submission_data_request_data (required) + * @param \DocSpring\Model\UpdateSubmissionDataRequestData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDataRequest'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateDataRequestAsync($data_request_id, $update_submission_data_request_data) + public function updateDataRequestAsync($data_request_id, $data, string $contentType = self::contentTypes['updateDataRequest'][0]) { - return $this->updateDataRequestAsyncWithHttpInfo($data_request_id, $update_submission_data_request_data) + return $this->updateDataRequestAsyncWithHttpInfo($data_request_id, $data, $contentType) ->then( function ($response) { return $response[0]; @@ -10424,25 +13547,28 @@ function ($response) { * Update a submission data request * * @param string $data_request_id (required) - * @param \DocSpring\Model\UpdateSubmissionDataRequestData $update_submission_data_request_data (required) + * @param \DocSpring\Model\UpdateSubmissionDataRequestData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDataRequest'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateDataRequestAsyncWithHttpInfo($data_request_id, $update_submission_data_request_data) + public function updateDataRequestAsyncWithHttpInfo($data_request_id, $data, string $contentType = self::contentTypes['updateDataRequest'][0]) { $returnType = '\DocSpring\Model\UpdateDataRequestResponse'; - $request = $this->updateDataRequestRequest($data_request_id, $update_submission_data_request_data); + $request = $this->updateDataRequestRequest($data_request_id, $data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -10462,7 +13588,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -10472,26 +13598,30 @@ function ($exception) { * Create request for operation 'updateDataRequest' * * @param string $data_request_id (required) - * @param \DocSpring\Model\UpdateSubmissionDataRequestData $update_submission_data_request_data (required) + * @param \DocSpring\Model\UpdateSubmissionDataRequestData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDataRequest'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateDataRequestRequest($data_request_id, $update_submission_data_request_data) + public function updateDataRequestRequest($data_request_id, $data, string $contentType = self::contentTypes['updateDataRequest'][0]) { + // verify the required parameter 'data_request_id' is set if ($data_request_id === null || (is_array($data_request_id) && count($data_request_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $data_request_id when calling updateDataRequest' ); } - // verify the required parameter 'update_submission_data_request_data' is set - if ($update_submission_data_request_data === null || (is_array($update_submission_data_request_data) && count($update_submission_data_request_data) === 0)) { + + // verify the required parameter 'data' is set + if ($data === null || (is_array($data) && count($data) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_submission_data_request_data when calling updateDataRequest' + 'Missing the required parameter $data when calling updateDataRequest' ); } + $resourcePath = '/data_requests/{data_request_id}'; $formParams = []; $queryParams = []; @@ -10500,6 +13630,7 @@ protected function updateDataRequestRequest($data_request_id, $update_submission $multipart = false; + // path params if ($data_request_id !== null) { $resourcePath = str_replace( @@ -10509,54 +13640,47 @@ protected function updateDataRequestRequest($data_request_id, $update_submission ); } - // body params - $_tempBody = null; - if (isset($update_submission_data_request_data)) { - $_tempBody = $update_submission_data_request_data; - } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + if (isset($data)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($data)); } else { - $httpBody = $_tempBody; + $httpBody = $data; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -10571,10 +13695,11 @@ protected function updateDataRequestRequest($data_request_id, $update_submission $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -10586,15 +13711,16 @@ protected function updateDataRequestRequest($data_request_id, $update_submission * Update a Template * * @param string $template_id template_id (required) - * @param \DocSpring\Model\UpdateTemplateData $update_template_data update_template_data (required) + * @param \DocSpring\Model\UpdateTemplateData $data data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTemplate'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \DocSpring\Model\UpdateTemplateResponse */ - public function updateTemplate($template_id, $update_template_data) + public function updateTemplate($template_id, $data, string $contentType = self::contentTypes['updateTemplate'][0]) { - list($response) = $this->updateTemplateWithHttpInfo($template_id, $update_template_data); + list($response) = $this->updateTemplateWithHttpInfo($template_id, $data, $contentType); return $response; } @@ -10604,15 +13730,16 @@ public function updateTemplate($template_id, $update_template_data) * Update a Template * * @param string $template_id (required) - * @param \DocSpring\Model\UpdateTemplateData $update_template_data (required) + * @param \DocSpring\Model\UpdateTemplateData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTemplate'] to see the possible values for this operation * - * @throws \DocSpring\ApiException on non-2xx response + * @throws \DocSpring\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \DocSpring\Model\UpdateTemplateResponse, HTTP status code, HTTP response headers (array of strings) */ - public function updateTemplateWithHttpInfo($template_id, $update_template_data) + public function updateTemplateWithHttpInfo($template_id, $data, string $contentType = self::contentTypes['updateTemplate'][0]) { - $request = $this->updateTemplateRequest($template_id, $update_template_data); + $request = $this->updateTemplateRequest($template_id, $data, $contentType); try { $options = $this->createHttpClientOption(); @@ -10621,9 +13748,16 @@ public function updateTemplateWithHttpInfo($template_id, $update_template_data) } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", - $e->getCode(), + (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null ); } @@ -10634,21 +13768,35 @@ public function updateTemplateWithHttpInfo($template_id, $update_template_data) sprintf( '[%d] Error connecting to the API (%s)', $statusCode, - $request->getUri() + (string) $request->getUri() ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } - $responseBody = $response->getBody(); switch($statusCode) { case 200: if ('\DocSpring\Model\UpdateTemplateResponse' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\DocSpring\Model\UpdateTemplateResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10659,11 +13807,25 @@ public function updateTemplateWithHttpInfo($template_id, $update_template_data) } $returnType = '\DocSpring\Model\UpdateTemplateResponse'; - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10693,14 +13855,15 @@ public function updateTemplateWithHttpInfo($template_id, $update_template_data) * Update a Template * * @param string $template_id (required) - * @param \DocSpring\Model\UpdateTemplateData $update_template_data (required) + * @param \DocSpring\Model\UpdateTemplateData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateTemplateAsync($template_id, $update_template_data) + public function updateTemplateAsync($template_id, $data, string $contentType = self::contentTypes['updateTemplate'][0]) { - return $this->updateTemplateAsyncWithHttpInfo($template_id, $update_template_data) + return $this->updateTemplateAsyncWithHttpInfo($template_id, $data, $contentType) ->then( function ($response) { return $response[0]; @@ -10714,25 +13877,28 @@ function ($response) { * Update a Template * * @param string $template_id (required) - * @param \DocSpring\Model\UpdateTemplateData $update_template_data (required) + * @param \DocSpring\Model\UpdateTemplateData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateTemplateAsyncWithHttpInfo($template_id, $update_template_data) + public function updateTemplateAsyncWithHttpInfo($template_id, $data, string $contentType = self::contentTypes['updateTemplate'][0]) { $returnType = '\DocSpring\Model\UpdateTemplateResponse'; - $request = $this->updateTemplateRequest($template_id, $update_template_data); + $request = $this->updateTemplateRequest($template_id, $data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer + $content = $response->getBody(); //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -10752,7 +13918,7 @@ function ($exception) { ), $statusCode, $response->getHeaders(), - $response->getBody() + (string) $response->getBody() ); } ); @@ -10762,26 +13928,30 @@ function ($exception) { * Create request for operation 'updateTemplate' * * @param string $template_id (required) - * @param \DocSpring\Model\UpdateTemplateData $update_template_data (required) + * @param \DocSpring\Model\UpdateTemplateData $data (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTemplate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateTemplateRequest($template_id, $update_template_data) + public function updateTemplateRequest($template_id, $data, string $contentType = self::contentTypes['updateTemplate'][0]) { + // verify the required parameter 'template_id' is set if ($template_id === null || (is_array($template_id) && count($template_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $template_id when calling updateTemplate' ); } - // verify the required parameter 'update_template_data' is set - if ($update_template_data === null || (is_array($update_template_data) && count($update_template_data) === 0)) { + + // verify the required parameter 'data' is set + if ($data === null || (is_array($data) && count($data) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_template_data when calling updateTemplate' + 'Missing the required parameter $data when calling updateTemplate' ); } + $resourcePath = '/templates/{template_id}'; $formParams = []; $queryParams = []; @@ -10790,6 +13960,7 @@ protected function updateTemplateRequest($template_id, $update_template_data) $multipart = false; + // path params if ($template_id !== null) { $resourcePath = str_replace( @@ -10799,54 +13970,47 @@ protected function updateTemplateRequest($template_id, $update_template_data) ); } - // body params - $_tempBody = null; - if (isset($update_template_data)) { - $_tempBody = $update_template_data; - } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($_tempBody)) { - // $_tempBody is the method argument, if present - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + if (isset($data)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($data)); } else { - $httpBody = $_tempBody; + $httpBody = $data; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $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); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } @@ -10861,10 +14025,11 @@ protected function updateTemplateRequest($template_id, $update_template_data) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/ApiException.php b/lib/ApiException.php index 77aa595..31787a8 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -1,7 +1,7 @@ accessToken; } + /** + * Sets boolean format for query string. + * + * @param string $booleanFormatForQueryString Boolean format for query string + * + * @return $this + */ + public function setBooleanFormatForQueryString(string $booleanFormat) + { + $this->booleanFormatForQueryString = $booleanFormat; + + return $this; + } + + /** + * Gets boolean format for query string. + * + * @return string Boolean format for query string + */ + public function getBooleanFormatForQueryString(): string + { + return $this->booleanFormatForQueryString; + } + /** * Sets the username for HTTP basic authentication * @@ -375,7 +411,7 @@ public static function getDefaultConfiguration() } /** - * Sets the detault configuration instance + * Sets the default configuration instance * * @param Configuration $config An instance of the Configuration Object * @@ -396,8 +432,8 @@ public static function toDebugReport() $report = 'PHP SDK (DocSpring) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' OpenAPI Spec Version: v1' . PHP_EOL; - $report .= ' SDK Package Version: 1.3.2' . PHP_EOL; + $report .= ' The version of the OpenAPI document: v1' . PHP_EOL; + $report .= ' SDK Package Version: 2.0.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; @@ -408,7 +444,7 @@ public static function toDebugReport() * * @param string $apiKeyIdentifier name of apikey * - * @return string API key with the prefix + * @return null|string API key with the prefix */ public function getApiKeyWithPrefix($apiKeyIdentifier) { @@ -427,4 +463,70 @@ public function getApiKeyWithPrefix($apiKeyIdentifier) return $keyWithPrefix; } + + /** + * Returns an array of host settings + * + * @return array an array of host settings + */ + public function getHostSettings() + { + return [ + [ + "url" => "https://api.docspring.com/api/v1", + "description" => "No description provided", + ] + ]; + } + + /** + * Returns URL based on host settings, index and variables + * + * @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients + * @param int $hostIndex 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 static function getHostString(array $hostsSettings, $hostIndex, array $variables = null) + { + if (null === $variables) { + $variables = []; + } + + // check array index out of bound + if ($hostIndex < 0 || $hostIndex >= count($hostsSettings)) { + throw new \InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostsSettings)); + } + + $host = $hostsSettings[$hostIndex]; + $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 (!isset($variable['enum_values']) || 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; + } + + /** + * 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) + { + return self::getHostString($this->getHostSettings(), $index, $variables); + } } diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index b40259a..6b815a0 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -1,7 +1,7 @@ selectContentTypeHeader($contentTypes); + if (!$isMultipart) { + if($contentType === '') { + $contentType = 'application/json'; + } + + $headers['Content-Type'] = $contentType; + } + return $headers; } /** - * @param string[] $accept - * @return array + * 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) */ - public function selectHeadersForMultipart($accept) + private function selectAcceptHeader(array $accept): ?string { - $headers = $this->selectHeaders($accept, []); + # filter out empty entries + $accept = array_filter($accept); - unset($headers['Content-Type']); - return $headers; + if (count($accept) === 0) { + return null; + } + + # If there's only one Accept header, just use it + if (count($accept) === 1) { + return reset($accept); + } + + # If none of the available Accept headers is of type "json", then just use all them + $headersWithJson = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept); + if (count($headersWithJson) === 0) { + return implode(',', $accept); + } + + # If we got here, then we need add quality values (weight), as described in IETF RFC 9110, Items 12.4.2/12.5.1, + # to give the highest priority to json-like headers - recalculating the existing ones, if needed + return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson); + } + + /** + * Create an Accept header string from the given "Accept" headers array, recalculating all weights + * + * @param string[] $accept Array of Accept Headers + * @param string[] $headersWithJson Array of Accept Headers of type "json" + * + * @return string "Accept" Header (e.g. "application/json, text/html; q=0.9") + */ + private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headersWithJson): string + { + $processedHeaders = [ + 'withApplicationJson' => [], + 'withJson' => [], + 'withoutJson' => [], + ]; + + foreach ($accept as $header) { + + $headerData = $this->getHeaderAndWeight($header); + + if (stripos($headerData['header'], 'application/json') === 0) { + $processedHeaders['withApplicationJson'][] = $headerData; + } elseif (in_array($header, $headersWithJson, true)) { + $processedHeaders['withJson'][] = $headerData; + } else { + $processedHeaders['withoutJson'][] = $headerData; + } + } + + $acceptHeaders = []; + $currentWeight = 1000; + + $hasMoreThan28Headers = count($accept) > 28; + + foreach($processedHeaders as $headers) { + if (count($headers) > 0) { + $acceptHeaders[] = $this->adjustWeight($headers, $currentWeight, $hasMoreThan28Headers); + } + } + + $acceptHeaders = array_merge(...$acceptHeaders); + + return implode(',', $acceptHeaders); } /** - * Return the header 'Accept' based on an array of Accept provided + * Given an Accept header, returns an associative array splitting the header and its weight * - * @param string[] $accept Array of header + * @param string $header "Accept" Header * - * @return string Accept (e.g. application/json) + * @return array with the header and its weight */ - private function selectAcceptHeader($accept) + private function getHeaderAndWeight(string $header): array { - if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { - return null; - } elseif (preg_grep("/application\/json/i", $accept)) { - return 'application/json'; + # matches headers with weight, splitting the header and the weight in $outputArray + if (preg_match('/(.*);\s*q=(1(?:\.0+)?|0\.\d+)$/', $header, $outputArray) === 1) { + $headerData = [ + 'header' => $outputArray[1], + 'weight' => (int)($outputArray[2] * 1000), + ]; } else { - return implode(',', $accept); + $headerData = [ + 'header' => trim($header), + 'weight' => 1000, + ]; + } + + return $headerData; + } + + /** + * @param array[] $headers + * @param float $currentWeight + * @param bool $hasMoreThan28Headers + * @return string[] array of adjusted "Accept" headers + */ + private function adjustWeight(array $headers, float &$currentWeight, bool $hasMoreThan28Headers): array + { + usort($headers, function (array $a, array $b) { + return $b['weight'] - $a['weight']; + }); + + $acceptHeaders = []; + foreach ($headers as $index => $header) { + if($index > 0 && $headers[$index - 1]['weight'] > $header['weight']) + { + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + } + + $weight = $currentWeight; + + $acceptHeaders[] = $this->buildAcceptHeader($header['header'], $weight); + } + + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + + return $acceptHeaders; + } + + /** + * @param string $header + * @param int $weight + * @return string + */ + private function buildAcceptHeader(string $header, int $weight): string + { + if($weight === 1000) { + return $header; } + + return trim($header, '; ') . ';q=' . rtrim(sprintf('%0.3f', $weight / 1000), '0'); } /** - * Return the content type based on an array of content-type provided + * Calculate the next weight, based on the current one. + * + * If there are less than 28 "Accept" headers, the weights will be decreased by 1 on its highest significant digit, using the + * following formula: + * + * next weight = current weight - 10 ^ (floor(log(current weight - 1))) * - * @param string[] $contentType Array fo content-type + * ( current weight minus ( 10 raised to the power of ( floor of (log to the base 10 of ( current weight minus 1 ) ) ) ) ) * - * @return string Content-Type (e.g. application/json) + * Starting from 1000, this generates the following series: + * + * 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 + * + * The resulting quality codes are closer to the average "normal" usage of them (like "q=0.9", "q=0.8" and so on), but it only works + * if there is a maximum of 28 "Accept" headers. If we have more than that (which is extremely unlikely), then we fall back to a 1-by-1 + * decrement rule, which will result in quality codes like "q=0.999", "q=0.998" etc. + * + * @param int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value) + * @param bool $hasMoreThan28Headers + * @return int */ - private function selectContentTypeHeader($contentType) + public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int { - 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); + if ($currentWeight <= 1) { + return 1; } + + if ($hasMoreThan28Headers) { + return $currentWeight - 1; + } + + return $currentWeight - 10 ** floor( log10($currentWeight - 1) ); } } - diff --git a/lib/Model/AddFieldsData.php b/lib/Model/AddFieldsData.php index fd6d0b9..c019c44 100644 --- a/lib/Model/AddFieldsData.php +++ b/lib/Model/AddFieldsData.php @@ -2,7 +2,7 @@ /** * AddFieldsData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class AddFieldsData implements ModelInterface, ArrayAccess +class AddFieldsData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,18 +57,36 @@ class AddFieldsData implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'fields' => '\DocSpring\Model\TemplatestemplateIdaddFieldsFields[]' + 'fields' => 'object[]' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'fields' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'fields' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -89,6 +107,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -158,9 +228,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -177,7 +244,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['fields'] = isset($data['fields']) ? $data['fields'] : null; + $this->setIfExists('fields', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -210,7 +295,7 @@ public function valid() /** * Gets fields * - * @return \DocSpring\Model\TemplatestemplateIdaddFieldsFields[] + * @return object[] */ public function getFields() { @@ -220,12 +305,15 @@ public function getFields() /** * Sets fields * - * @param \DocSpring\Model\TemplatestemplateIdaddFieldsFields[] $fields fields + * @param object[] $fields fields * - * @return $this + * @return self */ public function setFields($fields) { + if (is_null($fields)) { + throw new \InvalidArgumentException('non-nullable fields cannot be null'); + } $this->container['fields'] = $fields; return $this; @@ -237,7 +325,7 @@ public function setFields($fields) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -247,22 +335,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -278,11 +367,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -295,6 +397,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/AddFieldsTemplateResponse.php b/lib/Model/AddFieldsTemplateResponse.php index 7933ebb..3b05b4f 100644 --- a/lib/Model/AddFieldsTemplateResponse.php +++ b/lib/Model/AddFieldsTemplateResponse.php @@ -2,7 +2,7 @@ /** * AddFieldsTemplateResponse * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class AddFieldsTemplateResponse implements ModelInterface, ArrayAccess +class AddFieldsTemplateResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,22 +57,42 @@ class AddFieldsTemplateResponse implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'new_field_ids' => 'int[]', + 'status' => 'string', 'errors' => 'string[]', - 'status' => 'string' + 'new_field_ids' => 'int[]' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'new_field_ids' => null, + 'status' => null, 'errors' => null, - 'status' => null + 'new_field_ids' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'errors' => false, + 'new_field_ids' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -93,6 +113,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -100,9 +172,9 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'new_field_ids' => 'new_field_ids', + 'status' => 'status', 'errors' => 'errors', - 'status' => 'status' + 'new_field_ids' => 'new_field_ids' ]; /** @@ -111,9 +183,9 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'new_field_ids' => 'setNewFieldIds', + 'status' => 'setStatus', 'errors' => 'setErrors', - 'status' => 'setStatus' + 'new_field_ids' => 'setNewFieldIds' ]; /** @@ -122,9 +194,9 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'new_field_ids' => 'getNewFieldIds', + 'status' => 'getStatus', 'errors' => 'getErrors', - 'status' => 'getStatus' + 'new_field_ids' => 'getNewFieldIds' ]; /** @@ -168,11 +240,9 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_SUCCESS = 'success'; - const STATUS_ERROR = 'error'; - + public const STATUS_SUCCESS = 'success'; + public const STATUS_ERROR = 'error'; - /** * Gets allowable values of the enum * @@ -185,7 +255,6 @@ public function getStatusAllowableValues() self::STATUS_ERROR, ]; } - /** * Associative array for storing property values @@ -202,9 +271,27 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['new_field_ids'] = isset($data['new_field_ids']) ? $data['new_field_ids'] : null; - $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('new_field_ids', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -216,10 +303,14 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } @@ -240,25 +331,38 @@ public function valid() /** - * Gets new_field_ids + * Gets status * - * @return int[]|null + * @return string */ - public function getNewFieldIds() + public function getStatus() { - return $this->container['new_field_ids']; + return $this->container['status']; } /** - * Sets new_field_ids + * Sets status * - * @param int[]|null $new_field_ids new_field_ids + * @param string $status status * - * @return $this + * @return self */ - public function setNewFieldIds($new_field_ids) + public function setStatus($status) { - $this->container['new_field_ids'] = $new_field_ids; + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; return $this; } @@ -278,44 +382,41 @@ public function getErrors() * * @param string[]|null $errors errors * - * @return $this + * @return self */ public function setErrors($errors) { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } $this->container['errors'] = $errors; return $this; } /** - * Gets status + * Gets new_field_ids * - * @return string|null + * @return int[]|null */ - public function getStatus() + public function getNewFieldIds() { - return $this->container['status']; + return $this->container['new_field_ids']; } /** - * Sets status + * Sets new_field_ids * - * @param string|null $status status + * @param int[]|null $new_field_ids new_field_ids * - * @return $this + * @return self */ - public function setStatus($status) + public function setNewFieldIds($new_field_ids) { - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'status', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($new_field_ids)) { + throw new \InvalidArgumentException('non-nullable new_field_ids cannot be null'); } - $this->container['status'] = $status; + $this->container['new_field_ids'] = $new_field_ids; return $this; } @@ -326,7 +427,7 @@ public function setStatus($status) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -336,22 +437,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -367,11 +469,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -384,6 +499,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/AuthenticationError.php b/lib/Model/AuthenticationError.php index c1f3be3..2a23a96 100644 --- a/lib/Model/AuthenticationError.php +++ b/lib/Model/AuthenticationError.php @@ -2,7 +2,7 @@ /** * AuthenticationError * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class AuthenticationError implements ModelInterface, ArrayAccess +class AuthenticationError implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,12 +65,31 @@ class AuthenticationError implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'status' => null, 'error' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'error' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -91,6 +110,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -163,10 +234,8 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_ERROR = 'error'; - + public const STATUS_ERROR = 'error'; - /** * Gets allowable values of the enum * @@ -178,7 +247,6 @@ public function getStatusAllowableValues() self::STATUS_ERROR, ]; } - /** * Associative array for storing property values @@ -195,8 +263,26 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('error', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -211,7 +297,8 @@ public function listInvalidProperties() $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } @@ -249,15 +336,19 @@ public function getStatus() * * @param string|null $status status * - * @return $this + * @return self */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowedValues, true)) { + if (!in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'status', must be one of '%s'", + "Invalid value '%s' for 'status', must be one of '%s'", + $status, implode("', '", $allowedValues) ) ); @@ -282,10 +373,13 @@ public function getError() * * @param string $error error * - * @return $this + * @return self */ public function setError($error) { + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } $this->container['error'] = $error; return $this; @@ -297,7 +391,7 @@ public function setError($error) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -307,22 +401,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -338,11 +433,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -355,6 +463,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/AuthenticationSuccessResponse.php b/lib/Model/AuthenticationSuccessResponse.php index 0286ce9..622d901 100644 --- a/lib/Model/AuthenticationSuccessResponse.php +++ b/lib/Model/AuthenticationSuccessResponse.php @@ -2,7 +2,7 @@ /** * AuthenticationSuccessResponse * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class AuthenticationSuccessResponse implements ModelInterface, ArrayAccess +class AuthenticationSuccessResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -64,11 +64,29 @@ class AuthenticationSuccessResponse implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'status' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -89,6 +107,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -158,10 +228,8 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_SUCCESS = 'success'; - + public const STATUS_SUCCESS = 'success'; - /** * Gets allowable values of the enum * @@ -173,7 +241,6 @@ public function getStatusAllowableValues() self::STATUS_SUCCESS, ]; } - /** * Associative array for storing property values @@ -190,7 +257,25 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -202,10 +287,14 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } @@ -228,7 +317,7 @@ public function valid() /** * Gets status * - * @return string|null + * @return string */ public function getStatus() { @@ -238,17 +327,21 @@ public function getStatus() /** * Sets status * - * @param string|null $status status + * @param string $status status * - * @return $this + * @return self */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowedValues, true)) { + if (!in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'status', must be one of '%s'", + "Invalid value '%s' for 'status', must be one of '%s'", + $status, implode("', '", $allowedValues) ) ); @@ -264,7 +357,7 @@ public function setStatus($status) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -274,22 +367,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -305,11 +399,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -322,6 +429,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/CombinePdfsData.php b/lib/Model/CombinePdfsData.php index 53c3f1f..0e8798b 100644 --- a/lib/Model/CombinePdfsData.php +++ b/lib/Model/CombinePdfsData.php @@ -2,7 +2,7 @@ /** * CombinePdfsData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class CombinePdfsData implements ModelInterface, ArrayAccess +class CombinePdfsData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,6 +69,8 @@ class CombinePdfsData implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'delete_custom_files' => null, @@ -79,6 +81,27 @@ class CombinePdfsData implements ModelInterface, ArrayAccess 'test' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'delete_custom_files' => false, + 'expires_in' => false, + 'metadata' => false, + 'password' => false, + 'source_pdfs' => false, + 'test' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -99,6 +122,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -183,9 +258,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -202,12 +274,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['delete_custom_files'] = isset($data['delete_custom_files']) ? $data['delete_custom_files'] : null; - $this->container['expires_in'] = isset($data['expires_in']) ? $data['expires_in'] : null; - $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; - $this->container['password'] = isset($data['password']) ? $data['password'] : null; - $this->container['source_pdfs'] = isset($data['source_pdfs']) ? $data['source_pdfs'] : null; - $this->container['test'] = isset($data['test']) ? $data['test'] : null; + $this->setIfExists('delete_custom_files', $data ?? [], null); + $this->setIfExists('expires_in', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('source_pdfs', $data ?? [], null); + $this->setIfExists('test', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -252,10 +342,13 @@ public function getDeleteCustomFiles() * * @param bool|null $delete_custom_files delete_custom_files * - * @return $this + * @return self */ public function setDeleteCustomFiles($delete_custom_files) { + if (is_null($delete_custom_files)) { + throw new \InvalidArgumentException('non-nullable delete_custom_files cannot be null'); + } $this->container['delete_custom_files'] = $delete_custom_files; return $this; @@ -276,10 +369,13 @@ public function getExpiresIn() * * @param int|null $expires_in expires_in * - * @return $this + * @return self */ public function setExpiresIn($expires_in) { + if (is_null($expires_in)) { + throw new \InvalidArgumentException('non-nullable expires_in cannot be null'); + } $this->container['expires_in'] = $expires_in; return $this; @@ -300,10 +396,13 @@ public function getMetadata() * * @param object|null $metadata metadata * - * @return $this + * @return self */ public function setMetadata($metadata) { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } $this->container['metadata'] = $metadata; return $this; @@ -324,10 +423,13 @@ public function getPassword() * * @param string|null $password password * - * @return $this + * @return self */ public function setPassword($password) { + if (is_null($password)) { + throw new \InvalidArgumentException('non-nullable password cannot be null'); + } $this->container['password'] = $password; return $this; @@ -348,10 +450,13 @@ public function getSourcePdfs() * * @param object[] $source_pdfs source_pdfs * - * @return $this + * @return self */ public function setSourcePdfs($source_pdfs) { + if (is_null($source_pdfs)) { + throw new \InvalidArgumentException('non-nullable source_pdfs cannot be null'); + } $this->container['source_pdfs'] = $source_pdfs; return $this; @@ -372,10 +477,13 @@ public function getTest() * * @param bool|null $test test * - * @return $this + * @return self */ public function setTest($test) { + if (is_null($test)) { + throw new \InvalidArgumentException('non-nullable test cannot be null'); + } $this->container['test'] = $test; return $this; @@ -387,7 +495,7 @@ public function setTest($test) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -397,22 +505,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -428,11 +537,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -445,6 +567,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/CombinedSubmission.php b/lib/Model/CombinedSubmission.php index 4bbc70d..c301a0c 100644 --- a/lib/Model/CombinedSubmission.php +++ b/lib/Model/CombinedSubmission.php @@ -2,7 +2,7 @@ /** * CombinedSubmission * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class CombinedSubmission implements ModelInterface, ArrayAccess +class CombinedSubmission implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,16 +57,18 @@ class CombinedSubmission implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'metadata' => 'object', - 'password' => 'string', + 'id' => 'string', 'expired' => 'bool', + 'expires_in' => 'int', 'expires_at' => 'string', + 'state' => 'string', + 'error_message' => 'string', + 'metadata' => 'object', + 'password' => 'string', + 'submission_ids' => 'string[]', 'source_pdfs' => 'object[]', - 'pdf_hash' => 'string', 'download_url' => 'string', - 'submission_ids' => 'string[]', - 'id' => 'string', - 'state' => 'string', + 'pdf_hash' => 'string', 'actions' => '\DocSpring\Model\CombinedSubmissionAction[]' ]; @@ -74,21 +76,53 @@ class CombinedSubmission implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'metadata' => null, - 'password' => null, + 'id' => null, 'expired' => null, + 'expires_in' => null, 'expires_at' => null, + 'state' => null, + 'error_message' => null, + 'metadata' => null, + 'password' => null, + 'submission_ids' => null, 'source_pdfs' => null, - 'pdf_hash' => null, 'download_url' => null, - 'submission_ids' => null, - 'id' => null, - 'state' => null, + 'pdf_hash' => null, 'actions' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'expired' => false, + 'expires_in' => true, + 'expires_at' => true, + 'state' => false, + 'error_message' => true, + 'metadata' => false, + 'password' => true, + 'submission_ids' => false, + 'source_pdfs' => false, + 'download_url' => true, + 'pdf_hash' => true, + 'actions' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -109,6 +143,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -116,16 +202,18 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'metadata' => 'metadata', - 'password' => 'password', + 'id' => 'id', 'expired' => 'expired', + 'expires_in' => 'expires_in', 'expires_at' => 'expires_at', + 'state' => 'state', + 'error_message' => 'error_message', + 'metadata' => 'metadata', + 'password' => 'password', + 'submission_ids' => 'submission_ids', 'source_pdfs' => 'source_pdfs', - 'pdf_hash' => 'pdf_hash', 'download_url' => 'download_url', - 'submission_ids' => 'submission_ids', - 'id' => 'id', - 'state' => 'state', + 'pdf_hash' => 'pdf_hash', 'actions' => 'actions' ]; @@ -135,16 +223,18 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'metadata' => 'setMetadata', - 'password' => 'setPassword', + 'id' => 'setId', 'expired' => 'setExpired', + 'expires_in' => 'setExpiresIn', 'expires_at' => 'setExpiresAt', + 'state' => 'setState', + 'error_message' => 'setErrorMessage', + 'metadata' => 'setMetadata', + 'password' => 'setPassword', + 'submission_ids' => 'setSubmissionIds', 'source_pdfs' => 'setSourcePdfs', - 'pdf_hash' => 'setPdfHash', 'download_url' => 'setDownloadUrl', - 'submission_ids' => 'setSubmissionIds', - 'id' => 'setId', - 'state' => 'setState', + 'pdf_hash' => 'setPdfHash', 'actions' => 'setActions' ]; @@ -154,16 +244,18 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'metadata' => 'getMetadata', - 'password' => 'getPassword', + 'id' => 'getId', 'expired' => 'getExpired', + 'expires_in' => 'getExpiresIn', 'expires_at' => 'getExpiresAt', + 'state' => 'getState', + 'error_message' => 'getErrorMessage', + 'metadata' => 'getMetadata', + 'password' => 'getPassword', + 'submission_ids' => 'getSubmissionIds', 'source_pdfs' => 'getSourcePdfs', - 'pdf_hash' => 'getPdfHash', 'download_url' => 'getDownloadUrl', - 'submission_ids' => 'getSubmissionIds', - 'id' => 'getId', - 'state' => 'getState', + 'pdf_hash' => 'getPdfHash', 'actions' => 'getActions' ]; @@ -208,12 +300,10 @@ public function getModelName() return self::$openAPIModelName; } - const STATE_PENDING = 'pending'; - const STATE_PROCESSED = 'processed'; - const STATE_ERROR = 'error'; - + public const STATE_PENDING = 'pending'; + public const STATE_PROCESSED = 'processed'; + public const STATE_ERROR = 'error'; - /** * Gets allowable values of the enum * @@ -227,7 +317,6 @@ public function getStateAllowableValues() self::STATE_ERROR, ]; } - /** * Associative array for storing property values @@ -244,17 +333,37 @@ public function getStateAllowableValues() */ public function __construct(array $data = null) { - $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; - $this->container['password'] = isset($data['password']) ? $data['password'] : null; - $this->container['expired'] = isset($data['expired']) ? $data['expired'] : null; - $this->container['expires_at'] = isset($data['expires_at']) ? $data['expires_at'] : null; - $this->container['source_pdfs'] = isset($data['source_pdfs']) ? $data['source_pdfs'] : null; - $this->container['pdf_hash'] = isset($data['pdf_hash']) ? $data['pdf_hash'] : null; - $this->container['download_url'] = isset($data['download_url']) ? $data['download_url'] : null; - $this->container['submission_ids'] = isset($data['submission_ids']) ? $data['submission_ids'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['state'] = isset($data['state']) ? $data['state'] : null; - $this->container['actions'] = isset($data['actions']) ? $data['actions'] : null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('expired', $data ?? [], null); + $this->setIfExists('expires_in', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('error_message', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('submission_ids', $data ?? [], null); + $this->setIfExists('source_pdfs', $data ?? [], null); + $this->setIfExists('download_url', $data ?? [], null); + $this->setIfExists('pdf_hash', $data ?? [], null); + $this->setIfExists('actions', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -266,14 +375,30 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['expired'] === null) { + $invalidProperties[] = "'expired' can't be null"; + } + if ($this->container['state'] === null) { + $invalidProperties[] = "'state' can't be null"; + } $allowedValues = $this->getStateAllowableValues(); if (!is_null($this->container['state']) && !in_array($this->container['state'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'state', must be one of '%s'", + "invalid value '%s' for 'state', must be one of '%s'", + $this->container['state'], implode("', '", $allowedValues) ); } + if ($this->container['submission_ids'] === null) { + $invalidProperties[] = "'submission_ids' can't be null"; + } + if ($this->container['source_pdfs'] === null) { + $invalidProperties[] = "'source_pdfs' can't be null"; + } return $invalidProperties; } @@ -290,73 +415,89 @@ public function valid() /** - * Gets metadata + * Gets id * - * @return object|null + * @return string */ - public function getMetadata() + public function getId() { - return $this->container['metadata']; + return $this->container['id']; } /** - * Sets metadata + * Sets id * - * @param object|null $metadata metadata + * @param string $id id * - * @return $this + * @return self */ - public function setMetadata($metadata) + public function setId($id) { - $this->container['metadata'] = $metadata; + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; return $this; } /** - * Gets password + * Gets expired * - * @return string|null + * @return bool */ - public function getPassword() + public function getExpired() { - return $this->container['password']; + return $this->container['expired']; } /** - * Sets password + * Sets expired * - * @param string|null $password password + * @param bool $expired expired * - * @return $this + * @return self */ - public function setPassword($password) + public function setExpired($expired) { - $this->container['password'] = $password; + if (is_null($expired)) { + throw new \InvalidArgumentException('non-nullable expired cannot be null'); + } + $this->container['expired'] = $expired; return $this; } /** - * Gets expired + * Gets expires_in * - * @return bool|null + * @return int|null */ - public function getExpired() + public function getExpiresIn() { - return $this->container['expired']; + return $this->container['expires_in']; } /** - * Sets expired + * Sets expires_in * - * @param bool|null $expired expired + * @param int|null $expires_in expires_in * - * @return $this + * @return self */ - public function setExpired($expired) + public function setExpiresIn($expires_in) { - $this->container['expired'] = $expired; + if (is_null($expires_in)) { + array_push($this->openAPINullablesSetToNull, 'expires_in'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_in', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['expires_in'] = $expires_in; return $this; } @@ -376,83 +517,153 @@ public function getExpiresAt() * * @param string|null $expires_at expires_at * - * @return $this + * @return self */ public function setExpiresAt($expires_at) { + if (is_null($expires_at)) { + array_push($this->openAPINullablesSetToNull, 'expires_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['expires_at'] = $expires_at; return $this; } /** - * Gets source_pdfs + * Gets state * - * @return object[]|null + * @return string */ - public function getSourcePdfs() + public function getState() { - return $this->container['source_pdfs']; + return $this->container['state']; } /** - * Sets source_pdfs + * Sets state * - * @param object[]|null $source_pdfs source_pdfs + * @param string $state state * - * @return $this + * @return self */ - public function setSourcePdfs($source_pdfs) + public function setState($state) { - $this->container['source_pdfs'] = $source_pdfs; + if (is_null($state)) { + throw new \InvalidArgumentException('non-nullable state cannot be null'); + } + $allowedValues = $this->getStateAllowableValues(); + if (!in_array($state, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'state', must be one of '%s'", + $state, + implode("', '", $allowedValues) + ) + ); + } + $this->container['state'] = $state; return $this; } /** - * Gets pdf_hash + * Gets error_message * * @return string|null */ - public function getPdfHash() + public function getErrorMessage() { - return $this->container['pdf_hash']; + return $this->container['error_message']; } /** - * Sets pdf_hash + * Sets error_message * - * @param string|null $pdf_hash pdf_hash + * @param string|null $error_message error_message * - * @return $this + * @return self */ - public function setPdfHash($pdf_hash) + public function setErrorMessage($error_message) { - $this->container['pdf_hash'] = $pdf_hash; + if (is_null($error_message)) { + array_push($this->openAPINullablesSetToNull, 'error_message'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('error_message', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['error_message'] = $error_message; return $this; } /** - * Gets download_url + * Gets metadata + * + * @return object|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param object|null $metadata metadata + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets password * * @return string|null */ - public function getDownloadUrl() + public function getPassword() { - return $this->container['download_url']; + return $this->container['password']; } /** - * Sets download_url + * Sets password * - * @param string|null $download_url download_url + * @param string|null $password password * - * @return $this + * @return self */ - public function setDownloadUrl($download_url) + public function setPassword($password) { - $this->container['download_url'] = $download_url; + if (is_null($password)) { + array_push($this->openAPINullablesSetToNull, 'password'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('password', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['password'] = $password; return $this; } @@ -460,7 +671,7 @@ public function setDownloadUrl($download_url) /** * Gets submission_ids * - * @return string[]|null + * @return string[] */ public function getSubmissionIds() { @@ -470,70 +681,111 @@ public function getSubmissionIds() /** * Sets submission_ids * - * @param string[]|null $submission_ids submission_ids + * @param string[] $submission_ids submission_ids * - * @return $this + * @return self */ public function setSubmissionIds($submission_ids) { + if (is_null($submission_ids)) { + throw new \InvalidArgumentException('non-nullable submission_ids cannot be null'); + } $this->container['submission_ids'] = $submission_ids; return $this; } /** - * Gets id + * Gets source_pdfs + * + * @return object[] + */ + public function getSourcePdfs() + { + return $this->container['source_pdfs']; + } + + /** + * Sets source_pdfs + * + * @param object[] $source_pdfs source_pdfs + * + * @return self + */ + public function setSourcePdfs($source_pdfs) + { + if (is_null($source_pdfs)) { + throw new \InvalidArgumentException('non-nullable source_pdfs cannot be null'); + } + $this->container['source_pdfs'] = $source_pdfs; + + return $this; + } + + /** + * Gets download_url * * @return string|null */ - public function getId() + public function getDownloadUrl() { - return $this->container['id']; + return $this->container['download_url']; } /** - * Sets id + * Sets download_url * - * @param string|null $id id + * @param string|null $download_url download_url * - * @return $this + * @return self */ - public function setId($id) + public function setDownloadUrl($download_url) { - $this->container['id'] = $id; + if (is_null($download_url)) { + array_push($this->openAPINullablesSetToNull, 'download_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('download_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['download_url'] = $download_url; return $this; } /** - * Gets state + * Gets pdf_hash * * @return string|null */ - public function getState() + public function getPdfHash() { - return $this->container['state']; + return $this->container['pdf_hash']; } /** - * Sets state + * Sets pdf_hash * - * @param string|null $state state + * @param string|null $pdf_hash pdf_hash * - * @return $this + * @return self */ - public function setState($state) + public function setPdfHash($pdf_hash) { - $allowedValues = $this->getStateAllowableValues(); - if (!is_null($state) && !in_array($state, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'state', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($pdf_hash)) { + array_push($this->openAPINullablesSetToNull, 'pdf_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pdf_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['state'] = $state; + $this->container['pdf_hash'] = $pdf_hash; return $this; } @@ -553,10 +805,13 @@ public function getActions() * * @param \DocSpring\Model\CombinedSubmissionAction[]|null $actions actions * - * @return $this + * @return self */ public function setActions($actions) { + if (is_null($actions)) { + throw new \InvalidArgumentException('non-nullable actions cannot be null'); + } $this->container['actions'] = $actions; return $this; @@ -568,7 +823,7 @@ public function setActions($actions) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -578,22 +833,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -609,11 +865,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -626,6 +895,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/CombinedSubmissionAction.php b/lib/Model/CombinedSubmissionAction.php index dea6300..3836084 100644 --- a/lib/Model/CombinedSubmissionAction.php +++ b/lib/Model/CombinedSubmissionAction.php @@ -2,7 +2,7 @@ /** * CombinedSubmissionAction * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class CombinedSubmissionAction implements ModelInterface, ArrayAccess +class CombinedSubmissionAction implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,6 +69,8 @@ class CombinedSubmissionAction implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'id' => null, @@ -79,6 +81,27 @@ class CombinedSubmissionAction implements ModelInterface, ArrayAccess 'result_data' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'integration_id' => true, + 'state' => false, + 'action_category' => false, + 'action_type' => false, + 'result_data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -99,6 +122,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -183,19 +258,17 @@ public function getModelName() return self::$openAPIModelName; } - const STATE_PENDING = 'pending'; - const STATE_PROCESSED = 'processed'; - const STATE_FAILED = 'failed'; - const STATE_ERROR = 'error'; - const ACTION_CATEGORY_NOTIFICATION = 'notification'; - const ACTION_CATEGORY_FILE_UPLOAD = 'file_upload'; - const ACTION_TYPE_WEBHOOK = 'webhook'; - const ACTION_TYPE_SLACK_WEBHOOK = 'slack_webhook'; - const ACTION_TYPE_EMAIL = 'email'; - const ACTION_TYPE_AWS_S3_UPLOAD = 'aws_s3_upload'; - + public const STATE_PENDING = 'pending'; + public const STATE_PROCESSED = 'processed'; + public const STATE_FAILED = 'failed'; + public const STATE_ERROR = 'error'; + public const ACTION_CATEGORY_NOTIFICATION = 'notification'; + public const ACTION_CATEGORY_FILE_UPLOAD = 'file_upload'; + public const ACTION_TYPE_WEBHOOK = 'webhook'; + public const ACTION_TYPE_SLACK_WEBHOOK = 'slack_webhook'; + public const ACTION_TYPE_EMAIL = 'email'; + public const ACTION_TYPE_AWS_S3_UPLOAD = 'aws_s3_upload'; - /** * Gets allowable values of the enum * @@ -210,7 +283,7 @@ public function getStateAllowableValues() self::STATE_ERROR, ]; } - + /** * Gets allowable values of the enum * @@ -223,7 +296,7 @@ public function getActionCategoryAllowableValues() self::ACTION_CATEGORY_FILE_UPLOAD, ]; } - + /** * Gets allowable values of the enum * @@ -238,7 +311,6 @@ public function getActionTypeAllowableValues() self::ACTION_TYPE_AWS_S3_UPLOAD, ]; } - /** * Associative array for storing property values @@ -255,12 +327,30 @@ public function getActionTypeAllowableValues() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['integration_id'] = isset($data['integration_id']) ? $data['integration_id'] : null; - $this->container['state'] = isset($data['state']) ? $data['state'] : null; - $this->container['action_category'] = isset($data['action_category']) ? $data['action_category'] : null; - $this->container['action_type'] = isset($data['action_type']) ? $data['action_type'] : null; - $this->container['result_data'] = isset($data['result_data']) ? $data['result_data'] : null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('integration_id', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('action_category', $data ?? [], null); + $this->setIfExists('action_type', $data ?? [], null); + $this->setIfExists('result_data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -284,7 +374,8 @@ public function listInvalidProperties() $allowedValues = $this->getStateAllowableValues(); if (!is_null($this->container['state']) && !in_array($this->container['state'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'state', must be one of '%s'", + "invalid value '%s' for 'state', must be one of '%s'", + $this->container['state'], implode("', '", $allowedValues) ); } @@ -295,7 +386,8 @@ public function listInvalidProperties() $allowedValues = $this->getActionCategoryAllowableValues(); if (!is_null($this->container['action_category']) && !in_array($this->container['action_category'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'action_category', must be one of '%s'", + "invalid value '%s' for 'action_category', must be one of '%s'", + $this->container['action_category'], implode("', '", $allowedValues) ); } @@ -306,7 +398,8 @@ public function listInvalidProperties() $allowedValues = $this->getActionTypeAllowableValues(); if (!is_null($this->container['action_type']) && !in_array($this->container['action_type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'action_type', must be one of '%s'", + "invalid value '%s' for 'action_type', must be one of '%s'", + $this->container['action_type'], implode("', '", $allowedValues) ); } @@ -344,10 +437,13 @@ public function getId() * * @param string $id id * - * @return $this + * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -368,10 +464,20 @@ public function getIntegrationId() * * @param string $integration_id integration_id * - * @return $this + * @return self */ public function setIntegrationId($integration_id) { + if (is_null($integration_id)) { + array_push($this->openAPINullablesSetToNull, 'integration_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('integration_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['integration_id'] = $integration_id; return $this; @@ -392,15 +498,19 @@ public function getState() * * @param string $state state * - * @return $this + * @return self */ public function setState($state) { + if (is_null($state)) { + throw new \InvalidArgumentException('non-nullable state cannot be null'); + } $allowedValues = $this->getStateAllowableValues(); if (!in_array($state, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'state', must be one of '%s'", + "Invalid value '%s' for 'state', must be one of '%s'", + $state, implode("', '", $allowedValues) ) ); @@ -425,15 +535,19 @@ public function getActionCategory() * * @param string $action_category action_category * - * @return $this + * @return self */ public function setActionCategory($action_category) { + if (is_null($action_category)) { + throw new \InvalidArgumentException('non-nullable action_category cannot be null'); + } $allowedValues = $this->getActionCategoryAllowableValues(); if (!in_array($action_category, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'action_category', must be one of '%s'", + "Invalid value '%s' for 'action_category', must be one of '%s'", + $action_category, implode("', '", $allowedValues) ) ); @@ -458,15 +572,19 @@ public function getActionType() * * @param string $action_type action_type * - * @return $this + * @return self */ public function setActionType($action_type) { + if (is_null($action_type)) { + throw new \InvalidArgumentException('non-nullable action_type cannot be null'); + } $allowedValues = $this->getActionTypeAllowableValues(); if (!in_array($action_type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'action_type', must be one of '%s'", + "Invalid value '%s' for 'action_type', must be one of '%s'", + $action_type, implode("', '", $allowedValues) ) ); @@ -491,10 +609,13 @@ public function getResultData() * * @param object $result_data result_data * - * @return $this + * @return self */ public function setResultData($result_data) { + if (is_null($result_data)) { + throw new \InvalidArgumentException('non-nullable result_data cannot be null'); + } $this->container['result_data'] = $result_data; return $this; @@ -506,7 +627,7 @@ public function setResultData($result_data) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -516,22 +637,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -547,11 +669,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -564,6 +699,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/CombinedSubmissionData.php b/lib/Model/CombinedSubmissionData.php index 479bd6f..0a9be04 100644 --- a/lib/Model/CombinedSubmissionData.php +++ b/lib/Model/CombinedSubmissionData.php @@ -2,7 +2,7 @@ /** * CombinedSubmissionData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class CombinedSubmissionData implements ModelInterface, ArrayAccess +class CombinedSubmissionData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -68,6 +68,8 @@ class CombinedSubmissionData implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'expires_in' => null, @@ -77,6 +79,26 @@ class CombinedSubmissionData implements ModelInterface, ArrayAccess 'test' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'expires_in' => false, + 'metadata' => false, + 'password' => false, + 'submission_ids' => false, + 'test' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -97,6 +119,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -178,9 +252,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -197,11 +268,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['expires_in'] = isset($data['expires_in']) ? $data['expires_in'] : null; - $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; - $this->container['password'] = isset($data['password']) ? $data['password'] : null; - $this->container['submission_ids'] = isset($data['submission_ids']) ? $data['submission_ids'] : null; - $this->container['test'] = isset($data['test']) ? $data['test'] : null; + $this->setIfExists('expires_in', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('submission_ids', $data ?? [], null); + $this->setIfExists('test', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -246,10 +335,13 @@ public function getExpiresIn() * * @param int|null $expires_in expires_in * - * @return $this + * @return self */ public function setExpiresIn($expires_in) { + if (is_null($expires_in)) { + throw new \InvalidArgumentException('non-nullable expires_in cannot be null'); + } $this->container['expires_in'] = $expires_in; return $this; @@ -270,10 +362,13 @@ public function getMetadata() * * @param object|null $metadata metadata * - * @return $this + * @return self */ public function setMetadata($metadata) { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } $this->container['metadata'] = $metadata; return $this; @@ -294,10 +389,13 @@ public function getPassword() * * @param string|null $password password * - * @return $this + * @return self */ public function setPassword($password) { + if (is_null($password)) { + throw new \InvalidArgumentException('non-nullable password cannot be null'); + } $this->container['password'] = $password; return $this; @@ -318,10 +416,13 @@ public function getSubmissionIds() * * @param string[] $submission_ids submission_ids * - * @return $this + * @return self */ public function setSubmissionIds($submission_ids) { + if (is_null($submission_ids)) { + throw new \InvalidArgumentException('non-nullable submission_ids cannot be null'); + } $this->container['submission_ids'] = $submission_ids; return $this; @@ -342,10 +443,13 @@ public function getTest() * * @param bool|null $test test * - * @return $this + * @return self */ public function setTest($test) { + if (is_null($test)) { + throw new \InvalidArgumentException('non-nullable test cannot be null'); + } $this->container['test'] = $test; return $this; @@ -357,7 +461,7 @@ public function setTest($test) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -367,22 +471,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -398,11 +503,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -415,6 +533,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/CopyTemplateData.php b/lib/Model/CopyTemplateData.php index 9bb69ed..f176cf7 100644 --- a/lib/Model/CopyTemplateData.php +++ b/lib/Model/CopyTemplateData.php @@ -2,7 +2,7 @@ /** * CopyTemplateData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class CopyTemplateData implements ModelInterface, ArrayAccess +class CopyTemplateData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,12 +65,31 @@ class CopyTemplateData implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'name' => null, 'parent_folder_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'parent_folder_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -91,6 +110,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -163,9 +234,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +250,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['parent_folder_id'] = isset($data['parent_folder_id']) ? $data['parent_folder_id'] : null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('parent_folder_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -228,10 +314,13 @@ public function getName() * * @param string|null $name name * - * @return $this + * @return self */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -252,10 +341,13 @@ public function getParentFolderId() * * @param string $parent_folder_id parent_folder_id * - * @return $this + * @return self */ public function setParentFolderId($parent_folder_id) { + if (is_null($parent_folder_id)) { + throw new \InvalidArgumentException('non-nullable parent_folder_id cannot be null'); + } $this->container['parent_folder_id'] = $parent_folder_id; return $this; @@ -267,7 +359,7 @@ public function setParentFolderId($parent_folder_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -277,22 +369,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -308,11 +401,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -325,6 +431,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/CreateCombinedSubmissionResponse.php b/lib/Model/CreateCombinedSubmissionResponse.php index 6e56631..1f9e735 100644 --- a/lib/Model/CreateCombinedSubmissionResponse.php +++ b/lib/Model/CreateCombinedSubmissionResponse.php @@ -2,7 +2,7 @@ /** * CreateCombinedSubmissionResponse * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class CreateCombinedSubmissionResponse implements ModelInterface, ArrayAccess +class CreateCombinedSubmissionResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,22 +57,42 @@ class CreateCombinedSubmissionResponse implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'combined_submission' => '\DocSpring\Model\CombinedSubmission', + 'status' => 'string', 'errors' => 'string[]', - 'status' => 'string' + 'combined_submission' => '\DocSpring\Model\CombinedSubmission' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'combined_submission' => null, + 'status' => null, 'errors' => null, - 'status' => null + 'combined_submission' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'errors' => false, + 'combined_submission' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -93,6 +113,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -100,9 +172,9 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'combined_submission' => 'combined_submission', + 'status' => 'status', 'errors' => 'errors', - 'status' => 'status' + 'combined_submission' => 'combined_submission' ]; /** @@ -111,9 +183,9 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'combined_submission' => 'setCombinedSubmission', + 'status' => 'setStatus', 'errors' => 'setErrors', - 'status' => 'setStatus' + 'combined_submission' => 'setCombinedSubmission' ]; /** @@ -122,9 +194,9 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'combined_submission' => 'getCombinedSubmission', + 'status' => 'getStatus', 'errors' => 'getErrors', - 'status' => 'getStatus' + 'combined_submission' => 'getCombinedSubmission' ]; /** @@ -168,11 +240,9 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_SUCCESS = 'success'; - const STATUS_ERROR = 'error'; - + public const STATUS_SUCCESS = 'success'; + public const STATUS_ERROR = 'error'; - /** * Gets allowable values of the enum * @@ -185,7 +255,6 @@ public function getStatusAllowableValues() self::STATUS_ERROR, ]; } - /** * Associative array for storing property values @@ -202,9 +271,27 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['combined_submission'] = isset($data['combined_submission']) ? $data['combined_submission'] : null; - $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('combined_submission', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -216,14 +303,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } + if ($this->container['combined_submission'] === null) { + $invalidProperties[] = "'combined_submission' can't be null"; + } return $invalidProperties; } @@ -240,25 +334,38 @@ public function valid() /** - * Gets combined_submission + * Gets status * - * @return \DocSpring\Model\CombinedSubmission|null + * @return string */ - public function getCombinedSubmission() + public function getStatus() { - return $this->container['combined_submission']; + return $this->container['status']; } /** - * Sets combined_submission + * Sets status * - * @param \DocSpring\Model\CombinedSubmission|null $combined_submission combined_submission + * @param string $status status * - * @return $this + * @return self */ - public function setCombinedSubmission($combined_submission) + public function setStatus($status) { - $this->container['combined_submission'] = $combined_submission; + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; return $this; } @@ -278,44 +385,41 @@ public function getErrors() * * @param string[]|null $errors errors * - * @return $this + * @return self */ public function setErrors($errors) { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } $this->container['errors'] = $errors; return $this; } /** - * Gets status + * Gets combined_submission * - * @return string|null + * @return \DocSpring\Model\CombinedSubmission */ - public function getStatus() + public function getCombinedSubmission() { - return $this->container['status']; + return $this->container['combined_submission']; } /** - * Sets status + * Sets combined_submission * - * @param string|null $status status + * @param \DocSpring\Model\CombinedSubmission $combined_submission combined_submission * - * @return $this + * @return self */ - public function setStatus($status) + public function setCombinedSubmission($combined_submission) { - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'status', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($combined_submission)) { + throw new \InvalidArgumentException('non-nullable combined_submission cannot be null'); } - $this->container['status'] = $status; + $this->container['combined_submission'] = $combined_submission; return $this; } @@ -326,7 +430,7 @@ public function setStatus($status) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -336,22 +440,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -367,11 +472,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -384,6 +502,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/CreateCustomFileData.php b/lib/Model/CreateCustomFileData.php index 6da9231..2fb07db 100644 --- a/lib/Model/CreateCustomFileData.php +++ b/lib/Model/CreateCustomFileData.php @@ -2,7 +2,7 @@ /** * CreateCustomFileData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class CreateCustomFileData implements ModelInterface, ArrayAccess +class CreateCustomFileData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -64,11 +64,29 @@ class CreateCustomFileData implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'cache_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cache_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -89,6 +107,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -158,9 +228,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -177,7 +244,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['cache_id'] = isset($data['cache_id']) ? $data['cache_id'] : null; + $this->setIfExists('cache_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -226,10 +311,13 @@ public function getCacheId() * * @param string $cache_id cache_id * - * @return $this + * @return self */ public function setCacheId($cache_id) { + if (is_null($cache_id)) { + throw new \InvalidArgumentException('non-nullable cache_id cannot be null'); + } if ((mb_strlen($cache_id) < 1)) { throw new \InvalidArgumentException('invalid length for $cache_id when calling CreateCustomFileData., must be bigger than or equal to 1.'); @@ -246,7 +334,7 @@ public function setCacheId($cache_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -256,22 +344,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -287,11 +376,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -304,6 +406,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/CreateCustomFileResponse.php b/lib/Model/CreateCustomFileResponse.php index 2990bbf..8488330 100644 --- a/lib/Model/CreateCustomFileResponse.php +++ b/lib/Model/CreateCustomFileResponse.php @@ -2,7 +2,7 @@ /** * CreateCustomFileResponse * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class CreateCustomFileResponse implements ModelInterface, ArrayAccess +class CreateCustomFileResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,22 +57,42 @@ class CreateCustomFileResponse implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'custom_file' => '\DocSpring\Model\CustomFile', + 'status' => 'string', 'errors' => 'string[]', - 'status' => 'string' + 'custom_file' => 'object' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'custom_file' => null, + 'status' => null, 'errors' => null, - 'status' => null + 'custom_file' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'errors' => false, + 'custom_file' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -93,6 +113,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -100,9 +172,9 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'custom_file' => 'custom_file', + 'status' => 'status', 'errors' => 'errors', - 'status' => 'status' + 'custom_file' => 'custom_file' ]; /** @@ -111,9 +183,9 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'custom_file' => 'setCustomFile', + 'status' => 'setStatus', 'errors' => 'setErrors', - 'status' => 'setStatus' + 'custom_file' => 'setCustomFile' ]; /** @@ -122,9 +194,9 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'custom_file' => 'getCustomFile', + 'status' => 'getStatus', 'errors' => 'getErrors', - 'status' => 'getStatus' + 'custom_file' => 'getCustomFile' ]; /** @@ -168,11 +240,9 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_SUCCESS = 'success'; - const STATUS_ERROR = 'error'; - + public const STATUS_SUCCESS = 'success'; + public const STATUS_ERROR = 'error'; - /** * Gets allowable values of the enum * @@ -185,7 +255,6 @@ public function getStatusAllowableValues() self::STATUS_ERROR, ]; } - /** * Associative array for storing property values @@ -202,9 +271,27 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['custom_file'] = isset($data['custom_file']) ? $data['custom_file'] : null; - $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('custom_file', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -216,14 +303,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } + if ($this->container['custom_file'] === null) { + $invalidProperties[] = "'custom_file' can't be null"; + } return $invalidProperties; } @@ -240,25 +334,38 @@ public function valid() /** - * Gets custom_file + * Gets status * - * @return \DocSpring\Model\CustomFile|null + * @return string */ - public function getCustomFile() + public function getStatus() { - return $this->container['custom_file']; + return $this->container['status']; } /** - * Sets custom_file + * Sets status * - * @param \DocSpring\Model\CustomFile|null $custom_file custom_file + * @param string $status status * - * @return $this + * @return self */ - public function setCustomFile($custom_file) + public function setStatus($status) { - $this->container['custom_file'] = $custom_file; + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; return $this; } @@ -278,44 +385,41 @@ public function getErrors() * * @param string[]|null $errors errors * - * @return $this + * @return self */ public function setErrors($errors) { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } $this->container['errors'] = $errors; return $this; } /** - * Gets status + * Gets custom_file * - * @return string|null + * @return object */ - public function getStatus() + public function getCustomFile() { - return $this->container['status']; + return $this->container['custom_file']; } /** - * Sets status + * Sets custom_file * - * @param string|null $status status + * @param object $custom_file custom_file * - * @return $this + * @return self */ - public function setStatus($status) + public function setCustomFile($custom_file) { - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'status', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($custom_file)) { + throw new \InvalidArgumentException('non-nullable custom_file cannot be null'); } - $this->container['status'] = $status; + $this->container['custom_file'] = $custom_file; return $this; } @@ -326,7 +430,7 @@ public function setStatus($status) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -336,22 +440,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -367,11 +472,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -384,6 +502,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/FoldersFolder.php b/lib/Model/CreateFolderAttributes.php similarity index 52% rename from lib/Model/FoldersFolder.php rename to lib/Model/CreateFolderAttributes.php index c97b863..f9086ba 100644 --- a/lib/Model/FoldersFolder.php +++ b/lib/Model/CreateFolderAttributes.php @@ -1,8 +1,8 @@ */ -class FoldersFolder implements ModelInterface, ArrayAccess +class CreateFolderAttributes implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. * * @var string */ - protected static $openAPIModelName = 'folders_folder'; + protected static $openAPIModelName = 'create_folder_attributes'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,20 +57,39 @@ class FoldersFolder implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'parent_folder_id' => 'string', - 'name' => 'string' + 'name' => 'string', + 'parent_folder_id' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'parent_folder_id' => null, - 'name' => null + 'name' => null, + 'parent_folder_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'parent_folder_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -91,6 +110,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -98,8 +169,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'parent_folder_id' => 'parent_folder_id', - 'name' => 'name' + 'name' => 'name', + 'parent_folder_id' => 'parent_folder_id' ]; /** @@ -108,8 +179,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'parent_folder_id' => 'setParentFolderId', - 'name' => 'setName' + 'name' => 'setName', + 'parent_folder_id' => 'setParentFolderId' ]; /** @@ -118,8 +189,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'parent_folder_id' => 'getParentFolderId', - 'name' => 'getName' + 'name' => 'getName', + 'parent_folder_id' => 'getParentFolderId' ]; /** @@ -163,9 +234,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -182,8 +250,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['parent_folder_id'] = isset($data['parent_folder_id']) ? $data['parent_folder_id'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('parent_folder_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -195,6 +281,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } return $invalidProperties; } @@ -211,49 +300,55 @@ public function valid() /** - * Gets parent_folder_id + * Gets name * - * @return string|null + * @return string */ - public function getParentFolderId() + public function getName() { - return $this->container['parent_folder_id']; + return $this->container['name']; } /** - * Sets parent_folder_id + * Sets name * - * @param string|null $parent_folder_id parent_folder_id + * @param string $name name * - * @return $this + * @return self */ - public function setParentFolderId($parent_folder_id) + public function setName($name) { - $this->container['parent_folder_id'] = $parent_folder_id; + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; return $this; } /** - * Gets name + * Gets parent_folder_id * * @return string|null */ - public function getName() + public function getParentFolderId() { - return $this->container['name']; + return $this->container['parent_folder_id']; } /** - * Sets name + * Sets parent_folder_id * - * @param string|null $name name + * @param string|null $parent_folder_id parent_folder_id * - * @return $this + * @return self */ - public function setName($name) + public function setParentFolderId($parent_folder_id) { - $this->container['name'] = $name; + if (is_null($parent_folder_id)) { + throw new \InvalidArgumentException('non-nullable parent_folder_id cannot be null'); + } + $this->container['parent_folder_id'] = $parent_folder_id; return $this; } @@ -264,7 +359,7 @@ public function setName($name) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -274,22 +369,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -305,11 +401,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -322,6 +431,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/CreateFolderData.php b/lib/Model/CreateFolderData.php index 913b3e5..8979e75 100644 --- a/lib/Model/CreateFolderData.php +++ b/lib/Model/CreateFolderData.php @@ -2,7 +2,7 @@ /** * CreateFolderData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class CreateFolderData implements ModelInterface, ArrayAccess +class CreateFolderData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,18 +57,36 @@ class CreateFolderData implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'folder' => '\DocSpring\Model\FoldersFolder' + 'folder' => '\DocSpring\Model\CreateFolderAttributes' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'folder' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'folder' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -89,6 +107,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -158,9 +228,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -177,7 +244,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['folder'] = isset($data['folder']) ? $data['folder'] : null; + $this->setIfExists('folder', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -210,7 +295,7 @@ public function valid() /** * Gets folder * - * @return \DocSpring\Model\FoldersFolder + * @return \DocSpring\Model\CreateFolderAttributes */ public function getFolder() { @@ -220,12 +305,15 @@ public function getFolder() /** * Sets folder * - * @param \DocSpring\Model\FoldersFolder $folder folder + * @param \DocSpring\Model\CreateFolderAttributes $folder folder * - * @return $this + * @return self */ public function setFolder($folder) { + if (is_null($folder)) { + throw new \InvalidArgumentException('non-nullable folder cannot be null'); + } $this->container['folder'] = $folder; return $this; @@ -237,7 +325,7 @@ public function setFolder($folder) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -247,22 +335,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -278,11 +367,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -295,6 +397,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/CreateHtmlTemplateData.php b/lib/Model/CreateHtmlTemplateData.php index ccde278..26ce11d 100644 --- a/lib/Model/CreateHtmlTemplateData.php +++ b/lib/Model/CreateHtmlTemplateData.php @@ -2,7 +2,7 @@ /** * CreateHtmlTemplateData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class CreateHtmlTemplateData implements ModelInterface, ArrayAccess +class CreateHtmlTemplateData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -64,11 +64,29 @@ class CreateHtmlTemplateData implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'template' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'template' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -89,6 +107,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -158,9 +228,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -177,7 +244,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['template'] = isset($data['template']) ? $data['template'] : null; + $this->setIfExists('template', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -222,10 +307,13 @@ public function getTemplate() * * @param \DocSpring\Model\HtmlTemplateData $template template * - * @return $this + * @return self */ public function setTemplate($template) { + if (is_null($template)) { + throw new \InvalidArgumentException('non-nullable template cannot be null'); + } $this->container['template'] = $template; return $this; @@ -237,7 +325,7 @@ public function setTemplate($template) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -247,22 +335,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -278,11 +367,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -295,6 +397,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/CreateSubmissionBatchResponse.php b/lib/Model/CreateSubmissionBatchResponse.php index 3c263ee..4cc4fd4 100644 --- a/lib/Model/CreateSubmissionBatchResponse.php +++ b/lib/Model/CreateSubmissionBatchResponse.php @@ -2,7 +2,7 @@ /** * CreateSubmissionBatchResponse * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class CreateSubmissionBatchResponse implements ModelInterface, ArrayAccess +class CreateSubmissionBatchResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,26 +57,48 @@ class CreateSubmissionBatchResponse implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'submission_batch' => '\DocSpring\Model\SubmissionBatch', - 'submissions' => '\DocSpring\Model\CreateSubmissionBatchSubmissionsResponse[]', + 'status' => 'string', 'error' => 'string', 'errors' => 'string[]', - 'status' => 'string' + 'submission_batch' => '\DocSpring\Model\SubmissionBatch', + 'submissions' => '\DocSpring\Model\CreateSubmissionBatchSubmissionsResponse[]' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'submission_batch' => null, - 'submissions' => null, + 'status' => null, 'error' => null, 'errors' => null, - 'status' => null + 'submission_batch' => null, + 'submissions' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'error' => false, + 'errors' => false, + 'submission_batch' => false, + 'submissions' => false ]; + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -97,6 +119,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -104,11 +178,11 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'submission_batch' => 'submission_batch', - 'submissions' => 'submissions', + 'status' => 'status', 'error' => 'error', 'errors' => 'errors', - 'status' => 'status' + 'submission_batch' => 'submission_batch', + 'submissions' => 'submissions' ]; /** @@ -117,11 +191,11 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'submission_batch' => 'setSubmissionBatch', - 'submissions' => 'setSubmissions', + 'status' => 'setStatus', 'error' => 'setError', 'errors' => 'setErrors', - 'status' => 'setStatus' + 'submission_batch' => 'setSubmissionBatch', + 'submissions' => 'setSubmissions' ]; /** @@ -130,11 +204,11 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'submission_batch' => 'getSubmissionBatch', - 'submissions' => 'getSubmissions', + 'status' => 'getStatus', 'error' => 'getError', 'errors' => 'getErrors', - 'status' => 'getStatus' + 'submission_batch' => 'getSubmissionBatch', + 'submissions' => 'getSubmissions' ]; /** @@ -178,11 +252,9 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_SUCCESS = 'success'; - const STATUS_ERROR = 'error'; - + public const STATUS_SUCCESS = 'success'; + public const STATUS_ERROR = 'error'; - /** * Gets allowable values of the enum * @@ -195,7 +267,6 @@ public function getStatusAllowableValues() self::STATUS_ERROR, ]; } - /** * Associative array for storing property values @@ -212,11 +283,29 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['submission_batch'] = isset($data['submission_batch']) ? $data['submission_batch'] : null; - $this->container['submissions'] = isset($data['submissions']) ? $data['submissions'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; - $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('error', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('submission_batch', $data ?? [], null); + $this->setIfExists('submissions', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -228,14 +317,24 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } + if ($this->container['submission_batch'] === null) { + $invalidProperties[] = "'submission_batch' can't be null"; + } + if ($this->container['submissions'] === null) { + $invalidProperties[] = "'submissions' can't be null"; + } return $invalidProperties; } @@ -252,49 +351,38 @@ public function valid() /** - * Gets submission_batch - * - * @return \DocSpring\Model\SubmissionBatch|null - */ - public function getSubmissionBatch() - { - return $this->container['submission_batch']; - } - - /** - * Sets submission_batch - * - * @param \DocSpring\Model\SubmissionBatch|null $submission_batch submission_batch - * - * @return $this - */ - public function setSubmissionBatch($submission_batch) - { - $this->container['submission_batch'] = $submission_batch; - - return $this; - } - - /** - * Gets submissions + * Gets status * - * @return \DocSpring\Model\CreateSubmissionBatchSubmissionsResponse[]|null + * @return string */ - public function getSubmissions() + public function getStatus() { - return $this->container['submissions']; + return $this->container['status']; } /** - * Sets submissions + * Sets status * - * @param \DocSpring\Model\CreateSubmissionBatchSubmissionsResponse[]|null $submissions submissions + * @param string $status status * - * @return $this + * @return self */ - public function setSubmissions($submissions) + public function setStatus($status) { - $this->container['submissions'] = $submissions; + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; return $this; } @@ -314,10 +402,13 @@ public function getError() * * @param string|null $error error * - * @return $this + * @return self */ public function setError($error) { + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } $this->container['error'] = $error; return $this; @@ -338,44 +429,68 @@ public function getErrors() * * @param string[]|null $errors errors * - * @return $this + * @return self */ public function setErrors($errors) { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } $this->container['errors'] = $errors; return $this; } /** - * Gets status + * Gets submission_batch * - * @return string|null + * @return \DocSpring\Model\SubmissionBatch */ - public function getStatus() + public function getSubmissionBatch() { - return $this->container['status']; + return $this->container['submission_batch']; } /** - * Sets status + * Sets submission_batch * - * @param string|null $status status + * @param \DocSpring\Model\SubmissionBatch $submission_batch submission_batch * - * @return $this + * @return self */ - public function setStatus($status) + public function setSubmissionBatch($submission_batch) { - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'status', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($submission_batch)) { + throw new \InvalidArgumentException('non-nullable submission_batch cannot be null'); } - $this->container['status'] = $status; + $this->container['submission_batch'] = $submission_batch; + + return $this; + } + + /** + * Gets submissions + * + * @return \DocSpring\Model\CreateSubmissionBatchSubmissionsResponse[] + */ + public function getSubmissions() + { + return $this->container['submissions']; + } + + /** + * Sets submissions + * + * @param \DocSpring\Model\CreateSubmissionBatchSubmissionsResponse[] $submissions submissions + * + * @return self + */ + public function setSubmissions($submissions) + { + if (is_null($submissions)) { + throw new \InvalidArgumentException('non-nullable submissions cannot be null'); + } + $this->container['submissions'] = $submissions; return $this; } @@ -386,7 +501,7 @@ public function setStatus($status) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -396,22 +511,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -427,11 +543,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -444,6 +573,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/CreateSubmissionBatchSubmissionsResponse.php b/lib/Model/CreateSubmissionBatchSubmissionsResponse.php index 6ab0ad8..a743ed5 100644 --- a/lib/Model/CreateSubmissionBatchSubmissionsResponse.php +++ b/lib/Model/CreateSubmissionBatchSubmissionsResponse.php @@ -2,7 +2,7 @@ /** * CreateSubmissionBatchSubmissionsResponse * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class CreateSubmissionBatchSubmissionsResponse implements ModelInterface, ArrayAccess +class CreateSubmissionBatchSubmissionsResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,22 +57,42 @@ class CreateSubmissionBatchSubmissionsResponse implements ModelInterface, ArrayA * @var string[] */ protected static $openAPITypes = [ - 'submission' => '\DocSpring\Model\Submission', + 'status' => 'string', 'errors' => 'string[]', - 'status' => 'string' + 'submission' => '\DocSpring\Model\Submission' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'submission' => null, + 'status' => null, 'errors' => null, - 'status' => null + 'submission' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'errors' => false, + 'submission' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -93,6 +113,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -100,9 +172,9 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'submission' => 'submission', + 'status' => 'status', 'errors' => 'errors', - 'status' => 'status' + 'submission' => 'submission' ]; /** @@ -111,9 +183,9 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'submission' => 'setSubmission', + 'status' => 'setStatus', 'errors' => 'setErrors', - 'status' => 'setStatus' + 'submission' => 'setSubmission' ]; /** @@ -122,9 +194,9 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'submission' => 'getSubmission', + 'status' => 'getStatus', 'errors' => 'getErrors', - 'status' => 'getStatus' + 'submission' => 'getSubmission' ]; /** @@ -168,12 +240,10 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_SUCCESS = 'success'; - const STATUS_ERROR = 'error'; - const STATUS_VALID_BUT_NOT_SAVED = 'valid_but_not_saved'; - + public const STATUS_SUCCESS = 'success'; + public const STATUS_ERROR = 'error'; + public const STATUS_VALID_BUT_NOT_SAVED = 'valid_but_not_saved'; - /** * Gets allowable values of the enum * @@ -187,7 +257,6 @@ public function getStatusAllowableValues() self::STATUS_VALID_BUT_NOT_SAVED, ]; } - /** * Associative array for storing property values @@ -204,9 +273,27 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['submission'] = isset($data['submission']) ? $data['submission'] : null; - $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('submission', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -218,10 +305,14 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } @@ -242,25 +333,38 @@ public function valid() /** - * Gets submission + * Gets status * - * @return \DocSpring\Model\Submission|null + * @return string */ - public function getSubmission() + public function getStatus() { - return $this->container['submission']; + return $this->container['status']; } /** - * Sets submission + * Sets status * - * @param \DocSpring\Model\Submission|null $submission submission + * @param string $status status * - * @return $this + * @return self */ - public function setSubmission($submission) + public function setStatus($status) { - $this->container['submission'] = $submission; + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; return $this; } @@ -280,44 +384,41 @@ public function getErrors() * * @param string[]|null $errors errors * - * @return $this + * @return self */ public function setErrors($errors) { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } $this->container['errors'] = $errors; return $this; } /** - * Gets status + * Gets submission * - * @return string|null + * @return \DocSpring\Model\Submission|null */ - public function getStatus() + public function getSubmission() { - return $this->container['status']; + return $this->container['submission']; } /** - * Sets status + * Sets submission * - * @param string|null $status status + * @param \DocSpring\Model\Submission|null $submission submission * - * @return $this + * @return self */ - public function setStatus($status) + public function setSubmission($submission) { - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'status', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($submission)) { + throw new \InvalidArgumentException('non-nullable submission cannot be null'); } - $this->container['status'] = $status; + $this->container['submission'] = $submission; return $this; } @@ -328,7 +429,7 @@ public function setStatus($status) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -338,22 +439,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -369,11 +471,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -386,6 +501,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/CreateSubmissionData.php b/lib/Model/CreateSubmissionData.php new file mode 100644 index 0000000..f51a1b6 --- /dev/null +++ b/lib/Model/CreateSubmissionData.php @@ -0,0 +1,684 @@ + + */ +class CreateSubmissionData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'create_submission_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'css' => 'string', + 'data' => 'object', + 'data_requests' => '\DocSpring\Model\CreateSubmissionDataRequestData[]', + 'expires_in' => 'int', + 'field_overrides' => 'object', + 'html' => 'string', + 'metadata' => 'object', + 'password' => 'string', + 'test' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'css' => null, + 'data' => null, + 'data_requests' => null, + 'expires_in' => null, + 'field_overrides' => null, + 'html' => null, + 'metadata' => null, + 'password' => null, + 'test' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'css' => false, + 'data' => false, + 'data_requests' => false, + 'expires_in' => false, + 'field_overrides' => false, + 'html' => false, + 'metadata' => false, + 'password' => false, + 'test' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'css' => 'css', + 'data' => 'data', + 'data_requests' => 'data_requests', + 'expires_in' => 'expires_in', + 'field_overrides' => 'field_overrides', + 'html' => 'html', + 'metadata' => 'metadata', + 'password' => 'password', + 'test' => 'test' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'css' => 'setCss', + 'data' => 'setData', + 'data_requests' => 'setDataRequests', + 'expires_in' => 'setExpiresIn', + 'field_overrides' => 'setFieldOverrides', + 'html' => 'setHtml', + 'metadata' => 'setMetadata', + 'password' => 'setPassword', + 'test' => 'setTest' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'css' => 'getCss', + 'data' => 'getData', + 'data_requests' => 'getDataRequests', + 'expires_in' => 'getExpiresIn', + 'field_overrides' => 'getFieldOverrides', + 'html' => 'getHtml', + 'metadata' => 'getMetadata', + 'password' => 'getPassword', + 'test' => 'getTest' + ]; + + /** + * 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->setIfExists('css', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('data_requests', $data ?? [], null); + $this->setIfExists('expires_in', $data ?? [], null); + $this->setIfExists('field_overrides', $data ?? [], null); + $this->setIfExists('html', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('test', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' 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 css + * + * @return string|null + */ + public function getCss() + { + return $this->container['css']; + } + + /** + * Sets css + * + * @param string|null $css css + * + * @return self + */ + public function setCss($css) + { + if (is_null($css)) { + throw new \InvalidArgumentException('non-nullable css cannot be null'); + } + $this->container['css'] = $css; + + return $this; + } + + /** + * Gets data + * + * @return object + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param object $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets data_requests + * + * @return \DocSpring\Model\CreateSubmissionDataRequestData[]|null + */ + public function getDataRequests() + { + return $this->container['data_requests']; + } + + /** + * Sets data_requests + * + * @param \DocSpring\Model\CreateSubmissionDataRequestData[]|null $data_requests data_requests + * + * @return self + */ + public function setDataRequests($data_requests) + { + if (is_null($data_requests)) { + throw new \InvalidArgumentException('non-nullable data_requests cannot be null'); + } + $this->container['data_requests'] = $data_requests; + + return $this; + } + + /** + * Gets expires_in + * + * @return int|null + */ + public function getExpiresIn() + { + return $this->container['expires_in']; + } + + /** + * Sets expires_in + * + * @param int|null $expires_in expires_in + * + * @return self + */ + public function setExpiresIn($expires_in) + { + if (is_null($expires_in)) { + throw new \InvalidArgumentException('non-nullable expires_in cannot be null'); + } + $this->container['expires_in'] = $expires_in; + + return $this; + } + + /** + * Gets field_overrides + * + * @return object|null + */ + public function getFieldOverrides() + { + return $this->container['field_overrides']; + } + + /** + * Sets field_overrides + * + * @param object|null $field_overrides field_overrides + * + * @return self + */ + public function setFieldOverrides($field_overrides) + { + if (is_null($field_overrides)) { + throw new \InvalidArgumentException('non-nullable field_overrides cannot be null'); + } + $this->container['field_overrides'] = $field_overrides; + + return $this; + } + + /** + * Gets html + * + * @return string|null + */ + public function getHtml() + { + return $this->container['html']; + } + + /** + * Sets html + * + * @param string|null $html html + * + * @return self + */ + public function setHtml($html) + { + if (is_null($html)) { + throw new \InvalidArgumentException('non-nullable html cannot be null'); + } + $this->container['html'] = $html; + + return $this; + } + + /** + * Gets metadata + * + * @return object|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param object|null $metadata metadata + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets password + * + * @return string|null + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string|null $password password + * + * @return self + */ + public function setPassword($password) + { + if (is_null($password)) { + throw new \InvalidArgumentException('non-nullable password cannot be null'); + } + $this->container['password'] = $password; + + return $this; + } + + /** + * Gets test + * + * @return bool|null + */ + public function getTest() + { + return $this->container['test']; + } + + /** + * Sets test + * + * @param bool|null $test test + * + * @return self + */ + public function setTest($test) + { + if (is_null($test)) { + throw new \InvalidArgumentException('non-nullable test cannot be null'); + } + $this->container['test'] = $test; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateSubmissionDataRequestData.php b/lib/Model/CreateSubmissionDataRequestData.php index 81615b6..3280681 100644 --- a/lib/Model/CreateSubmissionDataRequestData.php +++ b/lib/Model/CreateSubmissionDataRequestData.php @@ -2,7 +2,7 @@ /** * CreateSubmissionDataRequestData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class CreateSubmissionDataRequestData implements ModelInterface, ArrayAccess +class CreateSubmissionDataRequestData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,18 +57,18 @@ class CreateSubmissionDataRequestData implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'auth_type' => 'string', - 'metadata' => 'object', - 'auth_second_factor_type' => 'string', 'auth_phone_number_hash' => 'string', + 'auth_provider' => 'string', + 'auth_second_factor_type' => 'string', + 'auth_session_id_hash' => 'string', 'auth_session_started_at' => 'string', + 'auth_type' => 'string', 'auth_user_id_hash' => 'string', - 'auth_session_id_hash' => 'string', 'auth_username_hash' => 'string', - 'name' => 'string', - 'fields' => 'string[]', - 'auth_provider' => 'string', 'email' => 'string', + 'fields' => 'string[]', + 'metadata' => 'object', + 'name' => 'string', 'order' => 'int' ]; @@ -76,23 +76,53 @@ class CreateSubmissionDataRequestData implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'auth_type' => null, - 'metadata' => null, - 'auth_second_factor_type' => null, 'auth_phone_number_hash' => null, + 'auth_provider' => null, + 'auth_second_factor_type' => null, + 'auth_session_id_hash' => null, 'auth_session_started_at' => null, + 'auth_type' => null, 'auth_user_id_hash' => null, - 'auth_session_id_hash' => null, 'auth_username_hash' => null, - 'name' => null, - 'fields' => null, - 'auth_provider' => null, 'email' => null, + 'fields' => null, + 'metadata' => null, + 'name' => null, 'order' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'auth_phone_number_hash' => true, + 'auth_provider' => true, + 'auth_second_factor_type' => false, + 'auth_session_id_hash' => true, + 'auth_session_started_at' => true, + 'auth_type' => false, + 'auth_user_id_hash' => true, + 'auth_username_hash' => true, + 'email' => true, + 'fields' => true, + 'metadata' => false, + 'name' => true, + 'order' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -113,6 +143,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -120,18 +202,18 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'auth_type' => 'auth_type', - 'metadata' => 'metadata', - 'auth_second_factor_type' => 'auth_second_factor_type', 'auth_phone_number_hash' => 'auth_phone_number_hash', + 'auth_provider' => 'auth_provider', + 'auth_second_factor_type' => 'auth_second_factor_type', + 'auth_session_id_hash' => 'auth_session_id_hash', 'auth_session_started_at' => 'auth_session_started_at', + 'auth_type' => 'auth_type', 'auth_user_id_hash' => 'auth_user_id_hash', - 'auth_session_id_hash' => 'auth_session_id_hash', 'auth_username_hash' => 'auth_username_hash', - 'name' => 'name', - 'fields' => 'fields', - 'auth_provider' => 'auth_provider', 'email' => 'email', + 'fields' => 'fields', + 'metadata' => 'metadata', + 'name' => 'name', 'order' => 'order' ]; @@ -141,18 +223,18 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'auth_type' => 'setAuthType', - 'metadata' => 'setMetadata', - 'auth_second_factor_type' => 'setAuthSecondFactorType', 'auth_phone_number_hash' => 'setAuthPhoneNumberHash', + 'auth_provider' => 'setAuthProvider', + 'auth_second_factor_type' => 'setAuthSecondFactorType', + 'auth_session_id_hash' => 'setAuthSessionIdHash', 'auth_session_started_at' => 'setAuthSessionStartedAt', + 'auth_type' => 'setAuthType', 'auth_user_id_hash' => 'setAuthUserIdHash', - 'auth_session_id_hash' => 'setAuthSessionIdHash', 'auth_username_hash' => 'setAuthUsernameHash', - 'name' => 'setName', - 'fields' => 'setFields', - 'auth_provider' => 'setAuthProvider', 'email' => 'setEmail', + 'fields' => 'setFields', + 'metadata' => 'setMetadata', + 'name' => 'setName', 'order' => 'setOrder' ]; @@ -162,18 +244,18 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'auth_type' => 'getAuthType', - 'metadata' => 'getMetadata', - 'auth_second_factor_type' => 'getAuthSecondFactorType', 'auth_phone_number_hash' => 'getAuthPhoneNumberHash', + 'auth_provider' => 'getAuthProvider', + 'auth_second_factor_type' => 'getAuthSecondFactorType', + 'auth_session_id_hash' => 'getAuthSessionIdHash', 'auth_session_started_at' => 'getAuthSessionStartedAt', + 'auth_type' => 'getAuthType', 'auth_user_id_hash' => 'getAuthUserIdHash', - 'auth_session_id_hash' => 'getAuthSessionIdHash', 'auth_username_hash' => 'getAuthUsernameHash', - 'name' => 'getName', - 'fields' => 'getFields', - 'auth_provider' => 'getAuthProvider', 'email' => 'getEmail', + 'fields' => 'getFields', + 'metadata' => 'getMetadata', + 'name' => 'getName', 'order' => 'getOrder' ]; @@ -218,57 +300,54 @@ public function getModelName() return self::$openAPIModelName; } - const AUTH_TYPE_NONE = 'none'; - const AUTH_TYPE_PASSWORD = 'password'; - const AUTH_TYPE_OAUTH = 'oauth'; - const AUTH_TYPE_EMAIL_LINK = 'email_link'; - const AUTH_TYPE_PHONE_NUMBER = 'phone_number'; - const AUTH_TYPE_LDAP = 'ldap'; - const AUTH_TYPE_SAML = 'saml'; - const AUTH_SECOND_FACTOR_TYPE_NONE = 'none'; - const AUTH_SECOND_FACTOR_TYPE_PHONE_NUMBER = 'phone_number'; - const AUTH_SECOND_FACTOR_TYPE_TOTP = 'totp'; - const AUTH_SECOND_FACTOR_TYPE_MOBILE_PUSH = 'mobile_push'; - const AUTH_SECOND_FACTOR_TYPE_SECURITY_KEY = 'security_key'; - const AUTH_SECOND_FACTOR_TYPE_FINGERPRINT = 'fingerprint'; - + public const AUTH_SECOND_FACTOR_TYPE_NONE = 'none'; + public const AUTH_SECOND_FACTOR_TYPE_PHONE_NUMBER = 'phone_number'; + public const AUTH_SECOND_FACTOR_TYPE_TOTP = 'totp'; + public const AUTH_SECOND_FACTOR_TYPE_MOBILE_PUSH = 'mobile_push'; + public const AUTH_SECOND_FACTOR_TYPE_SECURITY_KEY = 'security_key'; + public const AUTH_SECOND_FACTOR_TYPE_FINGERPRINT = 'fingerprint'; + public const AUTH_TYPE_NONE = 'none'; + public const AUTH_TYPE_PASSWORD = 'password'; + public const AUTH_TYPE_OAUTH = 'oauth'; + public const AUTH_TYPE_EMAIL_LINK = 'email_link'; + public const AUTH_TYPE_PHONE_NUMBER = 'phone_number'; + public const AUTH_TYPE_LDAP = 'ldap'; + public const AUTH_TYPE_SAML = 'saml'; - /** * Gets allowable values of the enum * * @return string[] */ - public function getAuthTypeAllowableValues() + public function getAuthSecondFactorTypeAllowableValues() { return [ - self::AUTH_TYPE_NONE, - self::AUTH_TYPE_PASSWORD, - self::AUTH_TYPE_OAUTH, - self::AUTH_TYPE_EMAIL_LINK, - self::AUTH_TYPE_PHONE_NUMBER, - self::AUTH_TYPE_LDAP, - self::AUTH_TYPE_SAML, + self::AUTH_SECOND_FACTOR_TYPE_NONE, + self::AUTH_SECOND_FACTOR_TYPE_PHONE_NUMBER, + self::AUTH_SECOND_FACTOR_TYPE_TOTP, + self::AUTH_SECOND_FACTOR_TYPE_MOBILE_PUSH, + self::AUTH_SECOND_FACTOR_TYPE_SECURITY_KEY, + self::AUTH_SECOND_FACTOR_TYPE_FINGERPRINT, ]; } - + /** * Gets allowable values of the enum * * @return string[] */ - public function getAuthSecondFactorTypeAllowableValues() + public function getAuthTypeAllowableValues() { return [ - self::AUTH_SECOND_FACTOR_TYPE_NONE, - self::AUTH_SECOND_FACTOR_TYPE_PHONE_NUMBER, - self::AUTH_SECOND_FACTOR_TYPE_TOTP, - self::AUTH_SECOND_FACTOR_TYPE_MOBILE_PUSH, - self::AUTH_SECOND_FACTOR_TYPE_SECURITY_KEY, - self::AUTH_SECOND_FACTOR_TYPE_FINGERPRINT, + self::AUTH_TYPE_NONE, + self::AUTH_TYPE_PASSWORD, + self::AUTH_TYPE_OAUTH, + self::AUTH_TYPE_EMAIL_LINK, + self::AUTH_TYPE_PHONE_NUMBER, + self::AUTH_TYPE_LDAP, + self::AUTH_TYPE_SAML, ]; } - /** * Associative array for storing property values @@ -285,19 +364,37 @@ public function getAuthSecondFactorTypeAllowableValues() */ public function __construct(array $data = null) { - $this->container['auth_type'] = isset($data['auth_type']) ? $data['auth_type'] : null; - $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; - $this->container['auth_second_factor_type'] = isset($data['auth_second_factor_type']) ? $data['auth_second_factor_type'] : null; - $this->container['auth_phone_number_hash'] = isset($data['auth_phone_number_hash']) ? $data['auth_phone_number_hash'] : null; - $this->container['auth_session_started_at'] = isset($data['auth_session_started_at']) ? $data['auth_session_started_at'] : null; - $this->container['auth_user_id_hash'] = isset($data['auth_user_id_hash']) ? $data['auth_user_id_hash'] : null; - $this->container['auth_session_id_hash'] = isset($data['auth_session_id_hash']) ? $data['auth_session_id_hash'] : null; - $this->container['auth_username_hash'] = isset($data['auth_username_hash']) ? $data['auth_username_hash'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['fields'] = isset($data['fields']) ? $data['fields'] : null; - $this->container['auth_provider'] = isset($data['auth_provider']) ? $data['auth_provider'] : null; - $this->container['email'] = isset($data['email']) ? $data['email'] : null; - $this->container['order'] = isset($data['order']) ? $data['order'] : null; + $this->setIfExists('auth_phone_number_hash', $data ?? [], null); + $this->setIfExists('auth_provider', $data ?? [], null); + $this->setIfExists('auth_second_factor_type', $data ?? [], null); + $this->setIfExists('auth_session_id_hash', $data ?? [], null); + $this->setIfExists('auth_session_started_at', $data ?? [], null); + $this->setIfExists('auth_type', $data ?? [], null); + $this->setIfExists('auth_user_id_hash', $data ?? [], null); + $this->setIfExists('auth_username_hash', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('fields', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('order', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -309,22 +406,30 @@ public function listInvalidProperties() { $invalidProperties = []; - $allowedValues = $this->getAuthTypeAllowableValues(); - if (!is_null($this->container['auth_type']) && !in_array($this->container['auth_type'], $allowedValues, true)) { + $allowedValues = $this->getAuthSecondFactorTypeAllowableValues(); + if (!is_null($this->container['auth_second_factor_type']) && !in_array($this->container['auth_second_factor_type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'auth_type', must be one of '%s'", + "invalid value '%s' for 'auth_second_factor_type', must be one of '%s'", + $this->container['auth_second_factor_type'], implode("', '", $allowedValues) ); } - $allowedValues = $this->getAuthSecondFactorTypeAllowableValues(); - if (!is_null($this->container['auth_second_factor_type']) && !in_array($this->container['auth_second_factor_type'], $allowedValues, true)) { + if ($this->container['auth_type'] === null) { + $invalidProperties[] = "'auth_type' can't be null"; + } + $allowedValues = $this->getAuthTypeAllowableValues(); + if (!is_null($this->container['auth_type']) && !in_array($this->container['auth_type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'auth_second_factor_type', must be one of '%s'", + "invalid value '%s' for 'auth_type', must be one of '%s'", + $this->container['auth_type'], implode("', '", $allowedValues) ); } + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } return $invalidProperties; } @@ -341,58 +446,69 @@ public function valid() /** - * Gets auth_type + * Gets auth_phone_number_hash * * @return string|null */ - public function getAuthType() + public function getAuthPhoneNumberHash() { - return $this->container['auth_type']; + return $this->container['auth_phone_number_hash']; } /** - * Sets auth_type + * Sets auth_phone_number_hash * - * @param string|null $auth_type auth_type + * @param string|null $auth_phone_number_hash auth_phone_number_hash * - * @return $this + * @return self */ - public function setAuthType($auth_type) + public function setAuthPhoneNumberHash($auth_phone_number_hash) { - $allowedValues = $this->getAuthTypeAllowableValues(); - if (!is_null($auth_type) && !in_array($auth_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'auth_type', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($auth_phone_number_hash)) { + array_push($this->openAPINullablesSetToNull, 'auth_phone_number_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_phone_number_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['auth_type'] = $auth_type; + $this->container['auth_phone_number_hash'] = $auth_phone_number_hash; return $this; } /** - * Gets metadata + * Gets auth_provider * - * @return object|null + * @return string|null */ - public function getMetadata() + public function getAuthProvider() { - return $this->container['metadata']; + return $this->container['auth_provider']; } /** - * Sets metadata + * Sets auth_provider * - * @param object|null $metadata metadata + * @param string|null $auth_provider auth_provider * - * @return $this + * @return self */ - public function setMetadata($metadata) + public function setAuthProvider($auth_provider) { - $this->container['metadata'] = $metadata; + if (is_null($auth_provider)) { + array_push($this->openAPINullablesSetToNull, 'auth_provider'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_provider', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['auth_provider'] = $auth_provider; return $this; } @@ -412,15 +528,19 @@ public function getAuthSecondFactorType() * * @param string|null $auth_second_factor_type auth_second_factor_type * - * @return $this + * @return self */ public function setAuthSecondFactorType($auth_second_factor_type) { + if (is_null($auth_second_factor_type)) { + throw new \InvalidArgumentException('non-nullable auth_second_factor_type cannot be null'); + } $allowedValues = $this->getAuthSecondFactorTypeAllowableValues(); - if (!is_null($auth_second_factor_type) && !in_array($auth_second_factor_type, $allowedValues, true)) { + if (!in_array($auth_second_factor_type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'auth_second_factor_type', must be one of '%s'", + "Invalid value '%s' for 'auth_second_factor_type', must be one of '%s'", + $auth_second_factor_type, implode("', '", $allowedValues) ) ); @@ -431,25 +551,35 @@ public function setAuthSecondFactorType($auth_second_factor_type) } /** - * Gets auth_phone_number_hash + * Gets auth_session_id_hash * * @return string|null */ - public function getAuthPhoneNumberHash() + public function getAuthSessionIdHash() { - return $this->container['auth_phone_number_hash']; + return $this->container['auth_session_id_hash']; } /** - * Sets auth_phone_number_hash + * Sets auth_session_id_hash * - * @param string|null $auth_phone_number_hash auth_phone_number_hash + * @param string|null $auth_session_id_hash auth_session_id_hash * - * @return $this + * @return self */ - public function setAuthPhoneNumberHash($auth_phone_number_hash) + public function setAuthSessionIdHash($auth_session_id_hash) { - $this->container['auth_phone_number_hash'] = $auth_phone_number_hash; + if (is_null($auth_session_id_hash)) { + array_push($this->openAPINullablesSetToNull, 'auth_session_id_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_session_id_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['auth_session_id_hash'] = $auth_session_id_hash; return $this; } @@ -469,59 +599,92 @@ public function getAuthSessionStartedAt() * * @param string|null $auth_session_started_at auth_session_started_at * - * @return $this + * @return self */ public function setAuthSessionStartedAt($auth_session_started_at) { + if (is_null($auth_session_started_at)) { + array_push($this->openAPINullablesSetToNull, 'auth_session_started_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_session_started_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['auth_session_started_at'] = $auth_session_started_at; return $this; } /** - * Gets auth_user_id_hash + * Gets auth_type * - * @return string|null + * @return string */ - public function getAuthUserIdHash() + public function getAuthType() { - return $this->container['auth_user_id_hash']; + return $this->container['auth_type']; } /** - * Sets auth_user_id_hash + * Sets auth_type * - * @param string|null $auth_user_id_hash auth_user_id_hash + * @param string $auth_type auth_type * - * @return $this + * @return self */ - public function setAuthUserIdHash($auth_user_id_hash) + public function setAuthType($auth_type) { - $this->container['auth_user_id_hash'] = $auth_user_id_hash; + if (is_null($auth_type)) { + throw new \InvalidArgumentException('non-nullable auth_type cannot be null'); + } + $allowedValues = $this->getAuthTypeAllowableValues(); + if (!in_array($auth_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'auth_type', must be one of '%s'", + $auth_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['auth_type'] = $auth_type; return $this; } /** - * Gets auth_session_id_hash + * Gets auth_user_id_hash * * @return string|null */ - public function getAuthSessionIdHash() + public function getAuthUserIdHash() { - return $this->container['auth_session_id_hash']; + return $this->container['auth_user_id_hash']; } /** - * Sets auth_session_id_hash + * Sets auth_user_id_hash * - * @param string|null $auth_session_id_hash auth_session_id_hash + * @param string|null $auth_user_id_hash auth_user_id_hash * - * @return $this + * @return self */ - public function setAuthSessionIdHash($auth_session_id_hash) + public function setAuthUserIdHash($auth_user_id_hash) { - $this->container['auth_session_id_hash'] = $auth_session_id_hash; + if (is_null($auth_user_id_hash)) { + array_push($this->openAPINullablesSetToNull, 'auth_user_id_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_user_id_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['auth_user_id_hash'] = $auth_user_id_hash; return $this; } @@ -541,35 +704,55 @@ public function getAuthUsernameHash() * * @param string|null $auth_username_hash auth_username_hash * - * @return $this + * @return self */ public function setAuthUsernameHash($auth_username_hash) { + if (is_null($auth_username_hash)) { + array_push($this->openAPINullablesSetToNull, 'auth_username_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_username_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['auth_username_hash'] = $auth_username_hash; return $this; } /** - * Gets name + * Gets email * - * @return string|null + * @return string */ - public function getName() + public function getEmail() { - return $this->container['name']; + return $this->container['email']; } /** - * Sets name + * Sets email * - * @param string|null $name name + * @param string $email email * - * @return $this + * @return self */ - public function setName($name) + public function setEmail($email) { - $this->container['name'] = $name; + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['email'] = $email; return $this; } @@ -589,59 +772,82 @@ public function getFields() * * @param string[]|null $fields fields * - * @return $this + * @return self */ public function setFields($fields) { + if (is_null($fields)) { + array_push($this->openAPINullablesSetToNull, 'fields'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fields', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['fields'] = $fields; return $this; } /** - * Gets auth_provider + * Gets metadata * - * @return string|null + * @return object|null */ - public function getAuthProvider() + public function getMetadata() { - return $this->container['auth_provider']; + return $this->container['metadata']; } /** - * Sets auth_provider + * Sets metadata * - * @param string|null $auth_provider auth_provider + * @param object|null $metadata metadata * - * @return $this + * @return self */ - public function setAuthProvider($auth_provider) + public function setMetadata($metadata) { - $this->container['auth_provider'] = $auth_provider; + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; return $this; } /** - * Gets email + * Gets name * * @return string|null */ - public function getEmail() + public function getName() { - return $this->container['email']; + return $this->container['name']; } /** - * Sets email + * Sets name * - * @param string|null $email email + * @param string|null $name name * - * @return $this + * @return self */ - public function setEmail($email) + public function setName($name) { - $this->container['email'] = $email; + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; return $this; } @@ -661,10 +867,13 @@ public function getOrder() * * @param int|null $order order * - * @return $this + * @return self */ public function setOrder($order) { + if (is_null($order)) { + throw new \InvalidArgumentException('non-nullable order cannot be null'); + } $this->container['order'] = $order; return $this; @@ -676,7 +885,7 @@ public function setOrder($order) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -686,22 +895,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -717,11 +927,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -734,6 +957,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/CreateSubmissionDataRequestTokenResponse.php b/lib/Model/CreateSubmissionDataRequestTokenResponse.php index 556ac3c..f580fd7 100644 --- a/lib/Model/CreateSubmissionDataRequestTokenResponse.php +++ b/lib/Model/CreateSubmissionDataRequestTokenResponse.php @@ -2,7 +2,7 @@ /** * CreateSubmissionDataRequestTokenResponse * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class CreateSubmissionDataRequestTokenResponse implements ModelInterface, ArrayAccess +class CreateSubmissionDataRequestTokenResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,22 +57,42 @@ class CreateSubmissionDataRequestTokenResponse implements ModelInterface, ArrayA * @var string[] */ protected static $openAPITypes = [ - 'errors' => 'string[]', 'status' => 'string', - 'token' => '\DocSpring\Model\CreateSubmissionDataRequestTokenResponseToken' + 'errors' => 'string[]', + 'token' => '\DocSpring\Model\DataRequestToken' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'errors' => null, 'status' => null, + 'errors' => null, 'token' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'errors' => false, + 'token' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -93,6 +113,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -100,8 +172,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'errors' => 'errors', 'status' => 'status', + 'errors' => 'errors', 'token' => 'token' ]; @@ -111,8 +183,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'errors' => 'setErrors', 'status' => 'setStatus', + 'errors' => 'setErrors', 'token' => 'setToken' ]; @@ -122,8 +194,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'errors' => 'getErrors', 'status' => 'getStatus', + 'errors' => 'getErrors', 'token' => 'getToken' ]; @@ -168,11 +240,9 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_SUCCESS = 'success'; - const STATUS_ERROR = 'error'; - + public const STATUS_SUCCESS = 'success'; + public const STATUS_ERROR = 'error'; - /** * Gets allowable values of the enum * @@ -185,7 +255,6 @@ public function getStatusAllowableValues() self::STATUS_ERROR, ]; } - /** * Associative array for storing property values @@ -202,9 +271,27 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['token'] = isset($data['token']) ? $data['token'] : null; + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('token', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -216,14 +303,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } + if ($this->container['token'] === null) { + $invalidProperties[] = "'token' can't be null"; + } return $invalidProperties; } @@ -240,58 +334,65 @@ public function valid() /** - * Gets errors + * Gets status * - * @return string[]|null + * @return string */ - public function getErrors() + public function getStatus() { - return $this->container['errors']; + return $this->container['status']; } /** - * Sets errors + * Sets status * - * @param string[]|null $errors errors + * @param string $status status * - * @return $this + * @return self */ - public function setErrors($errors) + public function setStatus($status) { - $this->container['errors'] = $errors; + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; return $this; } /** - * Gets status + * Gets errors * - * @return string|null + * @return string[]|null */ - public function getStatus() + public function getErrors() { - return $this->container['status']; + return $this->container['errors']; } /** - * Sets status + * Sets errors * - * @param string|null $status status + * @param string[]|null $errors errors * - * @return $this + * @return self */ - public function setStatus($status) + public function setErrors($errors) { - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'status', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['status'] = $status; + $this->container['errors'] = $errors; return $this; } @@ -299,7 +400,7 @@ public function setStatus($status) /** * Gets token * - * @return \DocSpring\Model\CreateSubmissionDataRequestTokenResponseToken|null + * @return \DocSpring\Model\DataRequestToken */ public function getToken() { @@ -309,12 +410,15 @@ public function getToken() /** * Sets token * - * @param \DocSpring\Model\CreateSubmissionDataRequestTokenResponseToken|null $token token + * @param \DocSpring\Model\DataRequestToken $token token * - * @return $this + * @return self */ public function setToken($token) { + if (is_null($token)) { + throw new \InvalidArgumentException('non-nullable token cannot be null'); + } $this->container['token'] = $token; return $this; @@ -326,7 +430,7 @@ public function setToken($token) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -336,22 +440,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -367,11 +472,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -384,6 +502,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/CreateSubmissionResponse.php b/lib/Model/CreateSubmissionResponse.php index 5420d62..0dbe104 100644 --- a/lib/Model/CreateSubmissionResponse.php +++ b/lib/Model/CreateSubmissionResponse.php @@ -2,7 +2,7 @@ /** * CreateSubmissionResponse * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class CreateSubmissionResponse implements ModelInterface, ArrayAccess +class CreateSubmissionResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,22 +57,42 @@ class CreateSubmissionResponse implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'submission' => '\DocSpring\Model\Submission', + 'status' => 'string', 'errors' => 'string[]', - 'status' => 'string' + 'submission' => '\DocSpring\Model\Submission' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'submission' => null, + 'status' => null, 'errors' => null, - 'status' => null + 'submission' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'errors' => false, + 'submission' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -93,6 +113,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -100,9 +172,9 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'submission' => 'submission', + 'status' => 'status', 'errors' => 'errors', - 'status' => 'status' + 'submission' => 'submission' ]; /** @@ -111,9 +183,9 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'submission' => 'setSubmission', + 'status' => 'setStatus', 'errors' => 'setErrors', - 'status' => 'setStatus' + 'submission' => 'setSubmission' ]; /** @@ -122,9 +194,9 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'submission' => 'getSubmission', + 'status' => 'getStatus', 'errors' => 'getErrors', - 'status' => 'getStatus' + 'submission' => 'getSubmission' ]; /** @@ -168,11 +240,9 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_SUCCESS = 'success'; - const STATUS_ERROR = 'error'; - + public const STATUS_SUCCESS = 'success'; + public const STATUS_ERROR = 'error'; - /** * Gets allowable values of the enum * @@ -185,7 +255,6 @@ public function getStatusAllowableValues() self::STATUS_ERROR, ]; } - /** * Associative array for storing property values @@ -202,9 +271,27 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['submission'] = isset($data['submission']) ? $data['submission'] : null; - $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('submission', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -216,14 +303,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } + if ($this->container['submission'] === null) { + $invalidProperties[] = "'submission' can't be null"; + } return $invalidProperties; } @@ -240,25 +334,38 @@ public function valid() /** - * Gets submission + * Gets status * - * @return \DocSpring\Model\Submission|null + * @return string */ - public function getSubmission() + public function getStatus() { - return $this->container['submission']; + return $this->container['status']; } /** - * Sets submission + * Sets status * - * @param \DocSpring\Model\Submission|null $submission submission + * @param string $status status * - * @return $this + * @return self */ - public function setSubmission($submission) + public function setStatus($status) { - $this->container['submission'] = $submission; + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; return $this; } @@ -278,44 +385,41 @@ public function getErrors() * * @param string[]|null $errors errors * - * @return $this + * @return self */ public function setErrors($errors) { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } $this->container['errors'] = $errors; return $this; } /** - * Gets status + * Gets submission * - * @return string|null + * @return \DocSpring\Model\Submission */ - public function getStatus() + public function getSubmission() { - return $this->container['status']; + return $this->container['submission']; } /** - * Sets status + * Sets submission * - * @param string|null $status status + * @param \DocSpring\Model\Submission $submission submission * - * @return $this + * @return self */ - public function setStatus($status) + public function setSubmission($submission) { - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'status', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($submission)) { + throw new \InvalidArgumentException('non-nullable submission cannot be null'); } - $this->container['status'] = $status; + $this->container['submission'] = $submission; return $this; } @@ -326,7 +430,7 @@ public function setStatus($status) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -336,22 +440,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -367,11 +472,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -384,6 +502,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/CreateTemplateFromUploadData.php b/lib/Model/CreateTemplateFromUploadData.php index b5fd445..1caa143 100644 --- a/lib/Model/CreateTemplateFromUploadData.php +++ b/lib/Model/CreateTemplateFromUploadData.php @@ -2,7 +2,7 @@ /** * CreateTemplateFromUploadData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class CreateTemplateFromUploadData implements ModelInterface, ArrayAccess +class CreateTemplateFromUploadData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -64,11 +64,29 @@ class CreateTemplateFromUploadData implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'template' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'template' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -89,6 +107,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -158,9 +228,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -177,7 +244,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['template'] = isset($data['template']) ? $data['template'] : null; + $this->setIfExists('template', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -222,10 +307,13 @@ public function getTemplate() * * @param \DocSpring\Model\UploadTemplateData $template template * - * @return $this + * @return self */ public function setTemplate($template) { + if (is_null($template)) { + throw new \InvalidArgumentException('non-nullable template cannot be null'); + } $this->container['template'] = $template; return $this; @@ -237,7 +325,7 @@ public function setTemplate($template) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -247,22 +335,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -278,11 +367,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -295,6 +397,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/CustomFile.php b/lib/Model/CustomFile.php deleted file mode 100644 index 4d70b46..0000000 --- a/lib/Model/CustomFile.php +++ /dev/null @@ -1,327 +0,0 @@ - 'string', - 'url' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'id' => null, - 'url' => 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', - 'url' => 'url' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', - 'url' => 'setUrl' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', - 'url' => 'getUrl' - ]; - - /** - * 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'] = isset($data['id']) ? $data['id'] : null; - $this->container['url'] = isset($data['url']) ? $data['url'] : 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 id - * - * @return $this - */ - public function setId($id) - { - $this->container['id'] = $id; - - return $this; - } - - /** - * Gets url - * - * @return string|null - */ - public function getUrl() - { - return $this->container['url']; - } - - /** - * Sets url - * - * @param string|null $url url - * - * @return $this - */ - public function setUrl($url) - { - $this->container['url'] = $url; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } -} - - diff --git a/lib/Model/CreateSubmissionDataRequestTokenResponseToken.php b/lib/Model/DataRequestToken.php similarity index 54% rename from lib/Model/CreateSubmissionDataRequestTokenResponseToken.php rename to lib/Model/DataRequestToken.php index 5bc8a5c..cbde7f3 100644 --- a/lib/Model/CreateSubmissionDataRequestTokenResponseToken.php +++ b/lib/Model/DataRequestToken.php @@ -1,8 +1,8 @@ */ -class CreateSubmissionDataRequestTokenResponseToken implements ModelInterface, ArrayAccess +class DataRequestToken implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. * * @var string */ - protected static $openAPIModelName = 'create_submission_data_request_token_response_token'; + protected static $openAPIModelName = 'data_request_token'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,9 +57,9 @@ class CreateSubmissionDataRequestTokenResponseToken implements ModelInterface, A * @var string[] */ protected static $openAPITypes = [ - 'expires_at' => 'string', 'id' => 'string', 'secret' => 'string', + 'expires_at' => 'string', 'data_request_url' => 'string' ]; @@ -67,14 +67,35 @@ class CreateSubmissionDataRequestTokenResponseToken implements ModelInterface, A * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'expires_at' => null, 'id' => null, 'secret' => null, + 'expires_at' => null, 'data_request_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'secret' => false, + 'expires_at' => false, + 'data_request_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -95,6 +116,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -102,9 +175,9 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'expires_at' => 'expires_at', 'id' => 'id', 'secret' => 'secret', + 'expires_at' => 'expires_at', 'data_request_url' => 'data_request_url' ]; @@ -114,9 +187,9 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'expires_at' => 'setExpiresAt', 'id' => 'setId', 'secret' => 'setSecret', + 'expires_at' => 'setExpiresAt', 'data_request_url' => 'setDataRequestUrl' ]; @@ -126,9 +199,9 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'expires_at' => 'getExpiresAt', 'id' => 'getId', 'secret' => 'getSecret', + 'expires_at' => 'getExpiresAt', 'data_request_url' => 'getDataRequestUrl' ]; @@ -173,9 +246,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -192,10 +262,28 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['expires_at'] = isset($data['expires_at']) ? $data['expires_at'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['secret'] = isset($data['secret']) ? $data['secret'] : null; - $this->container['data_request_url'] = isset($data['data_request_url']) ? $data['data_request_url'] : null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('secret', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + $this->setIfExists('data_request_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -207,6 +295,18 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['secret'] === null) { + $invalidProperties[] = "'secret' can't be null"; + } + if ($this->container['expires_at'] === null) { + $invalidProperties[] = "'expires_at' can't be null"; + } + if ($this->container['data_request_url'] === null) { + $invalidProperties[] = "'data_request_url' can't be null"; + } return $invalidProperties; } @@ -223,73 +323,82 @@ public function valid() /** - * Gets expires_at + * Gets id * - * @return string|null + * @return string */ - public function getExpiresAt() + public function getId() { - return $this->container['expires_at']; + return $this->container['id']; } /** - * Sets expires_at + * Sets id * - * @param string|null $expires_at expires_at + * @param string $id id * - * @return $this + * @return self */ - public function setExpiresAt($expires_at) + public function setId($id) { - $this->container['expires_at'] = $expires_at; + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; return $this; } /** - * Gets id + * Gets secret * - * @return string|null + * @return string */ - public function getId() + public function getSecret() { - return $this->container['id']; + return $this->container['secret']; } /** - * Sets id + * Sets secret * - * @param string|null $id id + * @param string $secret secret * - * @return $this + * @return self */ - public function setId($id) + public function setSecret($secret) { - $this->container['id'] = $id; + if (is_null($secret)) { + throw new \InvalidArgumentException('non-nullable secret cannot be null'); + } + $this->container['secret'] = $secret; return $this; } /** - * Gets secret + * Gets expires_at * - * @return string|null + * @return string */ - public function getSecret() + public function getExpiresAt() { - return $this->container['secret']; + return $this->container['expires_at']; } /** - * Sets secret + * Sets expires_at * - * @param string|null $secret secret + * @param string $expires_at expires_at * - * @return $this + * @return self */ - public function setSecret($secret) + public function setExpiresAt($expires_at) { - $this->container['secret'] = $secret; + if (is_null($expires_at)) { + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + } + $this->container['expires_at'] = $expires_at; return $this; } @@ -297,7 +406,7 @@ public function setSecret($secret) /** * Gets data_request_url * - * @return string|null + * @return string */ public function getDataRequestUrl() { @@ -307,12 +416,15 @@ public function getDataRequestUrl() /** * Sets data_request_url * - * @param string|null $data_request_url data_request_url + * @param string $data_request_url data_request_url * - * @return $this + * @return self */ public function setDataRequestUrl($data_request_url) { + if (is_null($data_request_url)) { + throw new \InvalidArgumentException('non-nullable data_request_url cannot be null'); + } $this->container['data_request_url'] = $data_request_url; return $this; @@ -324,7 +436,7 @@ public function setDataRequestUrl($data_request_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -334,22 +446,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -365,11 +478,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -382,6 +508,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/DeleteTemplateResponse.php b/lib/Model/DeleteTemplateResponse.php new file mode 100644 index 0000000..ffa5352 --- /dev/null +++ b/lib/Model/DeleteTemplateResponse.php @@ -0,0 +1,480 @@ + + */ +class DeleteTemplateResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'delete_template_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string', + 'errors' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'errors' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'errors' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'errors' => 'errors' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'errors' => 'setErrors' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'errors' => 'getErrors' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_SUCCESS = 'success'; + public const STATUS_ERROR = 'error'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_SUCCESS, + self::STATUS_ERROR, + ]; + } + + /** + * 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->setIfExists('status', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets errors + * + * @return string[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param string[]|null $errors errors + * + * @return self + */ + public function setErrors($errors) + { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; + + 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 + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Error.php b/lib/Model/ErrorResponse.php similarity index 59% rename from lib/Model/Error.php rename to lib/Model/ErrorResponse.php index a44cb4a..d02ceaa 100644 --- a/lib/Model/Error.php +++ b/lib/Model/ErrorResponse.php @@ -1,8 +1,8 @@ */ -class Error implements ModelInterface, ArrayAccess +class ErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. * * @var string */ - protected static $openAPIModelName = 'error'; + protected static $openAPIModelName = 'error_response'; /** * Array of property to type mappings. Used for (de)serialization @@ -65,12 +65,31 @@ class Error implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'status' => null, 'error' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'error' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -91,6 +110,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -163,10 +234,8 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_ERROR = 'error'; - + public const STATUS_ERROR = 'error'; - /** * Gets allowable values of the enum * @@ -178,7 +247,6 @@ public function getStatusAllowableValues() self::STATUS_ERROR, ]; } - /** * Associative array for storing property values @@ -195,8 +263,26 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['error'] = isset($data['error']) ? $data['error'] : null; + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('error', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -214,7 +300,8 @@ public function listInvalidProperties() $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } @@ -252,15 +339,19 @@ public function getStatus() * * @param string $status status * - * @return $this + * @return self */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $allowedValues = $this->getStatusAllowableValues(); if (!in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'status', must be one of '%s'", + "Invalid value '%s' for 'status', must be one of '%s'", + $status, implode("', '", $allowedValues) ) ); @@ -285,10 +376,13 @@ public function getError() * * @param string $error error * - * @return $this + * @return self */ public function setError($error) { + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } $this->container['error'] = $error; return $this; @@ -300,7 +394,7 @@ public function setError($error) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -310,22 +404,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -341,11 +436,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -358,6 +466,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/Folder.php b/lib/Model/Folder.php index d123f71..3ff6f40 100644 --- a/lib/Model/Folder.php +++ b/lib/Model/Folder.php @@ -2,7 +2,7 @@ /** * Folder * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class Folder implements ModelInterface, ArrayAccess +class Folder implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,24 +57,45 @@ class Folder implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'path' => 'string', - 'parent_folder_id' => 'string', + 'id' => 'string', 'name' => 'string', - 'id' => 'string' + 'path' => 'string', + 'parent_folder_id' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'path' => null, - 'parent_folder_id' => null, + 'id' => null, 'name' => null, - 'id' => null + 'path' => null, + 'parent_folder_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'path' => false, + 'parent_folder_id' => true ]; + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -95,6 +116,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -102,10 +175,10 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'path' => 'path', - 'parent_folder_id' => 'parent_folder_id', + 'id' => 'id', 'name' => 'name', - 'id' => 'id' + 'path' => 'path', + 'parent_folder_id' => 'parent_folder_id' ]; /** @@ -114,10 +187,10 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'path' => 'setPath', - 'parent_folder_id' => 'setParentFolderId', + 'id' => 'setId', 'name' => 'setName', - 'id' => 'setId' + 'path' => 'setPath', + 'parent_folder_id' => 'setParentFolderId' ]; /** @@ -126,10 +199,10 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'path' => 'getPath', - 'parent_folder_id' => 'getParentFolderId', + 'id' => 'getId', 'name' => 'getName', - 'id' => 'getId' + 'path' => 'getPath', + 'parent_folder_id' => 'getParentFolderId' ]; /** @@ -173,9 +246,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -192,10 +262,28 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['path'] = isset($data['path']) ? $data['path'] : null; - $this->container['parent_folder_id'] = isset($data['parent_folder_id']) ? $data['parent_folder_id'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('path', $data ?? [], null); + $this->setIfExists('parent_folder_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -223,97 +311,116 @@ public function valid() /** - * Gets path + * Gets id * * @return string|null */ - public function getPath() + public function getId() { - return $this->container['path']; + return $this->container['id']; } /** - * Sets path + * Sets id * - * @param string|null $path path + * @param string|null $id id * - * @return $this + * @return self */ - public function setPath($path) + public function setId($id) { - $this->container['path'] = $path; + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; return $this; } /** - * Gets parent_folder_id + * Gets name * * @return string|null */ - public function getParentFolderId() + public function getName() { - return $this->container['parent_folder_id']; + return $this->container['name']; } /** - * Sets parent_folder_id + * Sets name * - * @param string|null $parent_folder_id parent_folder_id + * @param string|null $name name * - * @return $this + * @return self */ - public function setParentFolderId($parent_folder_id) + public function setName($name) { - $this->container['parent_folder_id'] = $parent_folder_id; + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; return $this; } /** - * Gets name + * Gets path * * @return string|null */ - public function getName() + public function getPath() { - return $this->container['name']; + return $this->container['path']; } /** - * Sets name + * Sets path * - * @param string|null $name name + * @param string|null $path path * - * @return $this + * @return self */ - public function setName($name) + public function setPath($path) { - $this->container['name'] = $name; + if (is_null($path)) { + throw new \InvalidArgumentException('non-nullable path cannot be null'); + } + $this->container['path'] = $path; return $this; } /** - * Gets id + * Gets parent_folder_id * * @return string|null */ - public function getId() + public function getParentFolderId() { - return $this->container['id']; + return $this->container['parent_folder_id']; } /** - * Sets id + * Sets parent_folder_id * - * @param string|null $id id + * @param string|null $parent_folder_id parent_folder_id * - * @return $this + * @return self */ - public function setId($id) + public function setParentFolderId($parent_folder_id) { - $this->container['id'] = $id; + if (is_null($parent_folder_id)) { + array_push($this->openAPINullablesSetToNull, 'parent_folder_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('parent_folder_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['parent_folder_id'] = $parent_folder_id; return $this; } @@ -324,7 +431,7 @@ public function setId($id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -334,22 +441,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -365,11 +473,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -382,6 +503,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/FullTemplate.php b/lib/Model/FullTemplate.php index 96f1185..02001b9 100644 --- a/lib/Model/FullTemplate.php +++ b/lib/Model/FullTemplate.php @@ -2,7 +2,7 @@ /** * FullTemplate * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class FullTemplate implements ModelInterface, ArrayAccess +class FullTemplate implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,94 +57,150 @@ class FullTemplate implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'document_processed' => 'bool', - 'expiration_interval' => 'string', - 'scss' => 'string', - 'document_state' => 'string', - 'expire_after' => 'float', + 'name' => 'string', 'description' => 'string', - 'slack_webhook_url' => 'string', - 'demo' => 'bool', - 'path' => 'string', - 'header_html' => 'string', 'public_web_form' => 'bool', - 'field_order' => 'float[][]', - 'permanent_document_url' => 'string', - 'html' => 'string', - 'template_type' => 'string', - 'id' => 'string', - 'page_dimensions' => 'float[][]', + 'public_submissions' => 'bool', + 'expire_submissions' => 'bool', + 'expire_after' => 'float', + 'expiration_interval' => 'string', + 'allow_additional_properties' => 'bool', + 'editable_submissions' => 'bool', 'locked' => 'bool', - 'page_count' => 'float', - 'encrypt_pdfs' => 'bool', 'webhook_url' => 'string', - 'embed_domains' => 'string[]', - 'parent_folder_id' => 'string', - 'allow_additional_properties' => 'bool', - 'encrypt_pdfs_password' => 'string', - 'public_submissions' => 'bool', - 'shared_field_data' => 'object', - 'document_md5' => 'string', + 'slack_webhook_url' => 'string', + 'redirect_url' => 'string', 'first_template' => 'bool', - 'defaults' => '\DocSpring\Model\FullTemplateDefaults', - 'editable_submissions' => 'bool', - 'expire_submissions' => 'bool', - 'name' => 'string', + 'html' => 'string', + 'header_html' => 'string', 'footer_html' => 'string', - 'document_parse_error' => 'bool', + 'scss' => 'string', + 'encrypt_pdfs' => 'bool', + 'encrypt_pdfs_password' => 'string', + 'defaults' => '\DocSpring\Model\TemplateDefaults', 'fields' => 'object', + 'shared_field_data' => 'object', + 'field_order' => 'float[][]', + 'document_md5' => 'string', 'document_filename' => 'string', - 'redirect_url' => 'string', - 'document_url' => 'string' + 'document_parse_error' => 'bool', + 'document_state' => 'string', + 'embed_domains' => 'string[]', + 'page_count' => 'float', + 'document_processed' => 'bool', + 'demo' => 'bool', + 'id' => 'string', + 'template_type' => 'string', + 'page_dimensions' => 'float[][]', + 'document_url' => 'string', + 'permanent_document_url' => 'string', + 'path' => 'string', + 'parent_folder_id' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'document_processed' => null, - 'expiration_interval' => null, - 'scss' => null, - 'document_state' => null, - 'expire_after' => null, + 'name' => null, 'description' => null, - 'slack_webhook_url' => null, - 'demo' => null, - 'path' => null, - 'header_html' => null, 'public_web_form' => null, - 'field_order' => null, - 'permanent_document_url' => null, - 'html' => null, - 'template_type' => null, - 'id' => null, - 'page_dimensions' => null, + 'public_submissions' => null, + 'expire_submissions' => null, + 'expire_after' => null, + 'expiration_interval' => null, + 'allow_additional_properties' => null, + 'editable_submissions' => null, 'locked' => null, - 'page_count' => null, - 'encrypt_pdfs' => null, 'webhook_url' => null, - 'embed_domains' => null, - 'parent_folder_id' => null, - 'allow_additional_properties' => null, - 'encrypt_pdfs_password' => null, - 'public_submissions' => null, - 'shared_field_data' => null, - 'document_md5' => null, + 'slack_webhook_url' => null, + 'redirect_url' => null, 'first_template' => null, - 'defaults' => null, - 'editable_submissions' => null, - 'expire_submissions' => null, - 'name' => null, + 'html' => null, + 'header_html' => null, 'footer_html' => null, - 'document_parse_error' => null, + 'scss' => null, + 'encrypt_pdfs' => null, + 'encrypt_pdfs_password' => null, + 'defaults' => null, 'fields' => null, + 'shared_field_data' => null, + 'field_order' => null, + 'document_md5' => null, 'document_filename' => null, - 'redirect_url' => null, - 'document_url' => null + 'document_parse_error' => null, + 'document_state' => null, + 'embed_domains' => null, + 'page_count' => null, + 'document_processed' => null, + 'demo' => null, + 'id' => null, + 'template_type' => null, + 'page_dimensions' => null, + 'document_url' => null, + 'permanent_document_url' => null, + 'path' => null, + 'parent_folder_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => true, + 'description' => true, + 'public_web_form' => false, + 'public_submissions' => false, + 'expire_submissions' => false, + 'expire_after' => false, + 'expiration_interval' => false, + 'allow_additional_properties' => false, + 'editable_submissions' => false, + 'locked' => false, + 'webhook_url' => true, + 'slack_webhook_url' => true, + 'redirect_url' => true, + 'first_template' => false, + 'html' => true, + 'header_html' => true, + 'footer_html' => true, + 'scss' => true, + 'encrypt_pdfs' => false, + 'encrypt_pdfs_password' => true, + 'defaults' => false, + 'fields' => false, + 'shared_field_data' => false, + 'field_order' => false, + 'document_md5' => true, + 'document_filename' => true, + 'document_parse_error' => false, + 'document_state' => false, + 'embed_domains' => true, + 'page_count' => false, + 'document_processed' => false, + 'demo' => false, + 'id' => false, + 'template_type' => false, + 'page_dimensions' => true, + 'document_url' => true, + 'permanent_document_url' => true, + 'path' => false, + 'parent_folder_id' => true ]; + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -165,6 +221,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -172,45 +280,45 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'document_processed' => 'document_processed', - 'expiration_interval' => 'expiration_interval', - 'scss' => 'scss', - 'document_state' => 'document_state', - 'expire_after' => 'expire_after', + 'name' => 'name', 'description' => 'description', - 'slack_webhook_url' => 'slack_webhook_url', - 'demo' => 'demo', - 'path' => 'path', - 'header_html' => 'header_html', 'public_web_form' => 'public_web_form', - 'field_order' => 'field_order', - 'permanent_document_url' => 'permanent_document_url', - 'html' => 'html', - 'template_type' => 'template_type', - 'id' => 'id', - 'page_dimensions' => 'page_dimensions', + 'public_submissions' => 'public_submissions', + 'expire_submissions' => 'expire_submissions', + 'expire_after' => 'expire_after', + 'expiration_interval' => 'expiration_interval', + 'allow_additional_properties' => 'allow_additional_properties', + 'editable_submissions' => 'editable_submissions', 'locked' => 'locked', - 'page_count' => 'page_count', - 'encrypt_pdfs' => 'encrypt_pdfs', 'webhook_url' => 'webhook_url', - 'embed_domains' => 'embed_domains', - 'parent_folder_id' => 'parent_folder_id', - 'allow_additional_properties' => 'allow_additional_properties', - 'encrypt_pdfs_password' => 'encrypt_pdfs_password', - 'public_submissions' => 'public_submissions', - 'shared_field_data' => 'shared_field_data', - 'document_md5' => 'document_md5', + 'slack_webhook_url' => 'slack_webhook_url', + 'redirect_url' => 'redirect_url', 'first_template' => 'first_template', - 'defaults' => 'defaults', - 'editable_submissions' => 'editable_submissions', - 'expire_submissions' => 'expire_submissions', - 'name' => 'name', + 'html' => 'html', + 'header_html' => 'header_html', 'footer_html' => 'footer_html', - 'document_parse_error' => 'document_parse_error', + 'scss' => 'scss', + 'encrypt_pdfs' => 'encrypt_pdfs', + 'encrypt_pdfs_password' => 'encrypt_pdfs_password', + 'defaults' => 'defaults', 'fields' => 'fields', + 'shared_field_data' => 'shared_field_data', + 'field_order' => 'field_order', + 'document_md5' => 'document_md5', 'document_filename' => 'document_filename', - 'redirect_url' => 'redirect_url', - 'document_url' => 'document_url' + 'document_parse_error' => 'document_parse_error', + 'document_state' => 'document_state', + 'embed_domains' => 'embed_domains', + 'page_count' => 'page_count', + 'document_processed' => 'document_processed', + 'demo' => 'demo', + 'id' => 'id', + 'template_type' => 'template_type', + 'page_dimensions' => 'page_dimensions', + 'document_url' => 'document_url', + 'permanent_document_url' => 'permanent_document_url', + 'path' => 'path', + 'parent_folder_id' => 'parent_folder_id' ]; /** @@ -219,45 +327,45 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'document_processed' => 'setDocumentProcessed', - 'expiration_interval' => 'setExpirationInterval', - 'scss' => 'setScss', - 'document_state' => 'setDocumentState', - 'expire_after' => 'setExpireAfter', + 'name' => 'setName', 'description' => 'setDescription', - 'slack_webhook_url' => 'setSlackWebhookUrl', - 'demo' => 'setDemo', - 'path' => 'setPath', - 'header_html' => 'setHeaderHtml', 'public_web_form' => 'setPublicWebForm', - 'field_order' => 'setFieldOrder', - 'permanent_document_url' => 'setPermanentDocumentUrl', - 'html' => 'setHtml', - 'template_type' => 'setTemplateType', - 'id' => 'setId', - 'page_dimensions' => 'setPageDimensions', + 'public_submissions' => 'setPublicSubmissions', + 'expire_submissions' => 'setExpireSubmissions', + 'expire_after' => 'setExpireAfter', + 'expiration_interval' => 'setExpirationInterval', + 'allow_additional_properties' => 'setAllowAdditionalProperties', + 'editable_submissions' => 'setEditableSubmissions', 'locked' => 'setLocked', - 'page_count' => 'setPageCount', - 'encrypt_pdfs' => 'setEncryptPdfs', 'webhook_url' => 'setWebhookUrl', - 'embed_domains' => 'setEmbedDomains', - 'parent_folder_id' => 'setParentFolderId', - 'allow_additional_properties' => 'setAllowAdditionalProperties', - 'encrypt_pdfs_password' => 'setEncryptPdfsPassword', - 'public_submissions' => 'setPublicSubmissions', - 'shared_field_data' => 'setSharedFieldData', - 'document_md5' => 'setDocumentMd5', + 'slack_webhook_url' => 'setSlackWebhookUrl', + 'redirect_url' => 'setRedirectUrl', 'first_template' => 'setFirstTemplate', - 'defaults' => 'setDefaults', - 'editable_submissions' => 'setEditableSubmissions', - 'expire_submissions' => 'setExpireSubmissions', - 'name' => 'setName', + 'html' => 'setHtml', + 'header_html' => 'setHeaderHtml', 'footer_html' => 'setFooterHtml', - 'document_parse_error' => 'setDocumentParseError', + 'scss' => 'setScss', + 'encrypt_pdfs' => 'setEncryptPdfs', + 'encrypt_pdfs_password' => 'setEncryptPdfsPassword', + 'defaults' => 'setDefaults', 'fields' => 'setFields', + 'shared_field_data' => 'setSharedFieldData', + 'field_order' => 'setFieldOrder', + 'document_md5' => 'setDocumentMd5', 'document_filename' => 'setDocumentFilename', - 'redirect_url' => 'setRedirectUrl', - 'document_url' => 'setDocumentUrl' + 'document_parse_error' => 'setDocumentParseError', + 'document_state' => 'setDocumentState', + 'embed_domains' => 'setEmbedDomains', + 'page_count' => 'setPageCount', + 'document_processed' => 'setDocumentProcessed', + 'demo' => 'setDemo', + 'id' => 'setId', + 'template_type' => 'setTemplateType', + 'page_dimensions' => 'setPageDimensions', + 'document_url' => 'setDocumentUrl', + 'permanent_document_url' => 'setPermanentDocumentUrl', + 'path' => 'setPath', + 'parent_folder_id' => 'setParentFolderId' ]; /** @@ -266,45 +374,45 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'document_processed' => 'getDocumentProcessed', - 'expiration_interval' => 'getExpirationInterval', - 'scss' => 'getScss', - 'document_state' => 'getDocumentState', - 'expire_after' => 'getExpireAfter', + 'name' => 'getName', 'description' => 'getDescription', - 'slack_webhook_url' => 'getSlackWebhookUrl', - 'demo' => 'getDemo', - 'path' => 'getPath', - 'header_html' => 'getHeaderHtml', 'public_web_form' => 'getPublicWebForm', - 'field_order' => 'getFieldOrder', - 'permanent_document_url' => 'getPermanentDocumentUrl', - 'html' => 'getHtml', - 'template_type' => 'getTemplateType', - 'id' => 'getId', - 'page_dimensions' => 'getPageDimensions', + 'public_submissions' => 'getPublicSubmissions', + 'expire_submissions' => 'getExpireSubmissions', + 'expire_after' => 'getExpireAfter', + 'expiration_interval' => 'getExpirationInterval', + 'allow_additional_properties' => 'getAllowAdditionalProperties', + 'editable_submissions' => 'getEditableSubmissions', 'locked' => 'getLocked', - 'page_count' => 'getPageCount', - 'encrypt_pdfs' => 'getEncryptPdfs', 'webhook_url' => 'getWebhookUrl', - 'embed_domains' => 'getEmbedDomains', - 'parent_folder_id' => 'getParentFolderId', - 'allow_additional_properties' => 'getAllowAdditionalProperties', - 'encrypt_pdfs_password' => 'getEncryptPdfsPassword', - 'public_submissions' => 'getPublicSubmissions', - 'shared_field_data' => 'getSharedFieldData', - 'document_md5' => 'getDocumentMd5', + 'slack_webhook_url' => 'getSlackWebhookUrl', + 'redirect_url' => 'getRedirectUrl', 'first_template' => 'getFirstTemplate', - 'defaults' => 'getDefaults', - 'editable_submissions' => 'getEditableSubmissions', - 'expire_submissions' => 'getExpireSubmissions', - 'name' => 'getName', + 'html' => 'getHtml', + 'header_html' => 'getHeaderHtml', 'footer_html' => 'getFooterHtml', - 'document_parse_error' => 'getDocumentParseError', + 'scss' => 'getScss', + 'encrypt_pdfs' => 'getEncryptPdfs', + 'encrypt_pdfs_password' => 'getEncryptPdfsPassword', + 'defaults' => 'getDefaults', 'fields' => 'getFields', + 'shared_field_data' => 'getSharedFieldData', + 'field_order' => 'getFieldOrder', + 'document_md5' => 'getDocumentMd5', 'document_filename' => 'getDocumentFilename', - 'redirect_url' => 'getRedirectUrl', - 'document_url' => 'getDocumentUrl' + 'document_parse_error' => 'getDocumentParseError', + 'document_state' => 'getDocumentState', + 'embed_domains' => 'getEmbedDomains', + 'page_count' => 'getPageCount', + 'document_processed' => 'getDocumentProcessed', + 'demo' => 'getDemo', + 'id' => 'getId', + 'template_type' => 'getTemplateType', + 'page_dimensions' => 'getPageDimensions', + 'document_url' => 'getDocumentUrl', + 'permanent_document_url' => 'getPermanentDocumentUrl', + 'path' => 'getPath', + 'parent_folder_id' => 'getParentFolderId' ]; /** @@ -348,12 +456,10 @@ public function getModelName() return self::$openAPIModelName; } - const EXPIRATION_INTERVAL_MINUTES = 'minutes'; - const EXPIRATION_INTERVAL_HOURS = 'hours'; - const EXPIRATION_INTERVAL_DAYS = 'days'; - + public const EXPIRATION_INTERVAL_MINUTES = 'minutes'; + public const EXPIRATION_INTERVAL_HOURS = 'hours'; + public const EXPIRATION_INTERVAL_DAYS = 'days'; - /** * Gets allowable values of the enum * @@ -367,7 +473,6 @@ public function getExpirationIntervalAllowableValues() self::EXPIRATION_INTERVAL_DAYS, ]; } - /** * Associative array for storing property values @@ -384,45 +489,63 @@ public function getExpirationIntervalAllowableValues() */ public function __construct(array $data = null) { - $this->container['document_processed'] = isset($data['document_processed']) ? $data['document_processed'] : null; - $this->container['expiration_interval'] = isset($data['expiration_interval']) ? $data['expiration_interval'] : null; - $this->container['scss'] = isset($data['scss']) ? $data['scss'] : null; - $this->container['document_state'] = isset($data['document_state']) ? $data['document_state'] : null; - $this->container['expire_after'] = isset($data['expire_after']) ? $data['expire_after'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['slack_webhook_url'] = isset($data['slack_webhook_url']) ? $data['slack_webhook_url'] : null; - $this->container['demo'] = isset($data['demo']) ? $data['demo'] : null; - $this->container['path'] = isset($data['path']) ? $data['path'] : null; - $this->container['header_html'] = isset($data['header_html']) ? $data['header_html'] : null; - $this->container['public_web_form'] = isset($data['public_web_form']) ? $data['public_web_form'] : null; - $this->container['field_order'] = isset($data['field_order']) ? $data['field_order'] : null; - $this->container['permanent_document_url'] = isset($data['permanent_document_url']) ? $data['permanent_document_url'] : null; - $this->container['html'] = isset($data['html']) ? $data['html'] : null; - $this->container['template_type'] = isset($data['template_type']) ? $data['template_type'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['page_dimensions'] = isset($data['page_dimensions']) ? $data['page_dimensions'] : null; - $this->container['locked'] = isset($data['locked']) ? $data['locked'] : null; - $this->container['page_count'] = isset($data['page_count']) ? $data['page_count'] : null; - $this->container['encrypt_pdfs'] = isset($data['encrypt_pdfs']) ? $data['encrypt_pdfs'] : null; - $this->container['webhook_url'] = isset($data['webhook_url']) ? $data['webhook_url'] : null; - $this->container['embed_domains'] = isset($data['embed_domains']) ? $data['embed_domains'] : null; - $this->container['parent_folder_id'] = isset($data['parent_folder_id']) ? $data['parent_folder_id'] : null; - $this->container['allow_additional_properties'] = isset($data['allow_additional_properties']) ? $data['allow_additional_properties'] : null; - $this->container['encrypt_pdfs_password'] = isset($data['encrypt_pdfs_password']) ? $data['encrypt_pdfs_password'] : null; - $this->container['public_submissions'] = isset($data['public_submissions']) ? $data['public_submissions'] : null; - $this->container['shared_field_data'] = isset($data['shared_field_data']) ? $data['shared_field_data'] : null; - $this->container['document_md5'] = isset($data['document_md5']) ? $data['document_md5'] : null; - $this->container['first_template'] = isset($data['first_template']) ? $data['first_template'] : null; - $this->container['defaults'] = isset($data['defaults']) ? $data['defaults'] : null; - $this->container['editable_submissions'] = isset($data['editable_submissions']) ? $data['editable_submissions'] : null; - $this->container['expire_submissions'] = isset($data['expire_submissions']) ? $data['expire_submissions'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['footer_html'] = isset($data['footer_html']) ? $data['footer_html'] : null; - $this->container['document_parse_error'] = isset($data['document_parse_error']) ? $data['document_parse_error'] : null; - $this->container['fields'] = isset($data['fields']) ? $data['fields'] : null; - $this->container['document_filename'] = isset($data['document_filename']) ? $data['document_filename'] : null; - $this->container['redirect_url'] = isset($data['redirect_url']) ? $data['redirect_url'] : null; - $this->container['document_url'] = isset($data['document_url']) ? $data['document_url'] : null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('public_web_form', $data ?? [], null); + $this->setIfExists('public_submissions', $data ?? [], null); + $this->setIfExists('expire_submissions', $data ?? [], null); + $this->setIfExists('expire_after', $data ?? [], null); + $this->setIfExists('expiration_interval', $data ?? [], null); + $this->setIfExists('allow_additional_properties', $data ?? [], null); + $this->setIfExists('editable_submissions', $data ?? [], null); + $this->setIfExists('locked', $data ?? [], null); + $this->setIfExists('webhook_url', $data ?? [], null); + $this->setIfExists('slack_webhook_url', $data ?? [], null); + $this->setIfExists('redirect_url', $data ?? [], null); + $this->setIfExists('first_template', $data ?? [], null); + $this->setIfExists('html', $data ?? [], null); + $this->setIfExists('header_html', $data ?? [], null); + $this->setIfExists('footer_html', $data ?? [], null); + $this->setIfExists('scss', $data ?? [], null); + $this->setIfExists('encrypt_pdfs', $data ?? [], null); + $this->setIfExists('encrypt_pdfs_password', $data ?? [], null); + $this->setIfExists('defaults', $data ?? [], null); + $this->setIfExists('fields', $data ?? [], null); + $this->setIfExists('shared_field_data', $data ?? [], null); + $this->setIfExists('field_order', $data ?? [], null); + $this->setIfExists('document_md5', $data ?? [], null); + $this->setIfExists('document_filename', $data ?? [], null); + $this->setIfExists('document_parse_error', $data ?? [], null); + $this->setIfExists('document_state', $data ?? [], null); + $this->setIfExists('embed_domains', $data ?? [], null); + $this->setIfExists('page_count', $data ?? [], null); + $this->setIfExists('document_processed', $data ?? [], null); + $this->setIfExists('demo', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('template_type', $data ?? [], null); + $this->setIfExists('page_dimensions', $data ?? [], null); + $this->setIfExists('document_url', $data ?? [], null); + $this->setIfExists('permanent_document_url', $data ?? [], null); + $this->setIfExists('path', $data ?? [], null); + $this->setIfExists('parent_folder_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -434,14 +557,132 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['public_web_form'] === null) { + $invalidProperties[] = "'public_web_form' can't be null"; + } + if ($this->container['public_submissions'] === null) { + $invalidProperties[] = "'public_submissions' can't be null"; + } + if ($this->container['expire_submissions'] === null) { + $invalidProperties[] = "'expire_submissions' can't be null"; + } + if ($this->container['expire_after'] === null) { + $invalidProperties[] = "'expire_after' can't be null"; + } + if ($this->container['expiration_interval'] === null) { + $invalidProperties[] = "'expiration_interval' can't be null"; + } $allowedValues = $this->getExpirationIntervalAllowableValues(); if (!is_null($this->container['expiration_interval']) && !in_array($this->container['expiration_interval'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'expiration_interval', must be one of '%s'", + "invalid value '%s' for 'expiration_interval', must be one of '%s'", + $this->container['expiration_interval'], implode("', '", $allowedValues) ); } + if ($this->container['allow_additional_properties'] === null) { + $invalidProperties[] = "'allow_additional_properties' can't be null"; + } + if ($this->container['editable_submissions'] === null) { + $invalidProperties[] = "'editable_submissions' can't be null"; + } + if ($this->container['locked'] === null) { + $invalidProperties[] = "'locked' can't be null"; + } + if ($this->container['webhook_url'] === null) { + $invalidProperties[] = "'webhook_url' can't be null"; + } + if ($this->container['slack_webhook_url'] === null) { + $invalidProperties[] = "'slack_webhook_url' can't be null"; + } + if ($this->container['redirect_url'] === null) { + $invalidProperties[] = "'redirect_url' can't be null"; + } + if ($this->container['first_template'] === null) { + $invalidProperties[] = "'first_template' can't be null"; + } + if ($this->container['html'] === null) { + $invalidProperties[] = "'html' can't be null"; + } + if ($this->container['header_html'] === null) { + $invalidProperties[] = "'header_html' can't be null"; + } + if ($this->container['footer_html'] === null) { + $invalidProperties[] = "'footer_html' can't be null"; + } + if ($this->container['scss'] === null) { + $invalidProperties[] = "'scss' can't be null"; + } + if ($this->container['encrypt_pdfs'] === null) { + $invalidProperties[] = "'encrypt_pdfs' can't be null"; + } + if ($this->container['encrypt_pdfs_password'] === null) { + $invalidProperties[] = "'encrypt_pdfs_password' can't be null"; + } + if ($this->container['defaults'] === null) { + $invalidProperties[] = "'defaults' can't be null"; + } + if ($this->container['fields'] === null) { + $invalidProperties[] = "'fields' can't be null"; + } + if ($this->container['shared_field_data'] === null) { + $invalidProperties[] = "'shared_field_data' can't be null"; + } + if ($this->container['field_order'] === null) { + $invalidProperties[] = "'field_order' can't be null"; + } + if ($this->container['document_md5'] === null) { + $invalidProperties[] = "'document_md5' can't be null"; + } + if ($this->container['document_filename'] === null) { + $invalidProperties[] = "'document_filename' can't be null"; + } + if ($this->container['document_parse_error'] === null) { + $invalidProperties[] = "'document_parse_error' can't be null"; + } + if ($this->container['document_state'] === null) { + $invalidProperties[] = "'document_state' can't be null"; + } + if ($this->container['embed_domains'] === null) { + $invalidProperties[] = "'embed_domains' can't be null"; + } + if ($this->container['page_count'] === null) { + $invalidProperties[] = "'page_count' can't be null"; + } + if ($this->container['document_processed'] === null) { + $invalidProperties[] = "'document_processed' can't be null"; + } + if ($this->container['demo'] === null) { + $invalidProperties[] = "'demo' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['template_type'] === null) { + $invalidProperties[] = "'template_type' can't be null"; + } + if ($this->container['page_dimensions'] === null) { + $invalidProperties[] = "'page_dimensions' can't be null"; + } + if ($this->container['document_url'] === null) { + $invalidProperties[] = "'document_url' can't be null"; + } + if ($this->container['permanent_document_url'] === null) { + $invalidProperties[] = "'permanent_document_url' can't be null"; + } + if ($this->container['path'] === null) { + $invalidProperties[] = "'path' can't be null"; + } + if ($this->container['parent_folder_id'] === null) { + $invalidProperties[] = "'parent_folder_id' can't be null"; + } return $invalidProperties; } @@ -458,106 +699,150 @@ public function valid() /** - * Gets document_processed + * Gets name * - * @return bool|null + * @return string */ - public function getDocumentProcessed() + public function getName() { - return $this->container['document_processed']; + return $this->container['name']; } /** - * Sets document_processed + * Sets name * - * @param bool|null $document_processed document_processed + * @param string $name name * - * @return $this + * @return self */ - public function setDocumentProcessed($document_processed) + public function setName($name) { - $this->container['document_processed'] = $document_processed; + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; return $this; } /** - * Gets expiration_interval + * Gets description * - * @return string|null + * @return string */ - public function getExpirationInterval() + public function getDescription() { - return $this->container['expiration_interval']; + return $this->container['description']; } /** - * Sets expiration_interval + * Sets description * - * @param string|null $expiration_interval expiration_interval + * @param string $description description * - * @return $this + * @return self */ - public function setExpirationInterval($expiration_interval) + public function setDescription($description) { - $allowedValues = $this->getExpirationIntervalAllowableValues(); - if (!is_null($expiration_interval) && !in_array($expiration_interval, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'expiration_interval', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['expiration_interval'] = $expiration_interval; + $this->container['description'] = $description; return $this; } /** - * Gets scss + * Gets public_web_form * - * @return string|null + * @return bool */ - public function getScss() + public function getPublicWebForm() { - return $this->container['scss']; + return $this->container['public_web_form']; } /** - * Sets scss + * Sets public_web_form + * + * @param bool $public_web_form public_web_form + * + * @return self + */ + public function setPublicWebForm($public_web_form) + { + if (is_null($public_web_form)) { + throw new \InvalidArgumentException('non-nullable public_web_form cannot be null'); + } + $this->container['public_web_form'] = $public_web_form; + + return $this; + } + + /** + * Gets public_submissions + * + * @return bool + */ + public function getPublicSubmissions() + { + return $this->container['public_submissions']; + } + + /** + * Sets public_submissions * - * @param string|null $scss scss + * @param bool $public_submissions public_submissions * - * @return $this + * @return self */ - public function setScss($scss) + public function setPublicSubmissions($public_submissions) { - $this->container['scss'] = $scss; + if (is_null($public_submissions)) { + throw new \InvalidArgumentException('non-nullable public_submissions cannot be null'); + } + $this->container['public_submissions'] = $public_submissions; return $this; } /** - * Gets document_state + * Gets expire_submissions * - * @return string|null + * @return bool */ - public function getDocumentState() + public function getExpireSubmissions() { - return $this->container['document_state']; + return $this->container['expire_submissions']; } /** - * Sets document_state + * Sets expire_submissions * - * @param string|null $document_state document_state + * @param bool $expire_submissions expire_submissions * - * @return $this + * @return self */ - public function setDocumentState($document_state) + public function setExpireSubmissions($expire_submissions) { - $this->container['document_state'] = $document_state; + if (is_null($expire_submissions)) { + throw new \InvalidArgumentException('non-nullable expire_submissions cannot be null'); + } + $this->container['expire_submissions'] = $expire_submissions; return $this; } @@ -565,7 +850,7 @@ public function setDocumentState($document_state) /** * Gets expire_after * - * @return float|null + * @return float */ public function getExpireAfter() { @@ -575,205 +860,263 @@ public function getExpireAfter() /** * Sets expire_after * - * @param float|null $expire_after expire_after + * @param float $expire_after expire_after * - * @return $this + * @return self */ public function setExpireAfter($expire_after) { + if (is_null($expire_after)) { + throw new \InvalidArgumentException('non-nullable expire_after cannot be null'); + } $this->container['expire_after'] = $expire_after; return $this; } /** - * Gets description + * Gets expiration_interval * - * @return string|null + * @return string */ - public function getDescription() + public function getExpirationInterval() { - return $this->container['description']; + return $this->container['expiration_interval']; } /** - * Sets description + * Sets expiration_interval * - * @param string|null $description description + * @param string $expiration_interval expiration_interval * - * @return $this + * @return self */ - public function setDescription($description) + public function setExpirationInterval($expiration_interval) { - $this->container['description'] = $description; + if (is_null($expiration_interval)) { + throw new \InvalidArgumentException('non-nullable expiration_interval cannot be null'); + } + $allowedValues = $this->getExpirationIntervalAllowableValues(); + if (!in_array($expiration_interval, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'expiration_interval', must be one of '%s'", + $expiration_interval, + implode("', '", $allowedValues) + ) + ); + } + $this->container['expiration_interval'] = $expiration_interval; return $this; } /** - * Gets slack_webhook_url + * Gets allow_additional_properties * - * @return string|null + * @return bool */ - public function getSlackWebhookUrl() + public function getAllowAdditionalProperties() { - return $this->container['slack_webhook_url']; + return $this->container['allow_additional_properties']; } /** - * Sets slack_webhook_url + * Sets allow_additional_properties * - * @param string|null $slack_webhook_url slack_webhook_url + * @param bool $allow_additional_properties allow_additional_properties * - * @return $this + * @return self */ - public function setSlackWebhookUrl($slack_webhook_url) + public function setAllowAdditionalProperties($allow_additional_properties) { - $this->container['slack_webhook_url'] = $slack_webhook_url; + if (is_null($allow_additional_properties)) { + throw new \InvalidArgumentException('non-nullable allow_additional_properties cannot be null'); + } + $this->container['allow_additional_properties'] = $allow_additional_properties; return $this; } /** - * Gets demo + * Gets editable_submissions * - * @return bool|null + * @return bool */ - public function getDemo() + public function getEditableSubmissions() { - return $this->container['demo']; + return $this->container['editable_submissions']; } /** - * Sets demo + * Sets editable_submissions * - * @param bool|null $demo demo + * @param bool $editable_submissions editable_submissions * - * @return $this + * @return self */ - public function setDemo($demo) + public function setEditableSubmissions($editable_submissions) { - $this->container['demo'] = $demo; + if (is_null($editable_submissions)) { + throw new \InvalidArgumentException('non-nullable editable_submissions cannot be null'); + } + $this->container['editable_submissions'] = $editable_submissions; return $this; } /** - * Gets path + * Gets locked * - * @return string|null + * @return bool */ - public function getPath() + public function getLocked() { - return $this->container['path']; + return $this->container['locked']; } /** - * Sets path + * Sets locked * - * @param string|null $path path + * @param bool $locked locked * - * @return $this + * @return self */ - public function setPath($path) + public function setLocked($locked) { - $this->container['path'] = $path; + if (is_null($locked)) { + throw new \InvalidArgumentException('non-nullable locked cannot be null'); + } + $this->container['locked'] = $locked; return $this; } /** - * Gets header_html + * Gets webhook_url * - * @return string|null + * @return string */ - public function getHeaderHtml() + public function getWebhookUrl() { - return $this->container['header_html']; + return $this->container['webhook_url']; } /** - * Sets header_html + * Sets webhook_url * - * @param string|null $header_html header_html + * @param string $webhook_url webhook_url * - * @return $this + * @return self */ - public function setHeaderHtml($header_html) + public function setWebhookUrl($webhook_url) { - $this->container['header_html'] = $header_html; + if (is_null($webhook_url)) { + array_push($this->openAPINullablesSetToNull, 'webhook_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('webhook_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['webhook_url'] = $webhook_url; return $this; } /** - * Gets public_web_form + * Gets slack_webhook_url * - * @return bool|null + * @return string */ - public function getPublicWebForm() + public function getSlackWebhookUrl() { - return $this->container['public_web_form']; + return $this->container['slack_webhook_url']; } /** - * Sets public_web_form + * Sets slack_webhook_url * - * @param bool|null $public_web_form public_web_form + * @param string $slack_webhook_url slack_webhook_url * - * @return $this + * @return self */ - public function setPublicWebForm($public_web_form) + public function setSlackWebhookUrl($slack_webhook_url) { - $this->container['public_web_form'] = $public_web_form; + if (is_null($slack_webhook_url)) { + array_push($this->openAPINullablesSetToNull, 'slack_webhook_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('slack_webhook_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['slack_webhook_url'] = $slack_webhook_url; return $this; } /** - * Gets field_order + * Gets redirect_url * - * @return float[][]|null + * @return string */ - public function getFieldOrder() + public function getRedirectUrl() { - return $this->container['field_order']; + return $this->container['redirect_url']; } /** - * Sets field_order + * Sets redirect_url * - * @param float[][]|null $field_order field_order + * @param string $redirect_url redirect_url * - * @return $this + * @return self */ - public function setFieldOrder($field_order) + public function setRedirectUrl($redirect_url) { - $this->container['field_order'] = $field_order; + if (is_null($redirect_url)) { + array_push($this->openAPINullablesSetToNull, 'redirect_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('redirect_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['redirect_url'] = $redirect_url; return $this; } /** - * Gets permanent_document_url + * Gets first_template * - * @return string|null + * @return bool */ - public function getPermanentDocumentUrl() + public function getFirstTemplate() { - return $this->container['permanent_document_url']; + return $this->container['first_template']; } /** - * Sets permanent_document_url + * Sets first_template * - * @param string|null $permanent_document_url permanent_document_url + * @param bool $first_template first_template * - * @return $this + * @return self */ - public function setPermanentDocumentUrl($permanent_document_url) + public function setFirstTemplate($first_template) { - $this->container['permanent_document_url'] = $permanent_document_url; + if (is_null($first_template)) { + throw new \InvalidArgumentException('non-nullable first_template cannot be null'); + } + $this->container['first_template'] = $first_template; return $this; } @@ -781,7 +1124,7 @@ public function setPermanentDocumentUrl($permanent_document_url) /** * Gets html * - * @return string|null + * @return string */ public function getHtml() { @@ -791,613 +1134,748 @@ public function getHtml() /** * Sets html * - * @param string|null $html html + * @param string $html html * - * @return $this + * @return self */ public function setHtml($html) { + if (is_null($html)) { + array_push($this->openAPINullablesSetToNull, 'html'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('html', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['html'] = $html; return $this; } /** - * Gets template_type - * - * @return string|null - */ - public function getTemplateType() - { - return $this->container['template_type']; - } - - /** - * Sets template_type - * - * @param string|null $template_type template_type - * - * @return $this - */ - public function setTemplateType($template_type) - { - $this->container['template_type'] = $template_type; - - return $this; - } - - /** - * Gets id + * Gets header_html * - * @return string|null + * @return string */ - public function getId() + public function getHeaderHtml() { - return $this->container['id']; + return $this->container['header_html']; } /** - * Sets id + * Sets header_html * - * @param string|null $id id + * @param string $header_html header_html * - * @return $this + * @return self */ - public function setId($id) + public function setHeaderHtml($header_html) { - $this->container['id'] = $id; + if (is_null($header_html)) { + array_push($this->openAPINullablesSetToNull, 'header_html'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('header_html', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['header_html'] = $header_html; return $this; } /** - * Gets page_dimensions + * Gets footer_html * - * @return float[][]|null + * @return string */ - public function getPageDimensions() + public function getFooterHtml() { - return $this->container['page_dimensions']; + return $this->container['footer_html']; } /** - * Sets page_dimensions + * Sets footer_html * - * @param float[][]|null $page_dimensions page_dimensions + * @param string $footer_html footer_html * - * @return $this + * @return self */ - public function setPageDimensions($page_dimensions) + public function setFooterHtml($footer_html) { - $this->container['page_dimensions'] = $page_dimensions; + if (is_null($footer_html)) { + array_push($this->openAPINullablesSetToNull, 'footer_html'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('footer_html', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['footer_html'] = $footer_html; return $this; } /** - * Gets locked + * Gets scss * - * @return bool|null + * @return string */ - public function getLocked() + public function getScss() { - return $this->container['locked']; + return $this->container['scss']; } /** - * Sets locked + * Sets scss * - * @param bool|null $locked locked + * @param string $scss scss * - * @return $this + * @return self */ - public function setLocked($locked) + public function setScss($scss) { - $this->container['locked'] = $locked; + if (is_null($scss)) { + array_push($this->openAPINullablesSetToNull, 'scss'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('scss', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['scss'] = $scss; return $this; } /** - * Gets page_count + * Gets encrypt_pdfs * - * @return float|null + * @return bool */ - public function getPageCount() + public function getEncryptPdfs() { - return $this->container['page_count']; + return $this->container['encrypt_pdfs']; } /** - * Sets page_count + * Sets encrypt_pdfs * - * @param float|null $page_count page_count + * @param bool $encrypt_pdfs encrypt_pdfs * - * @return $this + * @return self */ - public function setPageCount($page_count) + public function setEncryptPdfs($encrypt_pdfs) { - $this->container['page_count'] = $page_count; + if (is_null($encrypt_pdfs)) { + throw new \InvalidArgumentException('non-nullable encrypt_pdfs cannot be null'); + } + $this->container['encrypt_pdfs'] = $encrypt_pdfs; return $this; } /** - * Gets encrypt_pdfs + * Gets encrypt_pdfs_password * - * @return bool|null + * @return string */ - public function getEncryptPdfs() + public function getEncryptPdfsPassword() { - return $this->container['encrypt_pdfs']; + return $this->container['encrypt_pdfs_password']; } /** - * Sets encrypt_pdfs + * Sets encrypt_pdfs_password * - * @param bool|null $encrypt_pdfs encrypt_pdfs + * @param string $encrypt_pdfs_password encrypt_pdfs_password * - * @return $this + * @return self */ - public function setEncryptPdfs($encrypt_pdfs) + public function setEncryptPdfsPassword($encrypt_pdfs_password) { - $this->container['encrypt_pdfs'] = $encrypt_pdfs; + if (is_null($encrypt_pdfs_password)) { + array_push($this->openAPINullablesSetToNull, 'encrypt_pdfs_password'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('encrypt_pdfs_password', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['encrypt_pdfs_password'] = $encrypt_pdfs_password; return $this; } /** - * Gets webhook_url + * Gets defaults * - * @return string|null + * @return \DocSpring\Model\TemplateDefaults */ - public function getWebhookUrl() + public function getDefaults() { - return $this->container['webhook_url']; + return $this->container['defaults']; } /** - * Sets webhook_url + * Sets defaults * - * @param string|null $webhook_url webhook_url + * @param \DocSpring\Model\TemplateDefaults $defaults defaults * - * @return $this + * @return self */ - public function setWebhookUrl($webhook_url) + public function setDefaults($defaults) { - $this->container['webhook_url'] = $webhook_url; + if (is_null($defaults)) { + throw new \InvalidArgumentException('non-nullable defaults cannot be null'); + } + $this->container['defaults'] = $defaults; return $this; } /** - * Gets embed_domains + * Gets fields * - * @return string[]|null + * @return object */ - public function getEmbedDomains() + public function getFields() { - return $this->container['embed_domains']; + return $this->container['fields']; } /** - * Sets embed_domains + * Sets fields * - * @param string[]|null $embed_domains embed_domains + * @param object $fields fields * - * @return $this + * @return self */ - public function setEmbedDomains($embed_domains) + public function setFields($fields) { - $this->container['embed_domains'] = $embed_domains; + if (is_null($fields)) { + throw new \InvalidArgumentException('non-nullable fields cannot be null'); + } + $this->container['fields'] = $fields; return $this; } /** - * Gets parent_folder_id + * Gets shared_field_data * - * @return string|null + * @return object */ - public function getParentFolderId() + public function getSharedFieldData() { - return $this->container['parent_folder_id']; + return $this->container['shared_field_data']; } /** - * Sets parent_folder_id + * Sets shared_field_data * - * @param string|null $parent_folder_id parent_folder_id + * @param object $shared_field_data shared_field_data * - * @return $this + * @return self */ - public function setParentFolderId($parent_folder_id) + public function setSharedFieldData($shared_field_data) { - $this->container['parent_folder_id'] = $parent_folder_id; + if (is_null($shared_field_data)) { + throw new \InvalidArgumentException('non-nullable shared_field_data cannot be null'); + } + $this->container['shared_field_data'] = $shared_field_data; return $this; } /** - * Gets allow_additional_properties + * Gets field_order * - * @return bool|null + * @return float[][] */ - public function getAllowAdditionalProperties() + public function getFieldOrder() { - return $this->container['allow_additional_properties']; + return $this->container['field_order']; } /** - * Sets allow_additional_properties + * Sets field_order * - * @param bool|null $allow_additional_properties allow_additional_properties + * @param float[][] $field_order field_order * - * @return $this + * @return self */ - public function setAllowAdditionalProperties($allow_additional_properties) + public function setFieldOrder($field_order) { - $this->container['allow_additional_properties'] = $allow_additional_properties; + if (is_null($field_order)) { + throw new \InvalidArgumentException('non-nullable field_order cannot be null'); + } + $this->container['field_order'] = $field_order; return $this; } /** - * Gets encrypt_pdfs_password + * Gets document_md5 * - * @return string|null + * @return string */ - public function getEncryptPdfsPassword() + public function getDocumentMd5() { - return $this->container['encrypt_pdfs_password']; + return $this->container['document_md5']; } /** - * Sets encrypt_pdfs_password + * Sets document_md5 * - * @param string|null $encrypt_pdfs_password encrypt_pdfs_password + * @param string $document_md5 document_md5 * - * @return $this + * @return self */ - public function setEncryptPdfsPassword($encrypt_pdfs_password) + public function setDocumentMd5($document_md5) { - $this->container['encrypt_pdfs_password'] = $encrypt_pdfs_password; + if (is_null($document_md5)) { + array_push($this->openAPINullablesSetToNull, 'document_md5'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('document_md5', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['document_md5'] = $document_md5; return $this; } /** - * Gets public_submissions + * Gets document_filename * - * @return bool|null + * @return string */ - public function getPublicSubmissions() + public function getDocumentFilename() { - return $this->container['public_submissions']; + return $this->container['document_filename']; } /** - * Sets public_submissions + * Sets document_filename * - * @param bool|null $public_submissions public_submissions + * @param string $document_filename document_filename * - * @return $this + * @return self */ - public function setPublicSubmissions($public_submissions) + public function setDocumentFilename($document_filename) { - $this->container['public_submissions'] = $public_submissions; + if (is_null($document_filename)) { + array_push($this->openAPINullablesSetToNull, 'document_filename'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('document_filename', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['document_filename'] = $document_filename; return $this; } /** - * Gets shared_field_data + * Gets document_parse_error * - * @return object|null + * @return bool */ - public function getSharedFieldData() + public function getDocumentParseError() { - return $this->container['shared_field_data']; + return $this->container['document_parse_error']; } /** - * Sets shared_field_data + * Sets document_parse_error * - * @param object|null $shared_field_data shared_field_data + * @param bool $document_parse_error document_parse_error * - * @return $this + * @return self */ - public function setSharedFieldData($shared_field_data) + public function setDocumentParseError($document_parse_error) { - $this->container['shared_field_data'] = $shared_field_data; + if (is_null($document_parse_error)) { + throw new \InvalidArgumentException('non-nullable document_parse_error cannot be null'); + } + $this->container['document_parse_error'] = $document_parse_error; return $this; } /** - * Gets document_md5 + * Gets document_state * - * @return string|null + * @return string */ - public function getDocumentMd5() + public function getDocumentState() { - return $this->container['document_md5']; + return $this->container['document_state']; } /** - * Sets document_md5 + * Sets document_state * - * @param string|null $document_md5 document_md5 + * @param string $document_state document_state * - * @return $this + * @return self */ - public function setDocumentMd5($document_md5) + public function setDocumentState($document_state) { - $this->container['document_md5'] = $document_md5; + if (is_null($document_state)) { + throw new \InvalidArgumentException('non-nullable document_state cannot be null'); + } + $this->container['document_state'] = $document_state; return $this; } /** - * Gets first_template + * Gets embed_domains * - * @return bool|null + * @return string[] */ - public function getFirstTemplate() + public function getEmbedDomains() { - return $this->container['first_template']; + return $this->container['embed_domains']; } /** - * Sets first_template + * Sets embed_domains * - * @param bool|null $first_template first_template + * @param string[] $embed_domains embed_domains * - * @return $this + * @return self */ - public function setFirstTemplate($first_template) + public function setEmbedDomains($embed_domains) { - $this->container['first_template'] = $first_template; + if (is_null($embed_domains)) { + array_push($this->openAPINullablesSetToNull, 'embed_domains'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('embed_domains', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['embed_domains'] = $embed_domains; return $this; } /** - * Gets defaults + * Gets page_count * - * @return \DocSpring\Model\FullTemplateDefaults|null + * @return float */ - public function getDefaults() + public function getPageCount() { - return $this->container['defaults']; + return $this->container['page_count']; } /** - * Sets defaults + * Sets page_count * - * @param \DocSpring\Model\FullTemplateDefaults|null $defaults defaults + * @param float $page_count page_count * - * @return $this + * @return self */ - public function setDefaults($defaults) + public function setPageCount($page_count) { - $this->container['defaults'] = $defaults; + if (is_null($page_count)) { + throw new \InvalidArgumentException('non-nullable page_count cannot be null'); + } + $this->container['page_count'] = $page_count; return $this; } /** - * Gets editable_submissions + * Gets document_processed * - * @return bool|null + * @return bool */ - public function getEditableSubmissions() + public function getDocumentProcessed() { - return $this->container['editable_submissions']; + return $this->container['document_processed']; } /** - * Sets editable_submissions + * Sets document_processed * - * @param bool|null $editable_submissions editable_submissions + * @param bool $document_processed document_processed * - * @return $this + * @return self */ - public function setEditableSubmissions($editable_submissions) + public function setDocumentProcessed($document_processed) { - $this->container['editable_submissions'] = $editable_submissions; + if (is_null($document_processed)) { + throw new \InvalidArgumentException('non-nullable document_processed cannot be null'); + } + $this->container['document_processed'] = $document_processed; return $this; } /** - * Gets expire_submissions + * Gets demo * - * @return bool|null + * @return bool */ - public function getExpireSubmissions() + public function getDemo() { - return $this->container['expire_submissions']; + return $this->container['demo']; } /** - * Sets expire_submissions + * Sets demo * - * @param bool|null $expire_submissions expire_submissions + * @param bool $demo demo * - * @return $this + * @return self */ - public function setExpireSubmissions($expire_submissions) + public function setDemo($demo) { - $this->container['expire_submissions'] = $expire_submissions; + if (is_null($demo)) { + throw new \InvalidArgumentException('non-nullable demo cannot be null'); + } + $this->container['demo'] = $demo; return $this; } /** - * Gets name + * Gets id * - * @return string|null + * @return string */ - public function getName() + public function getId() { - return $this->container['name']; + return $this->container['id']; } /** - * Sets name + * Sets id * - * @param string|null $name name + * @param string $id id * - * @return $this + * @return self */ - public function setName($name) + public function setId($id) { - $this->container['name'] = $name; + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; return $this; } /** - * Gets footer_html + * Gets template_type * - * @return string|null + * @return string */ - public function getFooterHtml() + public function getTemplateType() { - return $this->container['footer_html']; + return $this->container['template_type']; } /** - * Sets footer_html + * Sets template_type * - * @param string|null $footer_html footer_html + * @param string $template_type template_type * - * @return $this + * @return self */ - public function setFooterHtml($footer_html) + public function setTemplateType($template_type) { - $this->container['footer_html'] = $footer_html; + if (is_null($template_type)) { + throw new \InvalidArgumentException('non-nullable template_type cannot be null'); + } + $this->container['template_type'] = $template_type; return $this; } /** - * Gets document_parse_error + * Gets page_dimensions * - * @return bool|null + * @return float[][] */ - public function getDocumentParseError() + public function getPageDimensions() { - return $this->container['document_parse_error']; + return $this->container['page_dimensions']; } /** - * Sets document_parse_error + * Sets page_dimensions * - * @param bool|null $document_parse_error document_parse_error + * @param float[][] $page_dimensions page_dimensions * - * @return $this + * @return self */ - public function setDocumentParseError($document_parse_error) + public function setPageDimensions($page_dimensions) { - $this->container['document_parse_error'] = $document_parse_error; + if (is_null($page_dimensions)) { + array_push($this->openAPINullablesSetToNull, 'page_dimensions'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('page_dimensions', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['page_dimensions'] = $page_dimensions; return $this; } /** - * Gets fields + * Gets document_url * - * @return object|null + * @return string */ - public function getFields() + public function getDocumentUrl() { - return $this->container['fields']; + return $this->container['document_url']; } /** - * Sets fields + * Sets document_url * - * @param object|null $fields fields + * @param string $document_url document_url * - * @return $this + * @return self */ - public function setFields($fields) + public function setDocumentUrl($document_url) { - $this->container['fields'] = $fields; + if (is_null($document_url)) { + array_push($this->openAPINullablesSetToNull, 'document_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('document_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['document_url'] = $document_url; return $this; } /** - * Gets document_filename + * Gets permanent_document_url * - * @return string|null + * @return string */ - public function getDocumentFilename() + public function getPermanentDocumentUrl() { - return $this->container['document_filename']; + return $this->container['permanent_document_url']; } /** - * Sets document_filename + * Sets permanent_document_url * - * @param string|null $document_filename document_filename + * @param string $permanent_document_url permanent_document_url * - * @return $this + * @return self */ - public function setDocumentFilename($document_filename) + public function setPermanentDocumentUrl($permanent_document_url) { - $this->container['document_filename'] = $document_filename; + if (is_null($permanent_document_url)) { + array_push($this->openAPINullablesSetToNull, 'permanent_document_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('permanent_document_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['permanent_document_url'] = $permanent_document_url; return $this; } /** - * Gets redirect_url + * Gets path * - * @return string|null + * @return string */ - public function getRedirectUrl() + public function getPath() { - return $this->container['redirect_url']; + return $this->container['path']; } /** - * Sets redirect_url + * Sets path * - * @param string|null $redirect_url redirect_url + * @param string $path path * - * @return $this + * @return self */ - public function setRedirectUrl($redirect_url) + public function setPath($path) { - $this->container['redirect_url'] = $redirect_url; + if (is_null($path)) { + throw new \InvalidArgumentException('non-nullable path cannot be null'); + } + $this->container['path'] = $path; return $this; } /** - * Gets document_url + * Gets parent_folder_id * - * @return string|null + * @return string */ - public function getDocumentUrl() + public function getParentFolderId() { - return $this->container['document_url']; + return $this->container['parent_folder_id']; } /** - * Sets document_url + * Sets parent_folder_id * - * @param string|null $document_url document_url + * @param string $parent_folder_id parent_folder_id * - * @return $this + * @return self */ - public function setDocumentUrl($document_url) + public function setParentFolderId($parent_folder_id) { - $this->container['document_url'] = $document_url; + if (is_null($parent_folder_id)) { + array_push($this->openAPINullablesSetToNull, 'parent_folder_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('parent_folder_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['parent_folder_id'] = $parent_folder_id; return $this; } @@ -1408,7 +1886,7 @@ public function setDocumentUrl($document_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1418,22 +1896,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1449,11 +1928,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -1466,6 +1958,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/HtmlTemplateData.php b/lib/Model/HtmlTemplateData.php index e9cefcf..29642de 100644 --- a/lib/Model/HtmlTemplateData.php +++ b/lib/Model/HtmlTemplateData.php @@ -2,7 +2,7 @@ /** * HtmlTemplateData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class HtmlTemplateData implements ModelInterface, ArrayAccess +class HtmlTemplateData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,50 +57,84 @@ class HtmlTemplateData implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'expiration_interval' => 'string', - 'webhook_url' => 'string', - 'scss' => 'string', 'allow_additional_properties' => 'bool', - 'expire_after' => 'float', 'description' => 'string', - 'public_submissions' => 'bool', - 'slack_webhook_url' => 'string', - 'header_html' => 'string', - 'public_web_form' => 'bool', 'editable_submissions' => 'bool', + 'expiration_interval' => 'string', + 'expire_after' => 'float', 'expire_submissions' => 'bool', - 'name' => 'string', 'footer_html' => 'string', + 'header_html' => 'string', 'html' => 'string', + 'name' => 'string', + 'public_submissions' => 'bool', + 'public_web_form' => 'bool', + 'redirect_url' => 'string', + 'scss' => 'string', + 'slack_webhook_url' => 'string', 'template_type' => 'string', - 'redirect_url' => 'string' + 'webhook_url' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'expiration_interval' => null, - 'webhook_url' => null, - 'scss' => null, 'allow_additional_properties' => null, - 'expire_after' => null, 'description' => null, - 'public_submissions' => null, - 'slack_webhook_url' => null, - 'header_html' => null, - 'public_web_form' => null, 'editable_submissions' => null, + 'expiration_interval' => null, + 'expire_after' => null, 'expire_submissions' => null, - 'name' => null, 'footer_html' => null, + 'header_html' => null, 'html' => null, + 'name' => null, + 'public_submissions' => null, + 'public_web_form' => null, + 'redirect_url' => null, + 'scss' => null, + 'slack_webhook_url' => null, 'template_type' => null, - 'redirect_url' => null + 'webhook_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'allow_additional_properties' => false, + 'description' => true, + 'editable_submissions' => false, + 'expiration_interval' => false, + 'expire_after' => false, + 'expire_submissions' => false, + 'footer_html' => true, + 'header_html' => true, + 'html' => true, + 'name' => true, + 'public_submissions' => false, + 'public_web_form' => false, + 'redirect_url' => true, + 'scss' => true, + 'slack_webhook_url' => true, + 'template_type' => false, + 'webhook_url' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -121,6 +155,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -128,23 +214,23 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'expiration_interval' => 'expiration_interval', - 'webhook_url' => 'webhook_url', - 'scss' => 'scss', 'allow_additional_properties' => 'allow_additional_properties', - 'expire_after' => 'expire_after', 'description' => 'description', - 'public_submissions' => 'public_submissions', - 'slack_webhook_url' => 'slack_webhook_url', - 'header_html' => 'header_html', - 'public_web_form' => 'public_web_form', 'editable_submissions' => 'editable_submissions', + 'expiration_interval' => 'expiration_interval', + 'expire_after' => 'expire_after', 'expire_submissions' => 'expire_submissions', - 'name' => 'name', 'footer_html' => 'footer_html', + 'header_html' => 'header_html', 'html' => 'html', + 'name' => 'name', + 'public_submissions' => 'public_submissions', + 'public_web_form' => 'public_web_form', + 'redirect_url' => 'redirect_url', + 'scss' => 'scss', + 'slack_webhook_url' => 'slack_webhook_url', 'template_type' => 'template_type', - 'redirect_url' => 'redirect_url' + 'webhook_url' => 'webhook_url' ]; /** @@ -153,23 +239,23 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'expiration_interval' => 'setExpirationInterval', - 'webhook_url' => 'setWebhookUrl', - 'scss' => 'setScss', 'allow_additional_properties' => 'setAllowAdditionalProperties', - 'expire_after' => 'setExpireAfter', 'description' => 'setDescription', - 'public_submissions' => 'setPublicSubmissions', - 'slack_webhook_url' => 'setSlackWebhookUrl', - 'header_html' => 'setHeaderHtml', - 'public_web_form' => 'setPublicWebForm', 'editable_submissions' => 'setEditableSubmissions', + 'expiration_interval' => 'setExpirationInterval', + 'expire_after' => 'setExpireAfter', 'expire_submissions' => 'setExpireSubmissions', - 'name' => 'setName', 'footer_html' => 'setFooterHtml', + 'header_html' => 'setHeaderHtml', 'html' => 'setHtml', + 'name' => 'setName', + 'public_submissions' => 'setPublicSubmissions', + 'public_web_form' => 'setPublicWebForm', + 'redirect_url' => 'setRedirectUrl', + 'scss' => 'setScss', + 'slack_webhook_url' => 'setSlackWebhookUrl', 'template_type' => 'setTemplateType', - 'redirect_url' => 'setRedirectUrl' + 'webhook_url' => 'setWebhookUrl' ]; /** @@ -178,23 +264,23 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'expiration_interval' => 'getExpirationInterval', - 'webhook_url' => 'getWebhookUrl', - 'scss' => 'getScss', 'allow_additional_properties' => 'getAllowAdditionalProperties', - 'expire_after' => 'getExpireAfter', 'description' => 'getDescription', - 'public_submissions' => 'getPublicSubmissions', - 'slack_webhook_url' => 'getSlackWebhookUrl', - 'header_html' => 'getHeaderHtml', - 'public_web_form' => 'getPublicWebForm', 'editable_submissions' => 'getEditableSubmissions', + 'expiration_interval' => 'getExpirationInterval', + 'expire_after' => 'getExpireAfter', 'expire_submissions' => 'getExpireSubmissions', - 'name' => 'getName', 'footer_html' => 'getFooterHtml', + 'header_html' => 'getHeaderHtml', 'html' => 'getHtml', + 'name' => 'getName', + 'public_submissions' => 'getPublicSubmissions', + 'public_web_form' => 'getPublicWebForm', + 'redirect_url' => 'getRedirectUrl', + 'scss' => 'getScss', + 'slack_webhook_url' => 'getSlackWebhookUrl', 'template_type' => 'getTemplateType', - 'redirect_url' => 'getRedirectUrl' + 'webhook_url' => 'getWebhookUrl' ]; /** @@ -238,14 +324,12 @@ public function getModelName() return self::$openAPIModelName; } - const EXPIRATION_INTERVAL_MINUTES = 'minutes'; - const EXPIRATION_INTERVAL_HOURS = 'hours'; - const EXPIRATION_INTERVAL_DAYS = 'days'; - const TEMPLATE_TYPE_PDF = 'pdf'; - const TEMPLATE_TYPE_HTML = 'html'; - + public const EXPIRATION_INTERVAL_MINUTES = 'minutes'; + public const EXPIRATION_INTERVAL_HOURS = 'hours'; + public const EXPIRATION_INTERVAL_DAYS = 'days'; + public const TEMPLATE_TYPE_PDF = 'pdf'; + public const TEMPLATE_TYPE_HTML = 'html'; - /** * Gets allowable values of the enum * @@ -259,7 +343,7 @@ public function getExpirationIntervalAllowableValues() self::EXPIRATION_INTERVAL_DAYS, ]; } - + /** * Gets allowable values of the enum * @@ -272,7 +356,6 @@ public function getTemplateTypeAllowableValues() self::TEMPLATE_TYPE_HTML, ]; } - /** * Associative array for storing property values @@ -289,23 +372,41 @@ public function getTemplateTypeAllowableValues() */ public function __construct(array $data = null) { - $this->container['expiration_interval'] = isset($data['expiration_interval']) ? $data['expiration_interval'] : null; - $this->container['webhook_url'] = isset($data['webhook_url']) ? $data['webhook_url'] : null; - $this->container['scss'] = isset($data['scss']) ? $data['scss'] : null; - $this->container['allow_additional_properties'] = isset($data['allow_additional_properties']) ? $data['allow_additional_properties'] : null; - $this->container['expire_after'] = isset($data['expire_after']) ? $data['expire_after'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['public_submissions'] = isset($data['public_submissions']) ? $data['public_submissions'] : null; - $this->container['slack_webhook_url'] = isset($data['slack_webhook_url']) ? $data['slack_webhook_url'] : null; - $this->container['header_html'] = isset($data['header_html']) ? $data['header_html'] : null; - $this->container['public_web_form'] = isset($data['public_web_form']) ? $data['public_web_form'] : null; - $this->container['editable_submissions'] = isset($data['editable_submissions']) ? $data['editable_submissions'] : null; - $this->container['expire_submissions'] = isset($data['expire_submissions']) ? $data['expire_submissions'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['footer_html'] = isset($data['footer_html']) ? $data['footer_html'] : null; - $this->container['html'] = isset($data['html']) ? $data['html'] : null; - $this->container['template_type'] = isset($data['template_type']) ? $data['template_type'] : null; - $this->container['redirect_url'] = isset($data['redirect_url']) ? $data['redirect_url'] : null; + $this->setIfExists('allow_additional_properties', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('editable_submissions', $data ?? [], null); + $this->setIfExists('expiration_interval', $data ?? [], null); + $this->setIfExists('expire_after', $data ?? [], null); + $this->setIfExists('expire_submissions', $data ?? [], null); + $this->setIfExists('footer_html', $data ?? [], null); + $this->setIfExists('header_html', $data ?? [], null); + $this->setIfExists('html', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('public_submissions', $data ?? [], null); + $this->setIfExists('public_web_form', $data ?? [], null); + $this->setIfExists('redirect_url', $data ?? [], null); + $this->setIfExists('scss', $data ?? [], null); + $this->setIfExists('slack_webhook_url', $data ?? [], null); + $this->setIfExists('template_type', $data ?? [], null); + $this->setIfExists('webhook_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -320,15 +421,20 @@ public function listInvalidProperties() $allowedValues = $this->getExpirationIntervalAllowableValues(); if (!is_null($this->container['expiration_interval']) && !in_array($this->container['expiration_interval'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'expiration_interval', must be one of '%s'", + "invalid value '%s' for 'expiration_interval', must be one of '%s'", + $this->container['expiration_interval'], implode("', '", $allowedValues) ); } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } $allowedValues = $this->getTemplateTypeAllowableValues(); if (!is_null($this->container['template_type']) && !in_array($this->container['template_type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'template_type', must be one of '%s'", + "invalid value '%s' for 'template_type', must be one of '%s'", + $this->container['template_type'], implode("', '", $allowedValues) ); } @@ -349,106 +455,126 @@ public function valid() /** - * Gets expiration_interval + * Gets allow_additional_properties * - * @return string|null + * @return bool|null */ - public function getExpirationInterval() + public function getAllowAdditionalProperties() { - return $this->container['expiration_interval']; + return $this->container['allow_additional_properties']; } /** - * Sets expiration_interval + * Sets allow_additional_properties * - * @param string|null $expiration_interval expiration_interval + * @param bool|null $allow_additional_properties allow_additional_properties * - * @return $this + * @return self */ - public function setExpirationInterval($expiration_interval) + public function setAllowAdditionalProperties($allow_additional_properties) { - $allowedValues = $this->getExpirationIntervalAllowableValues(); - if (!is_null($expiration_interval) && !in_array($expiration_interval, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'expiration_interval', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($allow_additional_properties)) { + throw new \InvalidArgumentException('non-nullable allow_additional_properties cannot be null'); } - $this->container['expiration_interval'] = $expiration_interval; + $this->container['allow_additional_properties'] = $allow_additional_properties; return $this; } /** - * Gets webhook_url + * Gets description * * @return string|null */ - public function getWebhookUrl() + public function getDescription() { - return $this->container['webhook_url']; + return $this->container['description']; } /** - * Sets webhook_url + * Sets description * - * @param string|null $webhook_url webhook_url + * @param string|null $description description * - * @return $this + * @return self */ - public function setWebhookUrl($webhook_url) + public function setDescription($description) { - $this->container['webhook_url'] = $webhook_url; + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; return $this; } /** - * Gets scss + * Gets editable_submissions * - * @return string|null + * @return bool|null */ - public function getScss() + public function getEditableSubmissions() { - return $this->container['scss']; + return $this->container['editable_submissions']; } /** - * Sets scss + * Sets editable_submissions * - * @param string|null $scss scss + * @param bool|null $editable_submissions editable_submissions * - * @return $this + * @return self */ - public function setScss($scss) + public function setEditableSubmissions($editable_submissions) { - $this->container['scss'] = $scss; + if (is_null($editable_submissions)) { + throw new \InvalidArgumentException('non-nullable editable_submissions cannot be null'); + } + $this->container['editable_submissions'] = $editable_submissions; return $this; } /** - * Gets allow_additional_properties + * Gets expiration_interval * - * @return bool|null + * @return string|null */ - public function getAllowAdditionalProperties() + public function getExpirationInterval() { - return $this->container['allow_additional_properties']; + return $this->container['expiration_interval']; } /** - * Sets allow_additional_properties + * Sets expiration_interval * - * @param bool|null $allow_additional_properties allow_additional_properties + * @param string|null $expiration_interval expiration_interval * - * @return $this + * @return self */ - public function setAllowAdditionalProperties($allow_additional_properties) + public function setExpirationInterval($expiration_interval) { - $this->container['allow_additional_properties'] = $allow_additional_properties; + if (is_null($expiration_interval)) { + throw new \InvalidArgumentException('non-nullable expiration_interval cannot be null'); + } + $allowedValues = $this->getExpirationIntervalAllowableValues(); + if (!in_array($expiration_interval, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'expiration_interval', must be one of '%s'", + $expiration_interval, + implode("', '", $allowedValues) + ) + ); + } + $this->container['expiration_interval'] = $expiration_interval; return $this; } @@ -468,251 +594,333 @@ public function getExpireAfter() * * @param float|null $expire_after expire_after * - * @return $this + * @return self */ public function setExpireAfter($expire_after) { + if (is_null($expire_after)) { + throw new \InvalidArgumentException('non-nullable expire_after cannot be null'); + } $this->container['expire_after'] = $expire_after; return $this; } /** - * Gets description + * Gets expire_submissions * - * @return string|null + * @return bool|null */ - public function getDescription() + public function getExpireSubmissions() { - return $this->container['description']; + return $this->container['expire_submissions']; } /** - * Sets description + * Sets expire_submissions * - * @param string|null $description description + * @param bool|null $expire_submissions expire_submissions * - * @return $this + * @return self */ - public function setDescription($description) + public function setExpireSubmissions($expire_submissions) { - $this->container['description'] = $description; + if (is_null($expire_submissions)) { + throw new \InvalidArgumentException('non-nullable expire_submissions cannot be null'); + } + $this->container['expire_submissions'] = $expire_submissions; return $this; } /** - * Gets public_submissions + * Gets footer_html * - * @return bool|null + * @return string|null */ - public function getPublicSubmissions() + public function getFooterHtml() { - return $this->container['public_submissions']; + return $this->container['footer_html']; } /** - * Sets public_submissions + * Sets footer_html * - * @param bool|null $public_submissions public_submissions + * @param string|null $footer_html footer_html * - * @return $this + * @return self */ - public function setPublicSubmissions($public_submissions) + public function setFooterHtml($footer_html) { - $this->container['public_submissions'] = $public_submissions; + if (is_null($footer_html)) { + array_push($this->openAPINullablesSetToNull, 'footer_html'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('footer_html', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['footer_html'] = $footer_html; return $this; } /** - * Gets slack_webhook_url + * Gets header_html * * @return string|null */ - public function getSlackWebhookUrl() + public function getHeaderHtml() { - return $this->container['slack_webhook_url']; + return $this->container['header_html']; } /** - * Sets slack_webhook_url + * Sets header_html * - * @param string|null $slack_webhook_url slack_webhook_url + * @param string|null $header_html header_html * - * @return $this + * @return self */ - public function setSlackWebhookUrl($slack_webhook_url) + public function setHeaderHtml($header_html) { - $this->container['slack_webhook_url'] = $slack_webhook_url; + if (is_null($header_html)) { + array_push($this->openAPINullablesSetToNull, 'header_html'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('header_html', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['header_html'] = $header_html; return $this; } /** - * Gets header_html + * Gets html * * @return string|null */ - public function getHeaderHtml() + public function getHtml() { - return $this->container['header_html']; + return $this->container['html']; } /** - * Sets header_html + * Sets html * - * @param string|null $header_html header_html + * @param string|null $html html * - * @return $this + * @return self */ - public function setHeaderHtml($header_html) + public function setHtml($html) { - $this->container['header_html'] = $header_html; + if (is_null($html)) { + array_push($this->openAPINullablesSetToNull, 'html'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('html', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['html'] = $html; return $this; } /** - * Gets public_web_form + * Gets name * - * @return bool|null + * @return string */ - public function getPublicWebForm() + public function getName() { - return $this->container['public_web_form']; + return $this->container['name']; } /** - * Sets public_web_form + * Sets name * - * @param bool|null $public_web_form public_web_form + * @param string $name name * - * @return $this + * @return self */ - public function setPublicWebForm($public_web_form) + public function setName($name) { - $this->container['public_web_form'] = $public_web_form; + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; return $this; } /** - * Gets editable_submissions + * Gets public_submissions * * @return bool|null */ - public function getEditableSubmissions() + public function getPublicSubmissions() { - return $this->container['editable_submissions']; + return $this->container['public_submissions']; } /** - * Sets editable_submissions + * Sets public_submissions * - * @param bool|null $editable_submissions editable_submissions + * @param bool|null $public_submissions public_submissions * - * @return $this + * @return self */ - public function setEditableSubmissions($editable_submissions) + public function setPublicSubmissions($public_submissions) { - $this->container['editable_submissions'] = $editable_submissions; + if (is_null($public_submissions)) { + throw new \InvalidArgumentException('non-nullable public_submissions cannot be null'); + } + $this->container['public_submissions'] = $public_submissions; return $this; } /** - * Gets expire_submissions + * Gets public_web_form * * @return bool|null */ - public function getExpireSubmissions() + public function getPublicWebForm() { - return $this->container['expire_submissions']; + return $this->container['public_web_form']; } /** - * Sets expire_submissions + * Sets public_web_form * - * @param bool|null $expire_submissions expire_submissions + * @param bool|null $public_web_form public_web_form * - * @return $this + * @return self */ - public function setExpireSubmissions($expire_submissions) + public function setPublicWebForm($public_web_form) { - $this->container['expire_submissions'] = $expire_submissions; + if (is_null($public_web_form)) { + throw new \InvalidArgumentException('non-nullable public_web_form cannot be null'); + } + $this->container['public_web_form'] = $public_web_form; return $this; } /** - * Gets name + * Gets redirect_url * * @return string|null */ - public function getName() + public function getRedirectUrl() { - return $this->container['name']; + return $this->container['redirect_url']; } /** - * Sets name + * Sets redirect_url * - * @param string|null $name name + * @param string|null $redirect_url redirect_url * - * @return $this + * @return self */ - public function setName($name) + public function setRedirectUrl($redirect_url) { - $this->container['name'] = $name; + if (is_null($redirect_url)) { + array_push($this->openAPINullablesSetToNull, 'redirect_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('redirect_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['redirect_url'] = $redirect_url; return $this; } /** - * Gets footer_html + * Gets scss * * @return string|null */ - public function getFooterHtml() + public function getScss() { - return $this->container['footer_html']; + return $this->container['scss']; } /** - * Sets footer_html + * Sets scss * - * @param string|null $footer_html footer_html + * @param string|null $scss scss * - * @return $this + * @return self */ - public function setFooterHtml($footer_html) + public function setScss($scss) { - $this->container['footer_html'] = $footer_html; + if (is_null($scss)) { + array_push($this->openAPINullablesSetToNull, 'scss'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('scss', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['scss'] = $scss; return $this; } /** - * Gets html + * Gets slack_webhook_url * * @return string|null */ - public function getHtml() + public function getSlackWebhookUrl() { - return $this->container['html']; + return $this->container['slack_webhook_url']; } /** - * Sets html + * Sets slack_webhook_url * - * @param string|null $html html + * @param string|null $slack_webhook_url slack_webhook_url * - * @return $this + * @return self */ - public function setHtml($html) + public function setSlackWebhookUrl($slack_webhook_url) { - $this->container['html'] = $html; + if (is_null($slack_webhook_url)) { + array_push($this->openAPINullablesSetToNull, 'slack_webhook_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('slack_webhook_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['slack_webhook_url'] = $slack_webhook_url; return $this; } @@ -732,15 +940,19 @@ public function getTemplateType() * * @param string|null $template_type template_type * - * @return $this + * @return self */ public function setTemplateType($template_type) { + if (is_null($template_type)) { + throw new \InvalidArgumentException('non-nullable template_type cannot be null'); + } $allowedValues = $this->getTemplateTypeAllowableValues(); - if (!is_null($template_type) && !in_array($template_type, $allowedValues, true)) { + if (!in_array($template_type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'template_type', must be one of '%s'", + "Invalid value '%s' for 'template_type', must be one of '%s'", + $template_type, implode("', '", $allowedValues) ) ); @@ -751,25 +963,35 @@ public function setTemplateType($template_type) } /** - * Gets redirect_url + * Gets webhook_url * * @return string|null */ - public function getRedirectUrl() + public function getWebhookUrl() { - return $this->container['redirect_url']; + return $this->container['webhook_url']; } /** - * Sets redirect_url + * Sets webhook_url * - * @param string|null $redirect_url redirect_url + * @param string|null $webhook_url webhook_url * - * @return $this + * @return self */ - public function setRedirectUrl($redirect_url) + public function setWebhookUrl($webhook_url) { - $this->container['redirect_url'] = $redirect_url; + if (is_null($webhook_url)) { + array_push($this->openAPINullablesSetToNull, 'webhook_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('webhook_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['webhook_url'] = $webhook_url; return $this; } @@ -780,7 +1002,7 @@ public function setRedirectUrl($redirect_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -790,22 +1012,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -821,11 +1044,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -838,6 +1074,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/InvalidRequest.php b/lib/Model/InvalidRequest.php index a14193a..60df1de 100644 --- a/lib/Model/InvalidRequest.php +++ b/lib/Model/InvalidRequest.php @@ -2,7 +2,7 @@ /** * InvalidRequest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class InvalidRequest implements ModelInterface, ArrayAccess +class InvalidRequest implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -65,12 +65,31 @@ class InvalidRequest implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'status' => null, 'errors' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'errors' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -91,6 +110,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -163,10 +234,8 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_ERROR = 'error'; - + public const STATUS_ERROR = 'error'; - /** * Gets allowable values of the enum * @@ -178,7 +247,6 @@ public function getStatusAllowableValues() self::STATUS_ERROR, ]; } - /** * Associative array for storing property values @@ -195,8 +263,26 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -214,7 +300,8 @@ public function listInvalidProperties() $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } @@ -252,15 +339,19 @@ public function getStatus() * * @param string $status status * - * @return $this + * @return self */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $allowedValues = $this->getStatusAllowableValues(); if (!in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'status', must be one of '%s'", + "Invalid value '%s' for 'status', must be one of '%s'", + $status, implode("', '", $allowedValues) ) ); @@ -285,10 +376,13 @@ public function getErrors() * * @param string[] $errors errors * - * @return $this + * @return self */ public function setErrors($errors) { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } $this->container['errors'] = $errors; return $this; @@ -300,7 +394,7 @@ public function setErrors($errors) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -310,22 +404,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -341,11 +436,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -358,6 +466,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ListSubmissionsResponse.php b/lib/Model/ListSubmissionsResponse.php index 59b7224..6f3b4f2 100644 --- a/lib/Model/ListSubmissionsResponse.php +++ b/lib/Model/ListSubmissionsResponse.php @@ -2,7 +2,7 @@ /** * ListSubmissionsResponse * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class ListSubmissionsResponse implements ModelInterface, ArrayAccess +class ListSubmissionsResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,22 +57,42 @@ class ListSubmissionsResponse implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'next_cursor' => 'string', 'submissions' => '\DocSpring\Model\Submission[]', - 'limit' => 'float' + 'limit' => 'float', + 'next_cursor' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'next_cursor' => null, 'submissions' => null, - 'limit' => null + 'limit' => null, + 'next_cursor' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'submissions' => false, + 'limit' => false, + 'next_cursor' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -93,6 +113,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -100,9 +172,9 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'next_cursor' => 'next_cursor', 'submissions' => 'submissions', - 'limit' => 'limit' + 'limit' => 'limit', + 'next_cursor' => 'next_cursor' ]; /** @@ -111,9 +183,9 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'next_cursor' => 'setNextCursor', 'submissions' => 'setSubmissions', - 'limit' => 'setLimit' + 'limit' => 'setLimit', + 'next_cursor' => 'setNextCursor' ]; /** @@ -122,9 +194,9 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'next_cursor' => 'getNextCursor', 'submissions' => 'getSubmissions', - 'limit' => 'getLimit' + 'limit' => 'getLimit', + 'next_cursor' => 'getNextCursor' ]; /** @@ -168,9 +240,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -187,9 +256,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['next_cursor'] = isset($data['next_cursor']) ? $data['next_cursor'] : null; - $this->container['submissions'] = isset($data['submissions']) ? $data['submissions'] : null; - $this->container['limit'] = isset($data['limit']) ? $data['limit'] : null; + $this->setIfExists('submissions', $data ?? [], null); + $this->setIfExists('limit', $data ?? [], null); + $this->setIfExists('next_cursor', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -201,6 +288,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['submissions'] === null) { + $invalidProperties[] = "'submissions' can't be null"; + } + if ($this->container['limit'] === null) { + $invalidProperties[] = "'limit' can't be null"; + } + if ($this->container['next_cursor'] === null) { + $invalidProperties[] = "'next_cursor' can't be null"; + } return $invalidProperties; } @@ -217,73 +313,89 @@ public function valid() /** - * Gets next_cursor + * Gets submissions * - * @return string|null + * @return \DocSpring\Model\Submission[] */ - public function getNextCursor() + public function getSubmissions() { - return $this->container['next_cursor']; + return $this->container['submissions']; } /** - * Sets next_cursor + * Sets submissions * - * @param string|null $next_cursor next_cursor + * @param \DocSpring\Model\Submission[] $submissions submissions * - * @return $this + * @return self */ - public function setNextCursor($next_cursor) + public function setSubmissions($submissions) { - $this->container['next_cursor'] = $next_cursor; + if (is_null($submissions)) { + throw new \InvalidArgumentException('non-nullable submissions cannot be null'); + } + $this->container['submissions'] = $submissions; return $this; } /** - * Gets submissions + * Gets limit * - * @return \DocSpring\Model\Submission[]|null + * @return float */ - public function getSubmissions() + public function getLimit() { - return $this->container['submissions']; + return $this->container['limit']; } /** - * Sets submissions + * Sets limit * - * @param \DocSpring\Model\Submission[]|null $submissions submissions + * @param float $limit limit * - * @return $this + * @return self */ - public function setSubmissions($submissions) + public function setLimit($limit) { - $this->container['submissions'] = $submissions; + if (is_null($limit)) { + throw new \InvalidArgumentException('non-nullable limit cannot be null'); + } + $this->container['limit'] = $limit; return $this; } /** - * Gets limit + * Gets next_cursor * - * @return float|null + * @return string */ - public function getLimit() + public function getNextCursor() { - return $this->container['limit']; + return $this->container['next_cursor']; } /** - * Sets limit + * Sets next_cursor * - * @param float|null $limit limit + * @param string $next_cursor next_cursor * - * @return $this + * @return self */ - public function setLimit($limit) + public function setNextCursor($next_cursor) { - $this->container['limit'] = $limit; + if (is_null($next_cursor)) { + array_push($this->openAPINullablesSetToNull, 'next_cursor'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('next_cursor', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['next_cursor'] = $next_cursor; return $this; } @@ -294,7 +406,7 @@ public function setLimit($limit) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -304,22 +416,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -335,11 +448,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -352,6 +478,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php index 6a0370e..ef9ae9c 100644 --- a/lib/Model/ModelInterface.php +++ b/lib/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring\Model @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -93,4 +92,20 @@ public function listInvalidProperties(); * @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/MoveFolderData.php b/lib/Model/MoveFolderData.php index f84e578..25b92cd 100644 --- a/lib/Model/MoveFolderData.php +++ b/lib/Model/MoveFolderData.php @@ -2,7 +2,7 @@ /** * MoveFolderData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class MoveFolderData implements ModelInterface, ArrayAccess +class MoveFolderData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -64,11 +64,29 @@ class MoveFolderData implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'parent_folder_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'parent_folder_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -89,6 +107,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -158,9 +228,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -177,7 +244,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['parent_folder_id'] = isset($data['parent_folder_id']) ? $data['parent_folder_id'] : null; + $this->setIfExists('parent_folder_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -219,10 +304,13 @@ public function getParentFolderId() * * @param string|null $parent_folder_id parent_folder_id * - * @return $this + * @return self */ public function setParentFolderId($parent_folder_id) { + if (is_null($parent_folder_id)) { + throw new \InvalidArgumentException('non-nullable parent_folder_id cannot be null'); + } $this->container['parent_folder_id'] = $parent_folder_id; return $this; @@ -234,7 +322,7 @@ public function setParentFolderId($parent_folder_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -244,22 +332,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -275,11 +364,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -292,6 +394,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/MoveTemplateData.php b/lib/Model/MoveTemplateData.php index a60193c..5256273 100644 --- a/lib/Model/MoveTemplateData.php +++ b/lib/Model/MoveTemplateData.php @@ -2,7 +2,7 @@ /** * MoveTemplateData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class MoveTemplateData implements ModelInterface, ArrayAccess +class MoveTemplateData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -64,11 +64,29 @@ class MoveTemplateData implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'parent_folder_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'parent_folder_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -89,6 +107,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -158,9 +228,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -177,7 +244,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['parent_folder_id'] = isset($data['parent_folder_id']) ? $data['parent_folder_id'] : null; + $this->setIfExists('parent_folder_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -222,10 +307,13 @@ public function getParentFolderId() * * @param string $parent_folder_id parent_folder_id * - * @return $this + * @return self */ public function setParentFolderId($parent_folder_id) { + if (is_null($parent_folder_id)) { + throw new \InvalidArgumentException('non-nullable parent_folder_id cannot be null'); + } $this->container['parent_folder_id'] = $parent_folder_id; return $this; @@ -237,7 +325,7 @@ public function setParentFolderId($parent_folder_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -247,22 +335,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -278,11 +367,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -295,6 +397,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/PendingTemplate.php b/lib/Model/PendingTemplate.php index 60b5736..2a1c645 100644 --- a/lib/Model/PendingTemplate.php +++ b/lib/Model/PendingTemplate.php @@ -2,7 +2,7 @@ /** * PendingTemplate * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class PendingTemplate implements ModelInterface, ArrayAccess +class PendingTemplate implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,50 +57,84 @@ class PendingTemplate implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'expiration_interval' => 'string', - 'webhook_url' => 'string', - 'parent_folder_id' => 'string', - 'expire_after' => 'float', - 'allow_additional_properties' => 'bool', + 'id' => 'string', + 'name' => 'string', 'description' => 'string', - 'public_submissions' => 'bool', - 'slack_webhook_url' => 'string', - 'path' => 'string', + 'template_type' => 'string', 'public_web_form' => 'bool', - 'editable_submissions' => 'bool', + 'public_submissions' => 'bool', 'expire_submissions' => 'bool', - 'name' => 'string', - 'template_type' => 'string', - 'id' => 'string', + 'expire_after' => 'float', 'locked' => 'bool', - 'redirect_url' => 'string' + 'expiration_interval' => 'string', + 'allow_additional_properties' => 'bool', + 'editable_submissions' => 'bool', + 'webhook_url' => 'string', + 'slack_webhook_url' => 'string', + 'redirect_url' => 'string', + 'path' => 'string', + 'parent_folder_id' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'expiration_interval' => null, - 'webhook_url' => null, - 'parent_folder_id' => null, - 'expire_after' => null, - 'allow_additional_properties' => null, + 'id' => null, + 'name' => null, 'description' => null, - 'public_submissions' => null, - 'slack_webhook_url' => null, - 'path' => null, + 'template_type' => null, 'public_web_form' => null, - 'editable_submissions' => null, + 'public_submissions' => null, 'expire_submissions' => null, - 'name' => null, - 'template_type' => null, - 'id' => null, + 'expire_after' => null, 'locked' => null, - 'redirect_url' => null + 'expiration_interval' => null, + 'allow_additional_properties' => null, + 'editable_submissions' => null, + 'webhook_url' => null, + 'slack_webhook_url' => null, + 'redirect_url' => null, + 'path' => null, + 'parent_folder_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => true, + 'description' => true, + 'template_type' => false, + 'public_web_form' => false, + 'public_submissions' => false, + 'expire_submissions' => false, + 'expire_after' => false, + 'locked' => false, + 'expiration_interval' => false, + 'allow_additional_properties' => false, + 'editable_submissions' => false, + 'webhook_url' => true, + 'slack_webhook_url' => true, + 'redirect_url' => true, + 'path' => false, + 'parent_folder_id' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -121,6 +155,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -128,23 +214,23 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'expiration_interval' => 'expiration_interval', - 'webhook_url' => 'webhook_url', - 'parent_folder_id' => 'parent_folder_id', - 'expire_after' => 'expire_after', - 'allow_additional_properties' => 'allow_additional_properties', + 'id' => 'id', + 'name' => 'name', 'description' => 'description', - 'public_submissions' => 'public_submissions', - 'slack_webhook_url' => 'slack_webhook_url', - 'path' => 'path', + 'template_type' => 'template_type', 'public_web_form' => 'public_web_form', - 'editable_submissions' => 'editable_submissions', + 'public_submissions' => 'public_submissions', 'expire_submissions' => 'expire_submissions', - 'name' => 'name', - 'template_type' => 'template_type', - 'id' => 'id', + 'expire_after' => 'expire_after', 'locked' => 'locked', - 'redirect_url' => 'redirect_url' + 'expiration_interval' => 'expiration_interval', + 'allow_additional_properties' => 'allow_additional_properties', + 'editable_submissions' => 'editable_submissions', + 'webhook_url' => 'webhook_url', + 'slack_webhook_url' => 'slack_webhook_url', + 'redirect_url' => 'redirect_url', + 'path' => 'path', + 'parent_folder_id' => 'parent_folder_id' ]; /** @@ -153,23 +239,23 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'expiration_interval' => 'setExpirationInterval', - 'webhook_url' => 'setWebhookUrl', - 'parent_folder_id' => 'setParentFolderId', - 'expire_after' => 'setExpireAfter', - 'allow_additional_properties' => 'setAllowAdditionalProperties', + 'id' => 'setId', + 'name' => 'setName', 'description' => 'setDescription', - 'public_submissions' => 'setPublicSubmissions', - 'slack_webhook_url' => 'setSlackWebhookUrl', - 'path' => 'setPath', + 'template_type' => 'setTemplateType', 'public_web_form' => 'setPublicWebForm', - 'editable_submissions' => 'setEditableSubmissions', + 'public_submissions' => 'setPublicSubmissions', 'expire_submissions' => 'setExpireSubmissions', - 'name' => 'setName', - 'template_type' => 'setTemplateType', - 'id' => 'setId', + 'expire_after' => 'setExpireAfter', 'locked' => 'setLocked', - 'redirect_url' => 'setRedirectUrl' + 'expiration_interval' => 'setExpirationInterval', + 'allow_additional_properties' => 'setAllowAdditionalProperties', + 'editable_submissions' => 'setEditableSubmissions', + 'webhook_url' => 'setWebhookUrl', + 'slack_webhook_url' => 'setSlackWebhookUrl', + 'redirect_url' => 'setRedirectUrl', + 'path' => 'setPath', + 'parent_folder_id' => 'setParentFolderId' ]; /** @@ -178,23 +264,23 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'expiration_interval' => 'getExpirationInterval', - 'webhook_url' => 'getWebhookUrl', - 'parent_folder_id' => 'getParentFolderId', - 'expire_after' => 'getExpireAfter', - 'allow_additional_properties' => 'getAllowAdditionalProperties', + 'id' => 'getId', + 'name' => 'getName', 'description' => 'getDescription', - 'public_submissions' => 'getPublicSubmissions', - 'slack_webhook_url' => 'getSlackWebhookUrl', - 'path' => 'getPath', + 'template_type' => 'getTemplateType', 'public_web_form' => 'getPublicWebForm', - 'editable_submissions' => 'getEditableSubmissions', + 'public_submissions' => 'getPublicSubmissions', 'expire_submissions' => 'getExpireSubmissions', - 'name' => 'getName', - 'template_type' => 'getTemplateType', - 'id' => 'getId', + 'expire_after' => 'getExpireAfter', 'locked' => 'getLocked', - 'redirect_url' => 'getRedirectUrl' + 'expiration_interval' => 'getExpirationInterval', + 'allow_additional_properties' => 'getAllowAdditionalProperties', + 'editable_submissions' => 'getEditableSubmissions', + 'webhook_url' => 'getWebhookUrl', + 'slack_webhook_url' => 'getSlackWebhookUrl', + 'redirect_url' => 'getRedirectUrl', + 'path' => 'getPath', + 'parent_folder_id' => 'getParentFolderId' ]; /** @@ -238,12 +324,10 @@ public function getModelName() return self::$openAPIModelName; } - const EXPIRATION_INTERVAL_MINUTES = 'minutes'; - const EXPIRATION_INTERVAL_HOURS = 'hours'; - const EXPIRATION_INTERVAL_DAYS = 'days'; - + public const EXPIRATION_INTERVAL_MINUTES = 'minutes'; + public const EXPIRATION_INTERVAL_HOURS = 'hours'; + public const EXPIRATION_INTERVAL_DAYS = 'days'; - /** * Gets allowable values of the enum * @@ -257,7 +341,6 @@ public function getExpirationIntervalAllowableValues() self::EXPIRATION_INTERVAL_DAYS, ]; } - /** * Associative array for storing property values @@ -274,23 +357,41 @@ public function getExpirationIntervalAllowableValues() */ public function __construct(array $data = null) { - $this->container['expiration_interval'] = isset($data['expiration_interval']) ? $data['expiration_interval'] : null; - $this->container['webhook_url'] = isset($data['webhook_url']) ? $data['webhook_url'] : null; - $this->container['parent_folder_id'] = isset($data['parent_folder_id']) ? $data['parent_folder_id'] : null; - $this->container['expire_after'] = isset($data['expire_after']) ? $data['expire_after'] : null; - $this->container['allow_additional_properties'] = isset($data['allow_additional_properties']) ? $data['allow_additional_properties'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['public_submissions'] = isset($data['public_submissions']) ? $data['public_submissions'] : null; - $this->container['slack_webhook_url'] = isset($data['slack_webhook_url']) ? $data['slack_webhook_url'] : null; - $this->container['path'] = isset($data['path']) ? $data['path'] : null; - $this->container['public_web_form'] = isset($data['public_web_form']) ? $data['public_web_form'] : null; - $this->container['editable_submissions'] = isset($data['editable_submissions']) ? $data['editable_submissions'] : null; - $this->container['expire_submissions'] = isset($data['expire_submissions']) ? $data['expire_submissions'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['template_type'] = isset($data['template_type']) ? $data['template_type'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['locked'] = isset($data['locked']) ? $data['locked'] : null; - $this->container['redirect_url'] = isset($data['redirect_url']) ? $data['redirect_url'] : null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('template_type', $data ?? [], null); + $this->setIfExists('public_web_form', $data ?? [], null); + $this->setIfExists('public_submissions', $data ?? [], null); + $this->setIfExists('expire_submissions', $data ?? [], null); + $this->setIfExists('expire_after', $data ?? [], null); + $this->setIfExists('locked', $data ?? [], null); + $this->setIfExists('expiration_interval', $data ?? [], null); + $this->setIfExists('allow_additional_properties', $data ?? [], null); + $this->setIfExists('editable_submissions', $data ?? [], null); + $this->setIfExists('webhook_url', $data ?? [], null); + $this->setIfExists('slack_webhook_url', $data ?? [], null); + $this->setIfExists('redirect_url', $data ?? [], null); + $this->setIfExists('path', $data ?? [], null); + $this->setIfExists('parent_folder_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -302,14 +403,54 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['template_type'] === null) { + $invalidProperties[] = "'template_type' can't be null"; + } + if ($this->container['public_web_form'] === null) { + $invalidProperties[] = "'public_web_form' can't be null"; + } + if ($this->container['public_submissions'] === null) { + $invalidProperties[] = "'public_submissions' can't be null"; + } + if ($this->container['expire_submissions'] === null) { + $invalidProperties[] = "'expire_submissions' can't be null"; + } + if ($this->container['locked'] === null) { + $invalidProperties[] = "'locked' can't be null"; + } $allowedValues = $this->getExpirationIntervalAllowableValues(); if (!is_null($this->container['expiration_interval']) && !in_array($this->container['expiration_interval'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'expiration_interval', must be one of '%s'", + "invalid value '%s' for 'expiration_interval', must be one of '%s'", + $this->container['expiration_interval'], implode("', '", $allowedValues) ); } + if ($this->container['allow_additional_properties'] === null) { + $invalidProperties[] = "'allow_additional_properties' can't be null"; + } + if ($this->container['editable_submissions'] === null) { + $invalidProperties[] = "'editable_submissions' can't be null"; + } + if ($this->container['webhook_url'] === null) { + $invalidProperties[] = "'webhook_url' can't be null"; + } + if ($this->container['slack_webhook_url'] === null) { + $invalidProperties[] = "'slack_webhook_url' can't be null"; + } + if ($this->container['redirect_url'] === null) { + $invalidProperties[] = "'redirect_url' can't be null"; + } return $invalidProperties; } @@ -326,418 +467,512 @@ public function valid() /** - * Gets expiration_interval + * Gets id * - * @return string|null + * @return string */ - public function getExpirationInterval() + public function getId() { - return $this->container['expiration_interval']; + return $this->container['id']; } /** - * Sets expiration_interval + * Sets id * - * @param string|null $expiration_interval expiration_interval + * @param string $id id * - * @return $this + * @return self */ - public function setExpirationInterval($expiration_interval) + public function setId($id) { - $allowedValues = $this->getExpirationIntervalAllowableValues(); - if (!is_null($expiration_interval) && !in_array($expiration_interval, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'expiration_interval', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['expiration_interval'] = $expiration_interval; + $this->container['id'] = $id; return $this; } /** - * Gets webhook_url + * Gets name * - * @return string|null + * @return string */ - public function getWebhookUrl() + public function getName() { - return $this->container['webhook_url']; + return $this->container['name']; } /** - * Sets webhook_url + * Sets name * - * @param string|null $webhook_url webhook_url + * @param string $name name * - * @return $this + * @return self */ - public function setWebhookUrl($webhook_url) + public function setName($name) { - $this->container['webhook_url'] = $webhook_url; + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; return $this; } /** - * Gets parent_folder_id + * Gets description * - * @return string|null + * @return string */ - public function getParentFolderId() + public function getDescription() { - return $this->container['parent_folder_id']; + return $this->container['description']; } /** - * Sets parent_folder_id + * Sets description * - * @param string|null $parent_folder_id parent_folder_id + * @param string $description description * - * @return $this + * @return self */ - public function setParentFolderId($parent_folder_id) + public function setDescription($description) { - $this->container['parent_folder_id'] = $parent_folder_id; + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; return $this; } /** - * Gets expire_after + * Gets template_type * - * @return float|null + * @return string */ - public function getExpireAfter() + public function getTemplateType() { - return $this->container['expire_after']; + return $this->container['template_type']; } /** - * Sets expire_after + * Sets template_type * - * @param float|null $expire_after expire_after + * @param string $template_type template_type * - * @return $this + * @return self */ - public function setExpireAfter($expire_after) + public function setTemplateType($template_type) { - $this->container['expire_after'] = $expire_after; + if (is_null($template_type)) { + throw new \InvalidArgumentException('non-nullable template_type cannot be null'); + } + $this->container['template_type'] = $template_type; return $this; } /** - * Gets allow_additional_properties + * Gets public_web_form * - * @return bool|null + * @return bool */ - public function getAllowAdditionalProperties() + public function getPublicWebForm() { - return $this->container['allow_additional_properties']; + return $this->container['public_web_form']; } /** - * Sets allow_additional_properties + * Sets public_web_form * - * @param bool|null $allow_additional_properties allow_additional_properties + * @param bool $public_web_form public_web_form * - * @return $this + * @return self */ - public function setAllowAdditionalProperties($allow_additional_properties) + public function setPublicWebForm($public_web_form) { - $this->container['allow_additional_properties'] = $allow_additional_properties; + if (is_null($public_web_form)) { + throw new \InvalidArgumentException('non-nullable public_web_form cannot be null'); + } + $this->container['public_web_form'] = $public_web_form; return $this; } /** - * Gets description + * Gets public_submissions * - * @return string|null + * @return bool */ - public function getDescription() + public function getPublicSubmissions() { - return $this->container['description']; + return $this->container['public_submissions']; } /** - * Sets description + * Sets public_submissions * - * @param string|null $description description + * @param bool $public_submissions public_submissions * - * @return $this + * @return self */ - public function setDescription($description) + public function setPublicSubmissions($public_submissions) { - $this->container['description'] = $description; + if (is_null($public_submissions)) { + throw new \InvalidArgumentException('non-nullable public_submissions cannot be null'); + } + $this->container['public_submissions'] = $public_submissions; return $this; } /** - * Gets public_submissions + * Gets expire_submissions * - * @return bool|null + * @return bool */ - public function getPublicSubmissions() + public function getExpireSubmissions() { - return $this->container['public_submissions']; + return $this->container['expire_submissions']; } /** - * Sets public_submissions + * Sets expire_submissions * - * @param bool|null $public_submissions public_submissions + * @param bool $expire_submissions expire_submissions * - * @return $this + * @return self */ - public function setPublicSubmissions($public_submissions) + public function setExpireSubmissions($expire_submissions) { - $this->container['public_submissions'] = $public_submissions; + if (is_null($expire_submissions)) { + throw new \InvalidArgumentException('non-nullable expire_submissions cannot be null'); + } + $this->container['expire_submissions'] = $expire_submissions; return $this; } /** - * Gets slack_webhook_url + * Gets expire_after * - * @return string|null + * @return float|null */ - public function getSlackWebhookUrl() + public function getExpireAfter() { - return $this->container['slack_webhook_url']; + return $this->container['expire_after']; } /** - * Sets slack_webhook_url + * Sets expire_after * - * @param string|null $slack_webhook_url slack_webhook_url + * @param float|null $expire_after expire_after * - * @return $this + * @return self */ - public function setSlackWebhookUrl($slack_webhook_url) + public function setExpireAfter($expire_after) { - $this->container['slack_webhook_url'] = $slack_webhook_url; + if (is_null($expire_after)) { + throw new \InvalidArgumentException('non-nullable expire_after cannot be null'); + } + $this->container['expire_after'] = $expire_after; return $this; } /** - * Gets path + * Gets locked * - * @return string|null + * @return bool */ - public function getPath() + public function getLocked() { - return $this->container['path']; + return $this->container['locked']; } /** - * Sets path + * Sets locked * - * @param string|null $path path + * @param bool $locked locked * - * @return $this + * @return self */ - public function setPath($path) + public function setLocked($locked) { - $this->container['path'] = $path; + if (is_null($locked)) { + throw new \InvalidArgumentException('non-nullable locked cannot be null'); + } + $this->container['locked'] = $locked; return $this; } /** - * Gets public_web_form + * Gets expiration_interval * - * @return bool|null + * @return string|null */ - public function getPublicWebForm() + public function getExpirationInterval() { - return $this->container['public_web_form']; + return $this->container['expiration_interval']; } /** - * Sets public_web_form + * Sets expiration_interval * - * @param bool|null $public_web_form public_web_form + * @param string|null $expiration_interval expiration_interval * - * @return $this + * @return self */ - public function setPublicWebForm($public_web_form) + public function setExpirationInterval($expiration_interval) { - $this->container['public_web_form'] = $public_web_form; + if (is_null($expiration_interval)) { + throw new \InvalidArgumentException('non-nullable expiration_interval cannot be null'); + } + $allowedValues = $this->getExpirationIntervalAllowableValues(); + if (!in_array($expiration_interval, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'expiration_interval', must be one of '%s'", + $expiration_interval, + implode("', '", $allowedValues) + ) + ); + } + $this->container['expiration_interval'] = $expiration_interval; return $this; } /** - * Gets editable_submissions + * Gets allow_additional_properties * - * @return bool|null + * @return bool */ - public function getEditableSubmissions() + public function getAllowAdditionalProperties() { - return $this->container['editable_submissions']; + return $this->container['allow_additional_properties']; } /** - * Sets editable_submissions + * Sets allow_additional_properties * - * @param bool|null $editable_submissions editable_submissions + * @param bool $allow_additional_properties allow_additional_properties * - * @return $this + * @return self */ - public function setEditableSubmissions($editable_submissions) + public function setAllowAdditionalProperties($allow_additional_properties) { - $this->container['editable_submissions'] = $editable_submissions; + if (is_null($allow_additional_properties)) { + throw new \InvalidArgumentException('non-nullable allow_additional_properties cannot be null'); + } + $this->container['allow_additional_properties'] = $allow_additional_properties; return $this; } /** - * Gets expire_submissions + * Gets editable_submissions * - * @return bool|null + * @return bool */ - public function getExpireSubmissions() + public function getEditableSubmissions() { - return $this->container['expire_submissions']; + return $this->container['editable_submissions']; } /** - * Sets expire_submissions + * Sets editable_submissions * - * @param bool|null $expire_submissions expire_submissions + * @param bool $editable_submissions editable_submissions * - * @return $this + * @return self */ - public function setExpireSubmissions($expire_submissions) + public function setEditableSubmissions($editable_submissions) { - $this->container['expire_submissions'] = $expire_submissions; + if (is_null($editable_submissions)) { + throw new \InvalidArgumentException('non-nullable editable_submissions cannot be null'); + } + $this->container['editable_submissions'] = $editable_submissions; return $this; } /** - * Gets name + * Gets webhook_url * - * @return string|null + * @return string */ - public function getName() + public function getWebhookUrl() { - return $this->container['name']; + return $this->container['webhook_url']; } /** - * Sets name + * Sets webhook_url * - * @param string|null $name name + * @param string $webhook_url webhook_url * - * @return $this + * @return self */ - public function setName($name) + public function setWebhookUrl($webhook_url) { - $this->container['name'] = $name; + if (is_null($webhook_url)) { + array_push($this->openAPINullablesSetToNull, 'webhook_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('webhook_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['webhook_url'] = $webhook_url; return $this; } /** - * Gets template_type + * Gets slack_webhook_url * - * @return string|null + * @return string */ - public function getTemplateType() + public function getSlackWebhookUrl() { - return $this->container['template_type']; + return $this->container['slack_webhook_url']; } /** - * Sets template_type + * Sets slack_webhook_url * - * @param string|null $template_type template_type + * @param string $slack_webhook_url slack_webhook_url * - * @return $this + * @return self */ - public function setTemplateType($template_type) + public function setSlackWebhookUrl($slack_webhook_url) { - $this->container['template_type'] = $template_type; + if (is_null($slack_webhook_url)) { + array_push($this->openAPINullablesSetToNull, 'slack_webhook_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('slack_webhook_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['slack_webhook_url'] = $slack_webhook_url; return $this; } /** - * Gets id + * Gets redirect_url * - * @return string|null + * @return string */ - public function getId() + public function getRedirectUrl() { - return $this->container['id']; + return $this->container['redirect_url']; } /** - * Sets id + * Sets redirect_url * - * @param string|null $id id + * @param string $redirect_url redirect_url * - * @return $this + * @return self */ - public function setId($id) + public function setRedirectUrl($redirect_url) { - $this->container['id'] = $id; + if (is_null($redirect_url)) { + array_push($this->openAPINullablesSetToNull, 'redirect_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('redirect_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['redirect_url'] = $redirect_url; return $this; } /** - * Gets locked + * Gets path * - * @return bool|null + * @return string|null */ - public function getLocked() + public function getPath() { - return $this->container['locked']; + return $this->container['path']; } /** - * Sets locked + * Sets path * - * @param bool|null $locked locked + * @param string|null $path path * - * @return $this + * @return self */ - public function setLocked($locked) + public function setPath($path) { - $this->container['locked'] = $locked; + if (is_null($path)) { + throw new \InvalidArgumentException('non-nullable path cannot be null'); + } + $this->container['path'] = $path; return $this; } /** - * Gets redirect_url + * Gets parent_folder_id * * @return string|null */ - public function getRedirectUrl() + public function getParentFolderId() { - return $this->container['redirect_url']; + return $this->container['parent_folder_id']; } /** - * Sets redirect_url + * Sets parent_folder_id * - * @param string|null $redirect_url redirect_url + * @param string|null $parent_folder_id parent_folder_id * - * @return $this + * @return self */ - public function setRedirectUrl($redirect_url) + public function setParentFolderId($parent_folder_id) { - $this->container['redirect_url'] = $redirect_url; + if (is_null($parent_folder_id)) { + array_push($this->openAPINullablesSetToNull, 'parent_folder_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('parent_folder_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['parent_folder_id'] = $parent_folder_id; return $this; } @@ -748,7 +983,7 @@ public function setRedirectUrl($redirect_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -758,22 +993,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -789,11 +1025,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -806,6 +1055,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/RenameFolderData.php b/lib/Model/RenameFolderData.php index 0c0bb98..2487b9b 100644 --- a/lib/Model/RenameFolderData.php +++ b/lib/Model/RenameFolderData.php @@ -2,7 +2,7 @@ /** * RenameFolderData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class RenameFolderData implements ModelInterface, ArrayAccess +class RenameFolderData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -64,11 +64,29 @@ class RenameFolderData implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'name' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -89,6 +107,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -158,9 +228,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -177,7 +244,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -222,10 +307,13 @@ public function getName() * * @param string $name name * - * @return $this + * @return self */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -237,7 +325,7 @@ public function setName($name) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -247,22 +335,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -278,11 +367,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -295,6 +397,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/Submission.php b/lib/Model/Submission.php index 20586f4..f6e10c2 100644 --- a/lib/Model/Submission.php +++ b/lib/Model/Submission.php @@ -2,7 +2,7 @@ /** * Submission * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class Submission implements ModelInterface, ArrayAccess +class Submission implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -82,6 +82,8 @@ class Submission implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'id' => null, @@ -105,6 +107,40 @@ class Submission implements ModelInterface, ArrayAccess 'referrer' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'template_id' => false, + 'test' => false, + 'editable' => true, + 'expired' => false, + 'expires_at' => true, + 'processed_at' => true, + 'state' => false, + 'data' => true, + 'metadata' => false, + 'truncated_text' => false, + 'pdf_hash' => true, + 'download_url' => true, + 'permanent_download_url' => true, + 'batch_id' => true, + 'data_requests' => false, + 'actions' => false, + 'source' => true, + 'referrer' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -125,6 +161,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -248,20 +336,18 @@ public function getModelName() return self::$openAPIModelName; } - const STATE_PENDING = 'pending'; - const STATE_PROCESSED = 'processed'; - const STATE_INVALID_DATA = 'invalid_data'; - const STATE_ERROR = 'error'; - const STATE_IMAGE_DOWNLOAD_FAILED = 'image_download_failed'; - const STATE_IMAGE_PROCESSING_FAILED = 'image_processing_failed'; - const STATE_WAITING_FOR_DATA_REQUESTS = 'waiting_for_data_requests'; - const STATE_SYNTAX_ERROR = 'syntax_error'; - const STATE_ACCOUNT_SUSPENDED = 'account_suspended'; - const STATE_LICENSE_REVOKED = 'license_revoked'; - const STATE_ACCIDENTAL = 'accidental'; - + public const STATE_PENDING = 'pending'; + public const STATE_PROCESSED = 'processed'; + public const STATE_INVALID_DATA = 'invalid_data'; + public const STATE_ERROR = 'error'; + public const STATE_IMAGE_DOWNLOAD_FAILED = 'image_download_failed'; + public const STATE_IMAGE_PROCESSING_FAILED = 'image_processing_failed'; + public const STATE_WAITING_FOR_DATA_REQUESTS = 'waiting_for_data_requests'; + public const STATE_SYNTAX_ERROR = 'syntax_error'; + public const STATE_ACCOUNT_SUSPENDED = 'account_suspended'; + public const STATE_LICENSE_REVOKED = 'license_revoked'; + public const STATE_ACCIDENTAL = 'accidental'; - /** * Gets allowable values of the enum * @@ -283,7 +369,6 @@ public function getStateAllowableValues() self::STATE_ACCIDENTAL, ]; } - /** * Associative array for storing property values @@ -300,25 +385,43 @@ public function getStateAllowableValues() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['template_id'] = isset($data['template_id']) ? $data['template_id'] : null; - $this->container['test'] = isset($data['test']) ? $data['test'] : null; - $this->container['editable'] = isset($data['editable']) ? $data['editable'] : null; - $this->container['expired'] = isset($data['expired']) ? $data['expired'] : null; - $this->container['expires_at'] = isset($data['expires_at']) ? $data['expires_at'] : null; - $this->container['processed_at'] = isset($data['processed_at']) ? $data['processed_at'] : null; - $this->container['state'] = isset($data['state']) ? $data['state'] : null; - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; - $this->container['truncated_text'] = isset($data['truncated_text']) ? $data['truncated_text'] : null; - $this->container['pdf_hash'] = isset($data['pdf_hash']) ? $data['pdf_hash'] : null; - $this->container['download_url'] = isset($data['download_url']) ? $data['download_url'] : null; - $this->container['permanent_download_url'] = isset($data['permanent_download_url']) ? $data['permanent_download_url'] : null; - $this->container['batch_id'] = isset($data['batch_id']) ? $data['batch_id'] : null; - $this->container['data_requests'] = isset($data['data_requests']) ? $data['data_requests'] : null; - $this->container['actions'] = isset($data['actions']) ? $data['actions'] : null; - $this->container['source'] = isset($data['source']) ? $data['source'] : null; - $this->container['referrer'] = isset($data['referrer']) ? $data['referrer'] : null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('template_id', $data ?? [], null); + $this->setIfExists('test', $data ?? [], null); + $this->setIfExists('editable', $data ?? [], null); + $this->setIfExists('expired', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + $this->setIfExists('processed_at', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('truncated_text', $data ?? [], null); + $this->setIfExists('pdf_hash', $data ?? [], null); + $this->setIfExists('download_url', $data ?? [], null); + $this->setIfExists('permanent_download_url', $data ?? [], null); + $this->setIfExists('batch_id', $data ?? [], null); + $this->setIfExists('data_requests', $data ?? [], null); + $this->setIfExists('actions', $data ?? [], null); + $this->setIfExists('source', $data ?? [], null); + $this->setIfExists('referrer', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -345,7 +448,8 @@ public function listInvalidProperties() $allowedValues = $this->getStateAllowableValues(); if (!is_null($this->container['state']) && !in_array($this->container['state'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'state', must be one of '%s'", + "invalid value '%s' for 'state', must be one of '%s'", + $this->container['state'], implode("', '", $allowedValues) ); } @@ -380,10 +484,13 @@ public function getId() * * @param string $id id * - * @return $this + * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -404,10 +511,13 @@ public function getTemplateId() * * @param string|null $template_id template_id * - * @return $this + * @return self */ public function setTemplateId($template_id) { + if (is_null($template_id)) { + throw new \InvalidArgumentException('non-nullable template_id cannot be null'); + } $this->container['template_id'] = $template_id; return $this; @@ -428,10 +538,13 @@ public function getTest() * * @param bool $test test * - * @return $this + * @return self */ public function setTest($test) { + if (is_null($test)) { + throw new \InvalidArgumentException('non-nullable test cannot be null'); + } $this->container['test'] = $test; return $this; @@ -452,10 +565,20 @@ public function getEditable() * * @param bool|null $editable editable * - * @return $this + * @return self */ public function setEditable($editable) { + if (is_null($editable)) { + array_push($this->openAPINullablesSetToNull, 'editable'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('editable', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['editable'] = $editable; return $this; @@ -476,10 +599,13 @@ public function getExpired() * * @param bool $expired expired * - * @return $this + * @return self */ public function setExpired($expired) { + if (is_null($expired)) { + throw new \InvalidArgumentException('non-nullable expired cannot be null'); + } $this->container['expired'] = $expired; return $this; @@ -500,10 +626,20 @@ public function getExpiresAt() * * @param string|null $expires_at expires_at * - * @return $this + * @return self */ public function setExpiresAt($expires_at) { + if (is_null($expires_at)) { + array_push($this->openAPINullablesSetToNull, 'expires_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('expires_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['expires_at'] = $expires_at; return $this; @@ -524,10 +660,20 @@ public function getProcessedAt() * * @param string|null $processed_at processed_at * - * @return $this + * @return self */ public function setProcessedAt($processed_at) { + if (is_null($processed_at)) { + array_push($this->openAPINullablesSetToNull, 'processed_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('processed_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['processed_at'] = $processed_at; return $this; @@ -548,15 +694,19 @@ public function getState() * * @param string $state state * - * @return $this + * @return self */ public function setState($state) { + if (is_null($state)) { + throw new \InvalidArgumentException('non-nullable state cannot be null'); + } $allowedValues = $this->getStateAllowableValues(); if (!in_array($state, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'state', must be one of '%s'", + "Invalid value '%s' for 'state', must be one of '%s'", + $state, implode("', '", $allowedValues) ) ); @@ -581,10 +731,20 @@ public function getData() * * @param object|null $data data * - * @return $this + * @return self */ public function setData($data) { + if (is_null($data)) { + array_push($this->openAPINullablesSetToNull, 'data'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('data', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['data'] = $data; return $this; @@ -605,10 +765,13 @@ public function getMetadata() * * @param object|null $metadata metadata * - * @return $this + * @return self */ public function setMetadata($metadata) { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } $this->container['metadata'] = $metadata; return $this; @@ -629,10 +792,13 @@ public function getTruncatedText() * * @param object|null $truncated_text truncated_text * - * @return $this + * @return self */ public function setTruncatedText($truncated_text) { + if (is_null($truncated_text)) { + throw new \InvalidArgumentException('non-nullable truncated_text cannot be null'); + } $this->container['truncated_text'] = $truncated_text; return $this; @@ -653,10 +819,20 @@ public function getPdfHash() * * @param string|null $pdf_hash pdf_hash * - * @return $this + * @return self */ public function setPdfHash($pdf_hash) { + if (is_null($pdf_hash)) { + array_push($this->openAPINullablesSetToNull, 'pdf_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pdf_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['pdf_hash'] = $pdf_hash; return $this; @@ -677,10 +853,20 @@ public function getDownloadUrl() * * @param string|null $download_url download_url * - * @return $this + * @return self */ public function setDownloadUrl($download_url) { + if (is_null($download_url)) { + array_push($this->openAPINullablesSetToNull, 'download_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('download_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['download_url'] = $download_url; return $this; @@ -701,10 +887,20 @@ public function getPermanentDownloadUrl() * * @param string|null $permanent_download_url permanent_download_url * - * @return $this + * @return self */ public function setPermanentDownloadUrl($permanent_download_url) { + if (is_null($permanent_download_url)) { + array_push($this->openAPINullablesSetToNull, 'permanent_download_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('permanent_download_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['permanent_download_url'] = $permanent_download_url; return $this; @@ -725,10 +921,20 @@ public function getBatchId() * * @param string|null $batch_id batch_id * - * @return $this + * @return self */ public function setBatchId($batch_id) { + if (is_null($batch_id)) { + array_push($this->openAPINullablesSetToNull, 'batch_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('batch_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['batch_id'] = $batch_id; return $this; @@ -749,10 +955,13 @@ public function getDataRequests() * * @param \DocSpring\Model\SubmissionDataRequest[]|null $data_requests data_requests * - * @return $this + * @return self */ public function setDataRequests($data_requests) { + if (is_null($data_requests)) { + throw new \InvalidArgumentException('non-nullable data_requests cannot be null'); + } $this->container['data_requests'] = $data_requests; return $this; @@ -773,10 +982,13 @@ public function getActions() * * @param \DocSpring\Model\SubmissionAction[]|null $actions actions * - * @return $this + * @return self */ public function setActions($actions) { + if (is_null($actions)) { + throw new \InvalidArgumentException('non-nullable actions cannot be null'); + } $this->container['actions'] = $actions; return $this; @@ -797,10 +1009,20 @@ public function getSource() * * @param string|null $source source * - * @return $this + * @return self */ public function setSource($source) { + if (is_null($source)) { + array_push($this->openAPINullablesSetToNull, 'source'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('source', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['source'] = $source; return $this; @@ -821,10 +1043,20 @@ public function getReferrer() * * @param string|null $referrer referrer * - * @return $this + * @return self */ public function setReferrer($referrer) { + if (is_null($referrer)) { + array_push($this->openAPINullablesSetToNull, 'referrer'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('referrer', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['referrer'] = $referrer; return $this; @@ -836,7 +1068,7 @@ public function setReferrer($referrer) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -846,22 +1078,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -877,11 +1110,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -894,6 +1140,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/SubmissionAction.php b/lib/Model/SubmissionAction.php index 116e441..88d6fe2 100644 --- a/lib/Model/SubmissionAction.php +++ b/lib/Model/SubmissionAction.php @@ -2,7 +2,7 @@ /** * SubmissionAction * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class SubmissionAction implements ModelInterface, ArrayAccess +class SubmissionAction implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -69,6 +69,8 @@ class SubmissionAction implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'id' => null, @@ -79,6 +81,27 @@ class SubmissionAction implements ModelInterface, ArrayAccess 'result_data' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'integration_id' => true, + 'state' => false, + 'action_category' => false, + 'action_type' => false, + 'result_data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -99,6 +122,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -183,19 +258,17 @@ public function getModelName() return self::$openAPIModelName; } - const STATE_PENDING = 'pending'; - const STATE_PROCESSED = 'processed'; - const STATE_FAILED = 'failed'; - const STATE_ERROR = 'error'; - const ACTION_CATEGORY_NOTIFICATION = 'notification'; - const ACTION_CATEGORY_FILE_UPLOAD = 'file_upload'; - const ACTION_TYPE_WEBHOOK = 'webhook'; - const ACTION_TYPE_SLACK_WEBHOOK = 'slack_webhook'; - const ACTION_TYPE_EMAIL = 'email'; - const ACTION_TYPE_AWS_S3_UPLOAD = 'aws_s3_upload'; - + public const STATE_PENDING = 'pending'; + public const STATE_PROCESSED = 'processed'; + public const STATE_FAILED = 'failed'; + public const STATE_ERROR = 'error'; + public const ACTION_CATEGORY_NOTIFICATION = 'notification'; + public const ACTION_CATEGORY_FILE_UPLOAD = 'file_upload'; + public const ACTION_TYPE_WEBHOOK = 'webhook'; + public const ACTION_TYPE_SLACK_WEBHOOK = 'slack_webhook'; + public const ACTION_TYPE_EMAIL = 'email'; + public const ACTION_TYPE_AWS_S3_UPLOAD = 'aws_s3_upload'; - /** * Gets allowable values of the enum * @@ -210,7 +283,7 @@ public function getStateAllowableValues() self::STATE_ERROR, ]; } - + /** * Gets allowable values of the enum * @@ -223,7 +296,7 @@ public function getActionCategoryAllowableValues() self::ACTION_CATEGORY_FILE_UPLOAD, ]; } - + /** * Gets allowable values of the enum * @@ -238,7 +311,6 @@ public function getActionTypeAllowableValues() self::ACTION_TYPE_AWS_S3_UPLOAD, ]; } - /** * Associative array for storing property values @@ -255,12 +327,30 @@ public function getActionTypeAllowableValues() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['integration_id'] = isset($data['integration_id']) ? $data['integration_id'] : null; - $this->container['state'] = isset($data['state']) ? $data['state'] : null; - $this->container['action_category'] = isset($data['action_category']) ? $data['action_category'] : null; - $this->container['action_type'] = isset($data['action_type']) ? $data['action_type'] : null; - $this->container['result_data'] = isset($data['result_data']) ? $data['result_data'] : null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('integration_id', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('action_category', $data ?? [], null); + $this->setIfExists('action_type', $data ?? [], null); + $this->setIfExists('result_data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -284,7 +374,8 @@ public function listInvalidProperties() $allowedValues = $this->getStateAllowableValues(); if (!is_null($this->container['state']) && !in_array($this->container['state'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'state', must be one of '%s'", + "invalid value '%s' for 'state', must be one of '%s'", + $this->container['state'], implode("', '", $allowedValues) ); } @@ -295,7 +386,8 @@ public function listInvalidProperties() $allowedValues = $this->getActionCategoryAllowableValues(); if (!is_null($this->container['action_category']) && !in_array($this->container['action_category'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'action_category', must be one of '%s'", + "invalid value '%s' for 'action_category', must be one of '%s'", + $this->container['action_category'], implode("', '", $allowedValues) ); } @@ -306,7 +398,8 @@ public function listInvalidProperties() $allowedValues = $this->getActionTypeAllowableValues(); if (!is_null($this->container['action_type']) && !in_array($this->container['action_type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'action_type', must be one of '%s'", + "invalid value '%s' for 'action_type', must be one of '%s'", + $this->container['action_type'], implode("', '", $allowedValues) ); } @@ -344,10 +437,13 @@ public function getId() * * @param string $id id * - * @return $this + * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -368,10 +464,20 @@ public function getIntegrationId() * * @param string $integration_id integration_id * - * @return $this + * @return self */ public function setIntegrationId($integration_id) { + if (is_null($integration_id)) { + array_push($this->openAPINullablesSetToNull, 'integration_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('integration_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['integration_id'] = $integration_id; return $this; @@ -392,15 +498,19 @@ public function getState() * * @param string $state state * - * @return $this + * @return self */ public function setState($state) { + if (is_null($state)) { + throw new \InvalidArgumentException('non-nullable state cannot be null'); + } $allowedValues = $this->getStateAllowableValues(); if (!in_array($state, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'state', must be one of '%s'", + "Invalid value '%s' for 'state', must be one of '%s'", + $state, implode("', '", $allowedValues) ) ); @@ -425,15 +535,19 @@ public function getActionCategory() * * @param string $action_category action_category * - * @return $this + * @return self */ public function setActionCategory($action_category) { + if (is_null($action_category)) { + throw new \InvalidArgumentException('non-nullable action_category cannot be null'); + } $allowedValues = $this->getActionCategoryAllowableValues(); if (!in_array($action_category, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'action_category', must be one of '%s'", + "Invalid value '%s' for 'action_category', must be one of '%s'", + $action_category, implode("', '", $allowedValues) ) ); @@ -458,15 +572,19 @@ public function getActionType() * * @param string $action_type action_type * - * @return $this + * @return self */ public function setActionType($action_type) { + if (is_null($action_type)) { + throw new \InvalidArgumentException('non-nullable action_type cannot be null'); + } $allowedValues = $this->getActionTypeAllowableValues(); if (!in_array($action_type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'action_type', must be one of '%s'", + "Invalid value '%s' for 'action_type', must be one of '%s'", + $action_type, implode("', '", $allowedValues) ) ); @@ -491,10 +609,13 @@ public function getResultData() * * @param object $result_data result_data * - * @return $this + * @return self */ public function setResultData($result_data) { + if (is_null($result_data)) { + throw new \InvalidArgumentException('non-nullable result_data cannot be null'); + } $this->container['result_data'] = $result_data; return $this; @@ -506,7 +627,7 @@ public function setResultData($result_data) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -516,22 +637,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -547,11 +669,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -564,6 +699,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/SubmissionBatch.php b/lib/Model/SubmissionBatch.php index 5a2662a..2aeba26 100644 --- a/lib/Model/SubmissionBatch.php +++ b/lib/Model/SubmissionBatch.php @@ -2,7 +2,7 @@ /** * SubmissionBatch * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class SubmissionBatch implements ModelInterface, ArrayAccess +class SubmissionBatch implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,34 +57,60 @@ class SubmissionBatch implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ + 'id' => 'string', + 'total_count' => 'int', 'pending_count' => 'int', + 'error_count' => 'int', 'completion_percentage' => 'int', - 'metadata' => 'object', - 'total_count' => 'int', - 'submissions' => '\DocSpring\Model\Submission[]', - 'processed_at' => 'string', - 'id' => 'string', 'state' => 'string', - 'error_count' => 'int' + 'processed_at' => 'string', + 'metadata' => 'object', + 'submissions' => '\DocSpring\Model\Submission[]' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ + 'id' => null, + 'total_count' => null, 'pending_count' => null, + 'error_count' => null, 'completion_percentage' => null, - 'metadata' => null, - 'total_count' => null, - 'submissions' => null, - 'processed_at' => null, - 'id' => null, 'state' => null, - 'error_count' => null + 'processed_at' => null, + 'metadata' => null, + 'submissions' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'total_count' => false, + 'pending_count' => false, + 'error_count' => false, + 'completion_percentage' => false, + 'state' => false, + 'processed_at' => true, + 'metadata' => false, + 'submissions' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -105,6 +131,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -112,15 +190,15 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'id' => 'id', + 'total_count' => 'total_count', 'pending_count' => 'pending_count', + 'error_count' => 'error_count', 'completion_percentage' => 'completion_percentage', - 'metadata' => 'metadata', - 'total_count' => 'total_count', - 'submissions' => 'submissions', - 'processed_at' => 'processed_at', - 'id' => 'id', 'state' => 'state', - 'error_count' => 'error_count' + 'processed_at' => 'processed_at', + 'metadata' => 'metadata', + 'submissions' => 'submissions' ]; /** @@ -129,15 +207,15 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'id' => 'setId', + 'total_count' => 'setTotalCount', 'pending_count' => 'setPendingCount', + 'error_count' => 'setErrorCount', 'completion_percentage' => 'setCompletionPercentage', - 'metadata' => 'setMetadata', - 'total_count' => 'setTotalCount', - 'submissions' => 'setSubmissions', - 'processed_at' => 'setProcessedAt', - 'id' => 'setId', 'state' => 'setState', - 'error_count' => 'setErrorCount' + 'processed_at' => 'setProcessedAt', + 'metadata' => 'setMetadata', + 'submissions' => 'setSubmissions' ]; /** @@ -146,15 +224,15 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'id' => 'getId', + 'total_count' => 'getTotalCount', 'pending_count' => 'getPendingCount', + 'error_count' => 'getErrorCount', 'completion_percentage' => 'getCompletionPercentage', - 'metadata' => 'getMetadata', - 'total_count' => 'getTotalCount', - 'submissions' => 'getSubmissions', - 'processed_at' => 'getProcessedAt', - 'id' => 'getId', 'state' => 'getState', - 'error_count' => 'getErrorCount' + 'processed_at' => 'getProcessedAt', + 'metadata' => 'getMetadata', + 'submissions' => 'getSubmissions' ]; /** @@ -198,12 +276,10 @@ public function getModelName() return self::$openAPIModelName; } - const STATE_PENDING = 'pending'; - const STATE_PROCESSED = 'processed'; - const STATE_ERROR = 'error'; - + public const STATE_PENDING = 'pending'; + public const STATE_PROCESSED = 'processed'; + public const STATE_ERROR = 'error'; - /** * Gets allowable values of the enum * @@ -217,7 +293,6 @@ public function getStateAllowableValues() self::STATE_ERROR, ]; } - /** * Associative array for storing property values @@ -234,15 +309,33 @@ public function getStateAllowableValues() */ public function __construct(array $data = null) { - $this->container['pending_count'] = isset($data['pending_count']) ? $data['pending_count'] : null; - $this->container['completion_percentage'] = isset($data['completion_percentage']) ? $data['completion_percentage'] : null; - $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; - $this->container['total_count'] = isset($data['total_count']) ? $data['total_count'] : null; - $this->container['submissions'] = isset($data['submissions']) ? $data['submissions'] : null; - $this->container['processed_at'] = isset($data['processed_at']) ? $data['processed_at'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['state'] = isset($data['state']) ? $data['state'] : null; - $this->container['error_count'] = isset($data['error_count']) ? $data['error_count'] : null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('total_count', $data ?? [], null); + $this->setIfExists('pending_count', $data ?? [], null); + $this->setIfExists('error_count', $data ?? [], null); + $this->setIfExists('completion_percentage', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('processed_at', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('submissions', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -254,14 +347,39 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['total_count'] === null) { + $invalidProperties[] = "'total_count' can't be null"; + } + if ($this->container['pending_count'] === null) { + $invalidProperties[] = "'pending_count' can't be null"; + } + if ($this->container['error_count'] === null) { + $invalidProperties[] = "'error_count' can't be null"; + } + if ($this->container['completion_percentage'] === null) { + $invalidProperties[] = "'completion_percentage' can't be null"; + } + if ($this->container['state'] === null) { + $invalidProperties[] = "'state' can't be null"; + } $allowedValues = $this->getStateAllowableValues(); if (!is_null($this->container['state']) && !in_array($this->container['state'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'state', must be one of '%s'", + "invalid value '%s' for 'state', must be one of '%s'", + $this->container['state'], implode("', '", $allowedValues) ); } + if ($this->container['processed_at'] === null) { + $invalidProperties[] = "'processed_at' can't be null"; + } + if ($this->container['metadata'] === null) { + $invalidProperties[] = "'metadata' can't be null"; + } return $invalidProperties; } @@ -278,226 +396,261 @@ public function valid() /** - * Gets pending_count + * Gets id * - * @return int|null + * @return string */ - public function getPendingCount() + public function getId() { - return $this->container['pending_count']; + return $this->container['id']; } /** - * Sets pending_count + * Sets id * - * @param int|null $pending_count pending_count + * @param string $id id * - * @return $this + * @return self */ - public function setPendingCount($pending_count) + public function setId($id) { - $this->container['pending_count'] = $pending_count; + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; return $this; } /** - * Gets completion_percentage + * Gets total_count * - * @return int|null + * @return int */ - public function getCompletionPercentage() + public function getTotalCount() { - return $this->container['completion_percentage']; + return $this->container['total_count']; } /** - * Sets completion_percentage + * Sets total_count * - * @param int|null $completion_percentage completion_percentage + * @param int $total_count total_count * - * @return $this + * @return self */ - public function setCompletionPercentage($completion_percentage) + public function setTotalCount($total_count) { - $this->container['completion_percentage'] = $completion_percentage; + if (is_null($total_count)) { + throw new \InvalidArgumentException('non-nullable total_count cannot be null'); + } + $this->container['total_count'] = $total_count; return $this; } /** - * Gets metadata + * Gets pending_count * - * @return object|null + * @return int */ - public function getMetadata() + public function getPendingCount() { - return $this->container['metadata']; + return $this->container['pending_count']; } /** - * Sets metadata + * Sets pending_count * - * @param object|null $metadata metadata + * @param int $pending_count pending_count * - * @return $this + * @return self */ - public function setMetadata($metadata) + public function setPendingCount($pending_count) { - $this->container['metadata'] = $metadata; + if (is_null($pending_count)) { + throw new \InvalidArgumentException('non-nullable pending_count cannot be null'); + } + $this->container['pending_count'] = $pending_count; return $this; } /** - * Gets total_count + * Gets error_count * - * @return int|null + * @return int */ - public function getTotalCount() + public function getErrorCount() { - return $this->container['total_count']; + return $this->container['error_count']; } /** - * Sets total_count + * Sets error_count * - * @param int|null $total_count total_count + * @param int $error_count error_count * - * @return $this + * @return self */ - public function setTotalCount($total_count) + public function setErrorCount($error_count) { - $this->container['total_count'] = $total_count; + if (is_null($error_count)) { + throw new \InvalidArgumentException('non-nullable error_count cannot be null'); + } + $this->container['error_count'] = $error_count; return $this; } /** - * Gets submissions + * Gets completion_percentage * - * @return \DocSpring\Model\Submission[]|null + * @return int */ - public function getSubmissions() + public function getCompletionPercentage() { - return $this->container['submissions']; + return $this->container['completion_percentage']; } /** - * Sets submissions + * Sets completion_percentage * - * @param \DocSpring\Model\Submission[]|null $submissions submissions + * @param int $completion_percentage completion_percentage * - * @return $this + * @return self */ - public function setSubmissions($submissions) + public function setCompletionPercentage($completion_percentage) { - $this->container['submissions'] = $submissions; + if (is_null($completion_percentage)) { + throw new \InvalidArgumentException('non-nullable completion_percentage cannot be null'); + } + $this->container['completion_percentage'] = $completion_percentage; return $this; } /** - * Gets processed_at + * Gets state * - * @return string|null + * @return string */ - public function getProcessedAt() + public function getState() { - return $this->container['processed_at']; + return $this->container['state']; } /** - * Sets processed_at + * Sets state * - * @param string|null $processed_at processed_at + * @param string $state state * - * @return $this + * @return self */ - public function setProcessedAt($processed_at) + public function setState($state) { - $this->container['processed_at'] = $processed_at; + if (is_null($state)) { + throw new \InvalidArgumentException('non-nullable state cannot be null'); + } + $allowedValues = $this->getStateAllowableValues(); + if (!in_array($state, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'state', must be one of '%s'", + $state, + implode("', '", $allowedValues) + ) + ); + } + $this->container['state'] = $state; return $this; } /** - * Gets id + * Gets processed_at * - * @return string|null + * @return string */ - public function getId() + public function getProcessedAt() { - return $this->container['id']; + return $this->container['processed_at']; } /** - * Sets id + * Sets processed_at * - * @param string|null $id id + * @param string $processed_at processed_at * - * @return $this + * @return self */ - public function setId($id) + public function setProcessedAt($processed_at) { - $this->container['id'] = $id; + if (is_null($processed_at)) { + array_push($this->openAPINullablesSetToNull, 'processed_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('processed_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['processed_at'] = $processed_at; return $this; } /** - * Gets state + * Gets metadata * - * @return string|null + * @return object */ - public function getState() + public function getMetadata() { - return $this->container['state']; + return $this->container['metadata']; } /** - * Sets state + * Sets metadata * - * @param string|null $state state + * @param object $metadata metadata * - * @return $this + * @return self */ - public function setState($state) + public function setMetadata($metadata) { - $allowedValues = $this->getStateAllowableValues(); - if (!is_null($state) && !in_array($state, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'state', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); } - $this->container['state'] = $state; + $this->container['metadata'] = $metadata; return $this; } /** - * Gets error_count + * Gets submissions * - * @return int|null + * @return \DocSpring\Model\Submission[]|null */ - public function getErrorCount() + public function getSubmissions() { - return $this->container['error_count']; + return $this->container['submissions']; } /** - * Sets error_count + * Sets submissions * - * @param int|null $error_count error_count + * @param \DocSpring\Model\Submission[]|null $submissions submissions * - * @return $this + * @return self */ - public function setErrorCount($error_count) + public function setSubmissions($submissions) { - $this->container['error_count'] = $error_count; + if (is_null($submissions)) { + throw new \InvalidArgumentException('non-nullable submissions cannot be null'); + } + $this->container['submissions'] = $submissions; return $this; } @@ -508,7 +661,7 @@ public function setErrorCount($error_count) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -518,22 +671,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -549,11 +703,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -566,6 +733,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/SubmissionBatchData.php b/lib/Model/SubmissionBatchData.php index ee55c67..3d650b6 100644 --- a/lib/Model/SubmissionBatchData.php +++ b/lib/Model/SubmissionBatchData.php @@ -2,7 +2,7 @@ /** * SubmissionBatchData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class SubmissionBatchData implements ModelInterface, ArrayAccess +class SubmissionBatchData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -67,6 +67,8 @@ class SubmissionBatchData implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'metadata' => null, @@ -75,6 +77,25 @@ class SubmissionBatchData implements ModelInterface, ArrayAccess 'test' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'metadata' => false, + 'submissions' => false, + 'template_id' => true, + 'test' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -95,6 +116,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -173,9 +246,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -192,10 +262,28 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; - $this->container['submissions'] = isset($data['submissions']) ? $data['submissions'] : null; - $this->container['template_id'] = isset($data['template_id']) ? $data['template_id'] : null; - $this->container['test'] = isset($data['test']) ? $data['test'] : null; + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('submissions', $data ?? [], null); + $this->setIfExists('template_id', $data ?? [], null); + $this->setIfExists('test', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -240,10 +328,13 @@ public function getMetadata() * * @param object|null $metadata metadata * - * @return $this + * @return self */ public function setMetadata($metadata) { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } $this->container['metadata'] = $metadata; return $this; @@ -264,10 +355,13 @@ public function getSubmissions() * * @param \DocSpring\Model\SubmissionDataBatchRequest[] $submissions submissions * - * @return $this + * @return self */ public function setSubmissions($submissions) { + if (is_null($submissions)) { + throw new \InvalidArgumentException('non-nullable submissions cannot be null'); + } $this->container['submissions'] = $submissions; return $this; @@ -288,10 +382,20 @@ public function getTemplateId() * * @param string|null $template_id template_id * - * @return $this + * @return self */ public function setTemplateId($template_id) { + if (is_null($template_id)) { + array_push($this->openAPINullablesSetToNull, 'template_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('template_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['template_id'] = $template_id; return $this; @@ -312,10 +416,13 @@ public function getTest() * * @param bool|null $test test * - * @return $this + * @return self */ public function setTest($test) { + if (is_null($test)) { + throw new \InvalidArgumentException('non-nullable test cannot be null'); + } $this->container['test'] = $test; return $this; @@ -327,7 +434,7 @@ public function setTest($test) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -337,22 +444,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -368,11 +476,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -385,6 +506,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/SubmissionData.php b/lib/Model/SubmissionData.php index 63ec34f..f06eba3 100644 --- a/lib/Model/SubmissionData.php +++ b/lib/Model/SubmissionData.php @@ -2,7 +2,7 @@ /** * SubmissionData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class SubmissionData implements ModelInterface, ArrayAccess +class SubmissionData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -60,11 +60,8 @@ class SubmissionData implements ModelInterface, ArrayAccess 'css' => 'string', 'data' => 'object', 'data_requests' => '\DocSpring\Model\CreateSubmissionDataRequestData[]', - 'expires_in' => 'int', - 'field_overrides' => 'object', 'html' => 'string', 'metadata' => 'object', - 'password' => 'string', 'test' => 'bool' ]; @@ -72,19 +69,39 @@ class SubmissionData implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'css' => null, 'data' => null, 'data_requests' => null, - 'expires_in' => null, - 'field_overrides' => null, 'html' => null, 'metadata' => null, - 'password' => null, 'test' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'css' => false, + 'data' => false, + 'data_requests' => false, + 'html' => false, + 'metadata' => false, + 'test' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -105,6 +122,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -115,11 +184,8 @@ public static function openAPIFormats() 'css' => 'css', 'data' => 'data', 'data_requests' => 'data_requests', - 'expires_in' => 'expires_in', - 'field_overrides' => 'field_overrides', 'html' => 'html', 'metadata' => 'metadata', - 'password' => 'password', 'test' => 'test' ]; @@ -132,11 +198,8 @@ public static function openAPIFormats() 'css' => 'setCss', 'data' => 'setData', 'data_requests' => 'setDataRequests', - 'expires_in' => 'setExpiresIn', - 'field_overrides' => 'setFieldOverrides', 'html' => 'setHtml', 'metadata' => 'setMetadata', - 'password' => 'setPassword', 'test' => 'setTest' ]; @@ -149,11 +212,8 @@ public static function openAPIFormats() 'css' => 'getCss', 'data' => 'getData', 'data_requests' => 'getDataRequests', - 'expires_in' => 'getExpiresIn', - 'field_overrides' => 'getFieldOverrides', 'html' => 'getHtml', 'metadata' => 'getMetadata', - 'password' => 'getPassword', 'test' => 'getTest' ]; @@ -198,9 +258,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -217,15 +274,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['css'] = isset($data['css']) ? $data['css'] : null; - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['data_requests'] = isset($data['data_requests']) ? $data['data_requests'] : null; - $this->container['expires_in'] = isset($data['expires_in']) ? $data['expires_in'] : null; - $this->container['field_overrides'] = isset($data['field_overrides']) ? $data['field_overrides'] : null; - $this->container['html'] = isset($data['html']) ? $data['html'] : null; - $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; - $this->container['password'] = isset($data['password']) ? $data['password'] : null; - $this->container['test'] = isset($data['test']) ? $data['test'] : null; + $this->setIfExists('css', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('data_requests', $data ?? [], null); + $this->setIfExists('html', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('test', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -270,10 +342,13 @@ public function getCss() * * @param string|null $css css * - * @return $this + * @return self */ public function setCss($css) { + if (is_null($css)) { + throw new \InvalidArgumentException('non-nullable css cannot be null'); + } $this->container['css'] = $css; return $this; @@ -294,10 +369,13 @@ public function getData() * * @param object $data data * - * @return $this + * @return self */ public function setData($data) { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } $this->container['data'] = $data; return $this; @@ -318,63 +396,18 @@ public function getDataRequests() * * @param \DocSpring\Model\CreateSubmissionDataRequestData[]|null $data_requests data_requests * - * @return $this + * @return self */ public function setDataRequests($data_requests) { + if (is_null($data_requests)) { + throw new \InvalidArgumentException('non-nullable data_requests cannot be null'); + } $this->container['data_requests'] = $data_requests; return $this; } - /** - * Gets expires_in - * - * @return int|null - */ - public function getExpiresIn() - { - return $this->container['expires_in']; - } - - /** - * Sets expires_in - * - * @param int|null $expires_in expires_in - * - * @return $this - */ - public function setExpiresIn($expires_in) - { - $this->container['expires_in'] = $expires_in; - - return $this; - } - - /** - * Gets field_overrides - * - * @return object|null - */ - public function getFieldOverrides() - { - return $this->container['field_overrides']; - } - - /** - * Sets field_overrides - * - * @param object|null $field_overrides field_overrides - * - * @return $this - */ - public function setFieldOverrides($field_overrides) - { - $this->container['field_overrides'] = $field_overrides; - - return $this; - } - /** * Gets html * @@ -390,10 +423,13 @@ public function getHtml() * * @param string|null $html html * - * @return $this + * @return self */ public function setHtml($html) { + if (is_null($html)) { + throw new \InvalidArgumentException('non-nullable html cannot be null'); + } $this->container['html'] = $html; return $this; @@ -414,39 +450,18 @@ public function getMetadata() * * @param object|null $metadata metadata * - * @return $this + * @return self */ public function setMetadata($metadata) { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } $this->container['metadata'] = $metadata; return $this; } - /** - * Gets password - * - * @return string|null - */ - public function getPassword() - { - return $this->container['password']; - } - - /** - * Sets password - * - * @param string|null $password password - * - * @return $this - */ - public function setPassword($password) - { - $this->container['password'] = $password; - - return $this; - } - /** * Gets test * @@ -462,10 +477,13 @@ public function getTest() * * @param bool|null $test test * - * @return $this + * @return self */ public function setTest($test) { + if (is_null($test)) { + throw new \InvalidArgumentException('non-nullable test cannot be null'); + } $this->container['test'] = $test; return $this; @@ -477,7 +495,7 @@ public function setTest($test) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -487,22 +505,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -518,11 +537,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -535,6 +567,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/SubmissionDataBatchRequest.php b/lib/Model/SubmissionDataBatchRequest.php index da090ab..63a4b2b 100644 --- a/lib/Model/SubmissionDataBatchRequest.php +++ b/lib/Model/SubmissionDataBatchRequest.php @@ -2,7 +2,7 @@ /** * SubmissionDataBatchRequest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class SubmissionDataBatchRequest implements ModelInterface, ArrayAccess +class SubmissionDataBatchRequest implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -58,27 +58,50 @@ class SubmissionDataBatchRequest implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'css' => 'string', - 'metadata' => 'object', 'data' => 'object', - 'test' => 'bool', 'html' => 'string', - 'template_id' => 'string' + 'metadata' => 'object', + 'template_id' => 'string', + 'test' => 'bool' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'css' => null, - 'metadata' => null, 'data' => null, - 'test' => null, 'html' => null, - 'template_id' => null + 'metadata' => null, + 'template_id' => null, + 'test' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'css' => false, + 'data' => false, + 'html' => false, + 'metadata' => false, + 'template_id' => true, + 'test' => false ]; + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -99,6 +122,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -107,11 +182,11 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'css' => 'css', - 'metadata' => 'metadata', 'data' => 'data', - 'test' => 'test', 'html' => 'html', - 'template_id' => 'template_id' + 'metadata' => 'metadata', + 'template_id' => 'template_id', + 'test' => 'test' ]; /** @@ -121,11 +196,11 @@ public static function openAPIFormats() */ protected static $setters = [ 'css' => 'setCss', - 'metadata' => 'setMetadata', 'data' => 'setData', - 'test' => 'setTest', 'html' => 'setHtml', - 'template_id' => 'setTemplateId' + 'metadata' => 'setMetadata', + 'template_id' => 'setTemplateId', + 'test' => 'setTest' ]; /** @@ -135,11 +210,11 @@ public static function openAPIFormats() */ protected static $getters = [ 'css' => 'getCss', - 'metadata' => 'getMetadata', 'data' => 'getData', - 'test' => 'getTest', 'html' => 'getHtml', - 'template_id' => 'getTemplateId' + 'metadata' => 'getMetadata', + 'template_id' => 'getTemplateId', + 'test' => 'getTest' ]; /** @@ -183,9 +258,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -202,12 +274,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['css'] = isset($data['css']) ? $data['css'] : null; - $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['test'] = isset($data['test']) ? $data['test'] : null; - $this->container['html'] = isset($data['html']) ? $data['html'] : null; - $this->container['template_id'] = isset($data['template_id']) ? $data['template_id'] : null; + $this->setIfExists('css', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('html', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('template_id', $data ?? [], null); + $this->setIfExists('test', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -219,6 +309,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['template_id'] === null) { + $invalidProperties[] = "'template_id' can't be null"; + } return $invalidProperties; } @@ -249,131 +345,156 @@ public function getCss() * * @param string|null $css css * - * @return $this + * @return self */ public function setCss($css) { + if (is_null($css)) { + throw new \InvalidArgumentException('non-nullable css cannot be null'); + } $this->container['css'] = $css; return $this; } /** - * Gets metadata + * Gets data * - * @return object|null + * @return object */ - public function getMetadata() + public function getData() { - return $this->container['metadata']; + return $this->container['data']; } /** - * Sets metadata + * Sets data * - * @param object|null $metadata metadata + * @param object $data data * - * @return $this + * @return self */ - public function setMetadata($metadata) + public function setData($data) { - $this->container['metadata'] = $metadata; + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; return $this; } /** - * Gets data + * Gets html * - * @return object|null + * @return string|null */ - public function getData() + public function getHtml() { - return $this->container['data']; + return $this->container['html']; } /** - * Sets data + * Sets html * - * @param object|null $data data + * @param string|null $html html * - * @return $this + * @return self */ - public function setData($data) + public function setHtml($html) { - $this->container['data'] = $data; + if (is_null($html)) { + throw new \InvalidArgumentException('non-nullable html cannot be null'); + } + $this->container['html'] = $html; return $this; } /** - * Gets test + * Gets metadata * - * @return bool|null + * @return object|null */ - public function getTest() + public function getMetadata() { - return $this->container['test']; + return $this->container['metadata']; } /** - * Sets test + * Sets metadata * - * @param bool|null $test test + * @param object|null $metadata metadata * - * @return $this + * @return self */ - public function setTest($test) + public function setMetadata($metadata) { - $this->container['test'] = $test; + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; return $this; } /** - * Gets html + * Gets template_id * - * @return string|null + * @return string */ - public function getHtml() + public function getTemplateId() { - return $this->container['html']; + return $this->container['template_id']; } /** - * Sets html + * Sets template_id * - * @param string|null $html html + * @param string $template_id template_id * - * @return $this + * @return self */ - public function setHtml($html) + public function setTemplateId($template_id) { - $this->container['html'] = $html; + if (is_null($template_id)) { + array_push($this->openAPINullablesSetToNull, 'template_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('template_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['template_id'] = $template_id; return $this; } /** - * Gets template_id + * Gets test * - * @return string|null + * @return bool|null */ - public function getTemplateId() + public function getTest() { - return $this->container['template_id']; + return $this->container['test']; } /** - * Sets template_id + * Sets test * - * @param string|null $template_id template_id + * @param bool|null $test test * - * @return $this + * @return self */ - public function setTemplateId($template_id) + public function setTest($test) { - $this->container['template_id'] = $template_id; + if (is_null($test)) { + throw new \InvalidArgumentException('non-nullable test cannot be null'); + } + $this->container['test'] = $test; return $this; } @@ -384,7 +505,7 @@ public function setTemplateId($template_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -394,22 +515,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -425,11 +547,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -442,6 +577,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/SubmissionDataRequest.php b/lib/Model/SubmissionDataRequest.php index 88b7a66..35a04da 100644 --- a/lib/Model/SubmissionDataRequest.php +++ b/lib/Model/SubmissionDataRequest.php @@ -2,7 +2,7 @@ /** * SubmissionDataRequest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class SubmissionDataRequest implements ModelInterface, ArrayAccess +class SubmissionDataRequest implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -84,6 +84,8 @@ class SubmissionDataRequest implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'id' => null, @@ -109,6 +111,42 @@ class SubmissionDataRequest implements ModelInterface, ArrayAccess 'user_agent' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'submission_id' => false, + 'name' => true, + 'email' => true, + 'order' => false, + 'sort_order' => false, + 'fields' => true, + 'metadata' => false, + 'state' => false, + 'viewed_at' => true, + 'completed_at' => true, + 'auth_type' => false, + 'auth_second_factor_type' => false, + 'auth_provider' => true, + 'auth_session_started_at' => true, + 'auth_session_id_hash' => true, + 'auth_user_id_hash' => true, + 'auth_username_hash' => true, + 'auth_phone_number_hash' => true, + 'ip_address' => true, + 'user_agent' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -129,6 +167,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -258,24 +348,22 @@ public function getModelName() return self::$openAPIModelName; } - const STATE_PENDING = 'pending'; - const STATE_COMPLETED = 'completed'; - const AUTH_TYPE_NONE = 'none'; - const AUTH_TYPE_PASSWORD = 'password'; - const AUTH_TYPE_OAUTH = 'oauth'; - const AUTH_TYPE_EMAIL_LINK = 'email_link'; - const AUTH_TYPE_PHONE_NUMBER = 'phone_number'; - const AUTH_TYPE_LDAP = 'ldap'; - const AUTH_TYPE_SAML = 'saml'; - const AUTH_SECOND_FACTOR_TYPE_NONE = 'none'; - const AUTH_SECOND_FACTOR_TYPE_PHONE_NUMBER = 'phone_number'; - const AUTH_SECOND_FACTOR_TYPE_TOTP = 'totp'; - const AUTH_SECOND_FACTOR_TYPE_MOBILE_PUSH = 'mobile_push'; - const AUTH_SECOND_FACTOR_TYPE_SECURITY_KEY = 'security_key'; - const AUTH_SECOND_FACTOR_TYPE_FINGERPRINT = 'fingerprint'; - - - + public const STATE_PENDING = 'pending'; + public const STATE_COMPLETED = 'completed'; + public const AUTH_TYPE_NONE = 'none'; + public const AUTH_TYPE_PASSWORD = 'password'; + public const AUTH_TYPE_OAUTH = 'oauth'; + public const AUTH_TYPE_EMAIL_LINK = 'email_link'; + public const AUTH_TYPE_PHONE_NUMBER = 'phone_number'; + public const AUTH_TYPE_LDAP = 'ldap'; + public const AUTH_TYPE_SAML = 'saml'; + public const AUTH_SECOND_FACTOR_TYPE_NONE = 'none'; + public const AUTH_SECOND_FACTOR_TYPE_PHONE_NUMBER = 'phone_number'; + public const AUTH_SECOND_FACTOR_TYPE_TOTP = 'totp'; + public const AUTH_SECOND_FACTOR_TYPE_MOBILE_PUSH = 'mobile_push'; + public const AUTH_SECOND_FACTOR_TYPE_SECURITY_KEY = 'security_key'; + public const AUTH_SECOND_FACTOR_TYPE_FINGERPRINT = 'fingerprint'; + /** * Gets allowable values of the enum * @@ -288,7 +376,7 @@ public function getStateAllowableValues() self::STATE_COMPLETED, ]; } - + /** * Gets allowable values of the enum * @@ -306,7 +394,7 @@ public function getAuthTypeAllowableValues() self::AUTH_TYPE_SAML, ]; } - + /** * Gets allowable values of the enum * @@ -323,7 +411,6 @@ public function getAuthSecondFactorTypeAllowableValues() self::AUTH_SECOND_FACTOR_TYPE_FINGERPRINT, ]; } - /** * Associative array for storing property values @@ -340,27 +427,45 @@ public function getAuthSecondFactorTypeAllowableValues() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['submission_id'] = isset($data['submission_id']) ? $data['submission_id'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['email'] = isset($data['email']) ? $data['email'] : null; - $this->container['order'] = isset($data['order']) ? $data['order'] : null; - $this->container['sort_order'] = isset($data['sort_order']) ? $data['sort_order'] : null; - $this->container['fields'] = isset($data['fields']) ? $data['fields'] : null; - $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; - $this->container['state'] = isset($data['state']) ? $data['state'] : null; - $this->container['viewed_at'] = isset($data['viewed_at']) ? $data['viewed_at'] : null; - $this->container['completed_at'] = isset($data['completed_at']) ? $data['completed_at'] : null; - $this->container['auth_type'] = isset($data['auth_type']) ? $data['auth_type'] : null; - $this->container['auth_second_factor_type'] = isset($data['auth_second_factor_type']) ? $data['auth_second_factor_type'] : null; - $this->container['auth_provider'] = isset($data['auth_provider']) ? $data['auth_provider'] : null; - $this->container['auth_session_started_at'] = isset($data['auth_session_started_at']) ? $data['auth_session_started_at'] : null; - $this->container['auth_session_id_hash'] = isset($data['auth_session_id_hash']) ? $data['auth_session_id_hash'] : null; - $this->container['auth_user_id_hash'] = isset($data['auth_user_id_hash']) ? $data['auth_user_id_hash'] : null; - $this->container['auth_username_hash'] = isset($data['auth_username_hash']) ? $data['auth_username_hash'] : null; - $this->container['auth_phone_number_hash'] = isset($data['auth_phone_number_hash']) ? $data['auth_phone_number_hash'] : null; - $this->container['ip_address'] = isset($data['ip_address']) ? $data['ip_address'] : null; - $this->container['user_agent'] = isset($data['user_agent']) ? $data['user_agent'] : null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('submission_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('order', $data ?? [], null); + $this->setIfExists('sort_order', $data ?? [], null); + $this->setIfExists('fields', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('viewed_at', $data ?? [], null); + $this->setIfExists('completed_at', $data ?? [], null); + $this->setIfExists('auth_type', $data ?? [], null); + $this->setIfExists('auth_second_factor_type', $data ?? [], null); + $this->setIfExists('auth_provider', $data ?? [], null); + $this->setIfExists('auth_session_started_at', $data ?? [], null); + $this->setIfExists('auth_session_id_hash', $data ?? [], null); + $this->setIfExists('auth_user_id_hash', $data ?? [], null); + $this->setIfExists('auth_username_hash', $data ?? [], null); + $this->setIfExists('auth_phone_number_hash', $data ?? [], null); + $this->setIfExists('ip_address', $data ?? [], null); + $this->setIfExists('user_agent', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -399,7 +504,8 @@ public function listInvalidProperties() $allowedValues = $this->getStateAllowableValues(); if (!is_null($this->container['state']) && !in_array($this->container['state'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'state', must be one of '%s'", + "invalid value '%s' for 'state', must be one of '%s'", + $this->container['state'], implode("', '", $allowedValues) ); } @@ -407,7 +513,8 @@ public function listInvalidProperties() $allowedValues = $this->getAuthTypeAllowableValues(); if (!is_null($this->container['auth_type']) && !in_array($this->container['auth_type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'auth_type', must be one of '%s'", + "invalid value '%s' for 'auth_type', must be one of '%s'", + $this->container['auth_type'], implode("', '", $allowedValues) ); } @@ -415,7 +522,8 @@ public function listInvalidProperties() $allowedValues = $this->getAuthSecondFactorTypeAllowableValues(); if (!is_null($this->container['auth_second_factor_type']) && !in_array($this->container['auth_second_factor_type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'auth_second_factor_type', must be one of '%s'", + "invalid value '%s' for 'auth_second_factor_type', must be one of '%s'", + $this->container['auth_second_factor_type'], implode("', '", $allowedValues) ); } @@ -450,10 +558,13 @@ public function getId() * * @param string $id id * - * @return $this + * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -474,10 +585,13 @@ public function getSubmissionId() * * @param string|null $submission_id submission_id * - * @return $this + * @return self */ public function setSubmissionId($submission_id) { + if (is_null($submission_id)) { + throw new \InvalidArgumentException('non-nullable submission_id cannot be null'); + } $this->container['submission_id'] = $submission_id; return $this; @@ -498,10 +612,20 @@ public function getName() * * @param string $name name * - * @return $this + * @return self */ public function setName($name) { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['name'] = $name; return $this; @@ -522,10 +646,20 @@ public function getEmail() * * @param string $email email * - * @return $this + * @return self */ public function setEmail($email) { + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['email'] = $email; return $this; @@ -546,10 +680,13 @@ public function getOrder() * * @param int $order order * - * @return $this + * @return self */ public function setOrder($order) { + if (is_null($order)) { + throw new \InvalidArgumentException('non-nullable order cannot be null'); + } $this->container['order'] = $order; return $this; @@ -570,10 +707,13 @@ public function getSortOrder() * * @param int $sort_order sort_order * - * @return $this + * @return self */ public function setSortOrder($sort_order) { + if (is_null($sort_order)) { + throw new \InvalidArgumentException('non-nullable sort_order cannot be null'); + } $this->container['sort_order'] = $sort_order; return $this; @@ -594,10 +734,20 @@ public function getFields() * * @param string[] $fields fields * - * @return $this + * @return self */ public function setFields($fields) { + if (is_null($fields)) { + array_push($this->openAPINullablesSetToNull, 'fields'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fields', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['fields'] = $fields; return $this; @@ -618,10 +768,13 @@ public function getMetadata() * * @param object $metadata metadata * - * @return $this + * @return self */ public function setMetadata($metadata) { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } $this->container['metadata'] = $metadata; return $this; @@ -642,15 +795,19 @@ public function getState() * * @param string $state state * - * @return $this + * @return self */ public function setState($state) { + if (is_null($state)) { + throw new \InvalidArgumentException('non-nullable state cannot be null'); + } $allowedValues = $this->getStateAllowableValues(); if (!in_array($state, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'state', must be one of '%s'", + "Invalid value '%s' for 'state', must be one of '%s'", + $state, implode("', '", $allowedValues) ) ); @@ -675,10 +832,20 @@ public function getViewedAt() * * @param string|null $viewed_at viewed_at * - * @return $this + * @return self */ public function setViewedAt($viewed_at) { + if (is_null($viewed_at)) { + array_push($this->openAPINullablesSetToNull, 'viewed_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('viewed_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['viewed_at'] = $viewed_at; return $this; @@ -699,10 +866,20 @@ public function getCompletedAt() * * @param string|null $completed_at completed_at * - * @return $this + * @return self */ public function setCompletedAt($completed_at) { + if (is_null($completed_at)) { + array_push($this->openAPINullablesSetToNull, 'completed_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('completed_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['completed_at'] = $completed_at; return $this; @@ -723,15 +900,19 @@ public function getAuthType() * * @param string|null $auth_type auth_type * - * @return $this + * @return self */ public function setAuthType($auth_type) { + if (is_null($auth_type)) { + throw new \InvalidArgumentException('non-nullable auth_type cannot be null'); + } $allowedValues = $this->getAuthTypeAllowableValues(); - if (!is_null($auth_type) && !in_array($auth_type, $allowedValues, true)) { + if (!in_array($auth_type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'auth_type', must be one of '%s'", + "Invalid value '%s' for 'auth_type', must be one of '%s'", + $auth_type, implode("', '", $allowedValues) ) ); @@ -756,15 +937,19 @@ public function getAuthSecondFactorType() * * @param string|null $auth_second_factor_type auth_second_factor_type * - * @return $this + * @return self */ public function setAuthSecondFactorType($auth_second_factor_type) { + if (is_null($auth_second_factor_type)) { + throw new \InvalidArgumentException('non-nullable auth_second_factor_type cannot be null'); + } $allowedValues = $this->getAuthSecondFactorTypeAllowableValues(); - if (!is_null($auth_second_factor_type) && !in_array($auth_second_factor_type, $allowedValues, true)) { + if (!in_array($auth_second_factor_type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'auth_second_factor_type', must be one of '%s'", + "Invalid value '%s' for 'auth_second_factor_type', must be one of '%s'", + $auth_second_factor_type, implode("', '", $allowedValues) ) ); @@ -789,10 +974,20 @@ public function getAuthProvider() * * @param string|null $auth_provider auth_provider * - * @return $this + * @return self */ public function setAuthProvider($auth_provider) { + if (is_null($auth_provider)) { + array_push($this->openAPINullablesSetToNull, 'auth_provider'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_provider', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['auth_provider'] = $auth_provider; return $this; @@ -813,10 +1008,20 @@ public function getAuthSessionStartedAt() * * @param string|null $auth_session_started_at auth_session_started_at * - * @return $this + * @return self */ public function setAuthSessionStartedAt($auth_session_started_at) { + if (is_null($auth_session_started_at)) { + array_push($this->openAPINullablesSetToNull, 'auth_session_started_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_session_started_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['auth_session_started_at'] = $auth_session_started_at; return $this; @@ -837,10 +1042,20 @@ public function getAuthSessionIdHash() * * @param string|null $auth_session_id_hash auth_session_id_hash * - * @return $this + * @return self */ public function setAuthSessionIdHash($auth_session_id_hash) { + if (is_null($auth_session_id_hash)) { + array_push($this->openAPINullablesSetToNull, 'auth_session_id_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_session_id_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['auth_session_id_hash'] = $auth_session_id_hash; return $this; @@ -861,10 +1076,20 @@ public function getAuthUserIdHash() * * @param string|null $auth_user_id_hash auth_user_id_hash * - * @return $this + * @return self */ public function setAuthUserIdHash($auth_user_id_hash) { + if (is_null($auth_user_id_hash)) { + array_push($this->openAPINullablesSetToNull, 'auth_user_id_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_user_id_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['auth_user_id_hash'] = $auth_user_id_hash; return $this; @@ -885,10 +1110,20 @@ public function getAuthUsernameHash() * * @param string|null $auth_username_hash auth_username_hash * - * @return $this + * @return self */ public function setAuthUsernameHash($auth_username_hash) { + if (is_null($auth_username_hash)) { + array_push($this->openAPINullablesSetToNull, 'auth_username_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_username_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['auth_username_hash'] = $auth_username_hash; return $this; @@ -909,10 +1144,20 @@ public function getAuthPhoneNumberHash() * * @param string|null $auth_phone_number_hash auth_phone_number_hash * - * @return $this + * @return self */ public function setAuthPhoneNumberHash($auth_phone_number_hash) { + if (is_null($auth_phone_number_hash)) { + array_push($this->openAPINullablesSetToNull, 'auth_phone_number_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_phone_number_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['auth_phone_number_hash'] = $auth_phone_number_hash; return $this; @@ -933,10 +1178,20 @@ public function getIpAddress() * * @param string|null $ip_address ip_address * - * @return $this + * @return self */ public function setIpAddress($ip_address) { + if (is_null($ip_address)) { + array_push($this->openAPINullablesSetToNull, 'ip_address'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ip_address', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['ip_address'] = $ip_address; return $this; @@ -957,10 +1212,20 @@ public function getUserAgent() * * @param string|null $user_agent user_agent * - * @return $this + * @return self */ public function setUserAgent($user_agent) { + if (is_null($user_agent)) { + array_push($this->openAPINullablesSetToNull, 'user_agent'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('user_agent', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['user_agent'] = $user_agent; return $this; @@ -972,7 +1237,7 @@ public function setUserAgent($user_agent) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -982,22 +1247,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1013,11 +1279,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -1030,6 +1309,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/Template.php b/lib/Model/Template.php index 022c4e9..8eeb751 100644 --- a/lib/Model/Template.php +++ b/lib/Model/Template.php @@ -2,7 +2,7 @@ /** * Template * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class Template implements ModelInterface, ArrayAccess +class Template implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,56 +57,93 @@ class Template implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'expiration_interval' => 'string', - 'webhook_url' => 'string', - 'parent_folder_id' => 'string', - 'expire_after' => 'float', - 'allow_additional_properties' => 'bool', + 'name' => 'string', 'description' => 'string', - 'public_submissions' => 'bool', - 'slack_webhook_url' => 'string', - 'path' => 'string', 'public_web_form' => 'bool', - 'editable_submissions' => 'bool', + 'public_submissions' => 'bool', 'expire_submissions' => 'bool', - 'name' => 'string', - 'permanent_document_url' => 'string', - 'template_type' => 'string', - 'id' => 'string', - 'page_dimensions' => 'float[][]', + 'expire_after' => 'float', + 'expiration_interval' => 'string', + 'allow_additional_properties' => 'bool', + 'editable_submissions' => 'bool', 'locked' => 'bool', + 'webhook_url' => 'string', + 'slack_webhook_url' => 'string', 'redirect_url' => 'string', - 'document_url' => 'string' + 'id' => 'string', + 'template_type' => 'string', + 'page_dimensions' => 'float[][]', + 'document_url' => 'string', + 'permanent_document_url' => 'string', + 'path' => 'string', + 'parent_folder_id' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'expiration_interval' => null, - 'webhook_url' => null, - 'parent_folder_id' => null, - 'expire_after' => null, - 'allow_additional_properties' => null, + 'name' => null, 'description' => null, - 'public_submissions' => null, - 'slack_webhook_url' => null, - 'path' => null, 'public_web_form' => null, - 'editable_submissions' => null, + 'public_submissions' => null, 'expire_submissions' => null, - 'name' => null, - 'permanent_document_url' => null, - 'template_type' => null, - 'id' => null, - 'page_dimensions' => null, + 'expire_after' => null, + 'expiration_interval' => null, + 'allow_additional_properties' => null, + 'editable_submissions' => null, 'locked' => null, + 'webhook_url' => null, + 'slack_webhook_url' => null, 'redirect_url' => null, - 'document_url' => null + 'id' => null, + 'template_type' => null, + 'page_dimensions' => null, + 'document_url' => null, + 'permanent_document_url' => null, + 'path' => null, + 'parent_folder_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => true, + 'description' => true, + 'public_web_form' => false, + 'public_submissions' => false, + 'expire_submissions' => false, + 'expire_after' => false, + 'expiration_interval' => false, + 'allow_additional_properties' => false, + 'editable_submissions' => false, + 'locked' => false, + 'webhook_url' => true, + 'slack_webhook_url' => true, + 'redirect_url' => true, + 'id' => false, + 'template_type' => false, + 'page_dimensions' => true, + 'document_url' => true, + 'permanent_document_url' => true, + 'path' => false, + 'parent_folder_id' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -127,6 +164,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -134,26 +223,26 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'expiration_interval' => 'expiration_interval', - 'webhook_url' => 'webhook_url', - 'parent_folder_id' => 'parent_folder_id', - 'expire_after' => 'expire_after', - 'allow_additional_properties' => 'allow_additional_properties', + 'name' => 'name', 'description' => 'description', - 'public_submissions' => 'public_submissions', - 'slack_webhook_url' => 'slack_webhook_url', - 'path' => 'path', 'public_web_form' => 'public_web_form', - 'editable_submissions' => 'editable_submissions', + 'public_submissions' => 'public_submissions', 'expire_submissions' => 'expire_submissions', - 'name' => 'name', - 'permanent_document_url' => 'permanent_document_url', - 'template_type' => 'template_type', - 'id' => 'id', - 'page_dimensions' => 'page_dimensions', + 'expire_after' => 'expire_after', + 'expiration_interval' => 'expiration_interval', + 'allow_additional_properties' => 'allow_additional_properties', + 'editable_submissions' => 'editable_submissions', 'locked' => 'locked', + 'webhook_url' => 'webhook_url', + 'slack_webhook_url' => 'slack_webhook_url', 'redirect_url' => 'redirect_url', - 'document_url' => 'document_url' + 'id' => 'id', + 'template_type' => 'template_type', + 'page_dimensions' => 'page_dimensions', + 'document_url' => 'document_url', + 'permanent_document_url' => 'permanent_document_url', + 'path' => 'path', + 'parent_folder_id' => 'parent_folder_id' ]; /** @@ -162,26 +251,26 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'expiration_interval' => 'setExpirationInterval', - 'webhook_url' => 'setWebhookUrl', - 'parent_folder_id' => 'setParentFolderId', - 'expire_after' => 'setExpireAfter', - 'allow_additional_properties' => 'setAllowAdditionalProperties', + 'name' => 'setName', 'description' => 'setDescription', - 'public_submissions' => 'setPublicSubmissions', - 'slack_webhook_url' => 'setSlackWebhookUrl', - 'path' => 'setPath', 'public_web_form' => 'setPublicWebForm', - 'editable_submissions' => 'setEditableSubmissions', + 'public_submissions' => 'setPublicSubmissions', 'expire_submissions' => 'setExpireSubmissions', - 'name' => 'setName', - 'permanent_document_url' => 'setPermanentDocumentUrl', - 'template_type' => 'setTemplateType', - 'id' => 'setId', - 'page_dimensions' => 'setPageDimensions', + 'expire_after' => 'setExpireAfter', + 'expiration_interval' => 'setExpirationInterval', + 'allow_additional_properties' => 'setAllowAdditionalProperties', + 'editable_submissions' => 'setEditableSubmissions', 'locked' => 'setLocked', + 'webhook_url' => 'setWebhookUrl', + 'slack_webhook_url' => 'setSlackWebhookUrl', 'redirect_url' => 'setRedirectUrl', - 'document_url' => 'setDocumentUrl' + 'id' => 'setId', + 'template_type' => 'setTemplateType', + 'page_dimensions' => 'setPageDimensions', + 'document_url' => 'setDocumentUrl', + 'permanent_document_url' => 'setPermanentDocumentUrl', + 'path' => 'setPath', + 'parent_folder_id' => 'setParentFolderId' ]; /** @@ -190,26 +279,26 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'expiration_interval' => 'getExpirationInterval', - 'webhook_url' => 'getWebhookUrl', - 'parent_folder_id' => 'getParentFolderId', - 'expire_after' => 'getExpireAfter', - 'allow_additional_properties' => 'getAllowAdditionalProperties', + 'name' => 'getName', 'description' => 'getDescription', - 'public_submissions' => 'getPublicSubmissions', - 'slack_webhook_url' => 'getSlackWebhookUrl', - 'path' => 'getPath', 'public_web_form' => 'getPublicWebForm', - 'editable_submissions' => 'getEditableSubmissions', + 'public_submissions' => 'getPublicSubmissions', 'expire_submissions' => 'getExpireSubmissions', - 'name' => 'getName', - 'permanent_document_url' => 'getPermanentDocumentUrl', - 'template_type' => 'getTemplateType', - 'id' => 'getId', - 'page_dimensions' => 'getPageDimensions', + 'expire_after' => 'getExpireAfter', + 'expiration_interval' => 'getExpirationInterval', + 'allow_additional_properties' => 'getAllowAdditionalProperties', + 'editable_submissions' => 'getEditableSubmissions', 'locked' => 'getLocked', + 'webhook_url' => 'getWebhookUrl', + 'slack_webhook_url' => 'getSlackWebhookUrl', 'redirect_url' => 'getRedirectUrl', - 'document_url' => 'getDocumentUrl' + 'id' => 'getId', + 'template_type' => 'getTemplateType', + 'page_dimensions' => 'getPageDimensions', + 'document_url' => 'getDocumentUrl', + 'permanent_document_url' => 'getPermanentDocumentUrl', + 'path' => 'getPath', + 'parent_folder_id' => 'getParentFolderId' ]; /** @@ -253,12 +342,10 @@ public function getModelName() return self::$openAPIModelName; } - const EXPIRATION_INTERVAL_MINUTES = 'minutes'; - const EXPIRATION_INTERVAL_HOURS = 'hours'; - const EXPIRATION_INTERVAL_DAYS = 'days'; - + public const EXPIRATION_INTERVAL_MINUTES = 'minutes'; + public const EXPIRATION_INTERVAL_HOURS = 'hours'; + public const EXPIRATION_INTERVAL_DAYS = 'days'; - /** * Gets allowable values of the enum * @@ -272,7 +359,6 @@ public function getExpirationIntervalAllowableValues() self::EXPIRATION_INTERVAL_DAYS, ]; } - /** * Associative array for storing property values @@ -289,26 +375,44 @@ public function getExpirationIntervalAllowableValues() */ public function __construct(array $data = null) { - $this->container['expiration_interval'] = isset($data['expiration_interval']) ? $data['expiration_interval'] : null; - $this->container['webhook_url'] = isset($data['webhook_url']) ? $data['webhook_url'] : null; - $this->container['parent_folder_id'] = isset($data['parent_folder_id']) ? $data['parent_folder_id'] : null; - $this->container['expire_after'] = isset($data['expire_after']) ? $data['expire_after'] : null; - $this->container['allow_additional_properties'] = isset($data['allow_additional_properties']) ? $data['allow_additional_properties'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['public_submissions'] = isset($data['public_submissions']) ? $data['public_submissions'] : null; - $this->container['slack_webhook_url'] = isset($data['slack_webhook_url']) ? $data['slack_webhook_url'] : null; - $this->container['path'] = isset($data['path']) ? $data['path'] : null; - $this->container['public_web_form'] = isset($data['public_web_form']) ? $data['public_web_form'] : null; - $this->container['editable_submissions'] = isset($data['editable_submissions']) ? $data['editable_submissions'] : null; - $this->container['expire_submissions'] = isset($data['expire_submissions']) ? $data['expire_submissions'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['permanent_document_url'] = isset($data['permanent_document_url']) ? $data['permanent_document_url'] : null; - $this->container['template_type'] = isset($data['template_type']) ? $data['template_type'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['page_dimensions'] = isset($data['page_dimensions']) ? $data['page_dimensions'] : null; - $this->container['locked'] = isset($data['locked']) ? $data['locked'] : null; - $this->container['redirect_url'] = isset($data['redirect_url']) ? $data['redirect_url'] : null; - $this->container['document_url'] = isset($data['document_url']) ? $data['document_url'] : null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('public_web_form', $data ?? [], null); + $this->setIfExists('public_submissions', $data ?? [], null); + $this->setIfExists('expire_submissions', $data ?? [], null); + $this->setIfExists('expire_after', $data ?? [], null); + $this->setIfExists('expiration_interval', $data ?? [], null); + $this->setIfExists('allow_additional_properties', $data ?? [], null); + $this->setIfExists('editable_submissions', $data ?? [], null); + $this->setIfExists('locked', $data ?? [], null); + $this->setIfExists('webhook_url', $data ?? [], null); + $this->setIfExists('slack_webhook_url', $data ?? [], null); + $this->setIfExists('redirect_url', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('template_type', $data ?? [], null); + $this->setIfExists('page_dimensions', $data ?? [], null); + $this->setIfExists('document_url', $data ?? [], null); + $this->setIfExists('permanent_document_url', $data ?? [], null); + $this->setIfExists('path', $data ?? [], null); + $this->setIfExists('parent_folder_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -320,14 +424,75 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['public_web_form'] === null) { + $invalidProperties[] = "'public_web_form' can't be null"; + } + if ($this->container['public_submissions'] === null) { + $invalidProperties[] = "'public_submissions' can't be null"; + } + if ($this->container['expire_submissions'] === null) { + $invalidProperties[] = "'expire_submissions' can't be null"; + } + if ($this->container['expire_after'] === null) { + $invalidProperties[] = "'expire_after' can't be null"; + } + if ($this->container['expiration_interval'] === null) { + $invalidProperties[] = "'expiration_interval' can't be null"; + } $allowedValues = $this->getExpirationIntervalAllowableValues(); if (!is_null($this->container['expiration_interval']) && !in_array($this->container['expiration_interval'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'expiration_interval', must be one of '%s'", + "invalid value '%s' for 'expiration_interval', must be one of '%s'", + $this->container['expiration_interval'], implode("', '", $allowedValues) ); } + if ($this->container['allow_additional_properties'] === null) { + $invalidProperties[] = "'allow_additional_properties' can't be null"; + } + if ($this->container['editable_submissions'] === null) { + $invalidProperties[] = "'editable_submissions' can't be null"; + } + if ($this->container['locked'] === null) { + $invalidProperties[] = "'locked' can't be null"; + } + if ($this->container['webhook_url'] === null) { + $invalidProperties[] = "'webhook_url' can't be null"; + } + if ($this->container['slack_webhook_url'] === null) { + $invalidProperties[] = "'slack_webhook_url' can't be null"; + } + if ($this->container['redirect_url'] === null) { + $invalidProperties[] = "'redirect_url' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['template_type'] === null) { + $invalidProperties[] = "'template_type' can't be null"; + } + if ($this->container['page_dimensions'] === null) { + $invalidProperties[] = "'page_dimensions' can't be null"; + } + if ($this->container['document_url'] === null) { + $invalidProperties[] = "'document_url' can't be null"; + } + if ($this->container['permanent_document_url'] === null) { + $invalidProperties[] = "'permanent_document_url' can't be null"; + } + if ($this->container['path'] === null) { + $invalidProperties[] = "'path' can't be null"; + } + if ($this->container['parent_folder_id'] === null) { + $invalidProperties[] = "'parent_folder_id' can't be null"; + } return $invalidProperties; } @@ -344,346 +509,424 @@ public function valid() /** - * Gets expiration_interval + * Gets name * - * @return string|null + * @return string */ - public function getExpirationInterval() + public function getName() { - return $this->container['expiration_interval']; + return $this->container['name']; } /** - * Sets expiration_interval + * Sets name * - * @param string|null $expiration_interval expiration_interval + * @param string $name name * - * @return $this + * @return self */ - public function setExpirationInterval($expiration_interval) + public function setName($name) { - $allowedValues = $this->getExpirationIntervalAllowableValues(); - if (!is_null($expiration_interval) && !in_array($expiration_interval, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'expiration_interval', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } - $this->container['expiration_interval'] = $expiration_interval; + $this->container['name'] = $name; return $this; } /** - * Gets webhook_url + * Gets description * - * @return string|null + * @return string */ - public function getWebhookUrl() + public function getDescription() { - return $this->container['webhook_url']; + return $this->container['description']; } /** - * Sets webhook_url + * Sets description * - * @param string|null $webhook_url webhook_url + * @param string $description description * - * @return $this + * @return self */ - public function setWebhookUrl($webhook_url) + public function setDescription($description) { - $this->container['webhook_url'] = $webhook_url; + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; return $this; } /** - * Gets parent_folder_id + * Gets public_web_form * - * @return string|null + * @return bool */ - public function getParentFolderId() + public function getPublicWebForm() { - return $this->container['parent_folder_id']; + return $this->container['public_web_form']; } /** - * Sets parent_folder_id + * Sets public_web_form * - * @param string|null $parent_folder_id parent_folder_id + * @param bool $public_web_form public_web_form * - * @return $this + * @return self */ - public function setParentFolderId($parent_folder_id) + public function setPublicWebForm($public_web_form) { - $this->container['parent_folder_id'] = $parent_folder_id; + if (is_null($public_web_form)) { + throw new \InvalidArgumentException('non-nullable public_web_form cannot be null'); + } + $this->container['public_web_form'] = $public_web_form; return $this; } /** - * Gets expire_after + * Gets public_submissions * - * @return float|null + * @return bool */ - public function getExpireAfter() + public function getPublicSubmissions() { - return $this->container['expire_after']; + return $this->container['public_submissions']; } /** - * Sets expire_after + * Sets public_submissions * - * @param float|null $expire_after expire_after + * @param bool $public_submissions public_submissions * - * @return $this + * @return self */ - public function setExpireAfter($expire_after) + public function setPublicSubmissions($public_submissions) { - $this->container['expire_after'] = $expire_after; + if (is_null($public_submissions)) { + throw new \InvalidArgumentException('non-nullable public_submissions cannot be null'); + } + $this->container['public_submissions'] = $public_submissions; return $this; } /** - * Gets allow_additional_properties + * Gets expire_submissions * - * @return bool|null + * @return bool */ - public function getAllowAdditionalProperties() + public function getExpireSubmissions() { - return $this->container['allow_additional_properties']; + return $this->container['expire_submissions']; } /** - * Sets allow_additional_properties + * Sets expire_submissions * - * @param bool|null $allow_additional_properties allow_additional_properties + * @param bool $expire_submissions expire_submissions * - * @return $this + * @return self */ - public function setAllowAdditionalProperties($allow_additional_properties) + public function setExpireSubmissions($expire_submissions) { - $this->container['allow_additional_properties'] = $allow_additional_properties; + if (is_null($expire_submissions)) { + throw new \InvalidArgumentException('non-nullable expire_submissions cannot be null'); + } + $this->container['expire_submissions'] = $expire_submissions; return $this; } /** - * Gets description + * Gets expire_after * - * @return string|null + * @return float */ - public function getDescription() + public function getExpireAfter() { - return $this->container['description']; + return $this->container['expire_after']; } /** - * Sets description + * Sets expire_after * - * @param string|null $description description + * @param float $expire_after expire_after * - * @return $this + * @return self */ - public function setDescription($description) + public function setExpireAfter($expire_after) { - $this->container['description'] = $description; + if (is_null($expire_after)) { + throw new \InvalidArgumentException('non-nullable expire_after cannot be null'); + } + $this->container['expire_after'] = $expire_after; return $this; } /** - * Gets public_submissions + * Gets expiration_interval * - * @return bool|null + * @return string */ - public function getPublicSubmissions() + public function getExpirationInterval() { - return $this->container['public_submissions']; + return $this->container['expiration_interval']; } /** - * Sets public_submissions + * Sets expiration_interval * - * @param bool|null $public_submissions public_submissions + * @param string $expiration_interval expiration_interval * - * @return $this + * @return self */ - public function setPublicSubmissions($public_submissions) + public function setExpirationInterval($expiration_interval) { - $this->container['public_submissions'] = $public_submissions; + if (is_null($expiration_interval)) { + throw new \InvalidArgumentException('non-nullable expiration_interval cannot be null'); + } + $allowedValues = $this->getExpirationIntervalAllowableValues(); + if (!in_array($expiration_interval, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'expiration_interval', must be one of '%s'", + $expiration_interval, + implode("', '", $allowedValues) + ) + ); + } + $this->container['expiration_interval'] = $expiration_interval; return $this; } /** - * Gets slack_webhook_url + * Gets allow_additional_properties * - * @return string|null + * @return bool */ - public function getSlackWebhookUrl() + public function getAllowAdditionalProperties() { - return $this->container['slack_webhook_url']; + return $this->container['allow_additional_properties']; } /** - * Sets slack_webhook_url + * Sets allow_additional_properties * - * @param string|null $slack_webhook_url slack_webhook_url + * @param bool $allow_additional_properties allow_additional_properties * - * @return $this + * @return self */ - public function setSlackWebhookUrl($slack_webhook_url) + public function setAllowAdditionalProperties($allow_additional_properties) { - $this->container['slack_webhook_url'] = $slack_webhook_url; + if (is_null($allow_additional_properties)) { + throw new \InvalidArgumentException('non-nullable allow_additional_properties cannot be null'); + } + $this->container['allow_additional_properties'] = $allow_additional_properties; return $this; } /** - * Gets path + * Gets editable_submissions * - * @return string|null + * @return bool */ - public function getPath() + public function getEditableSubmissions() { - return $this->container['path']; + return $this->container['editable_submissions']; } /** - * Sets path + * Sets editable_submissions * - * @param string|null $path path + * @param bool $editable_submissions editable_submissions * - * @return $this + * @return self */ - public function setPath($path) + public function setEditableSubmissions($editable_submissions) { - $this->container['path'] = $path; + if (is_null($editable_submissions)) { + throw new \InvalidArgumentException('non-nullable editable_submissions cannot be null'); + } + $this->container['editable_submissions'] = $editable_submissions; return $this; } /** - * Gets public_web_form + * Gets locked * - * @return bool|null + * @return bool */ - public function getPublicWebForm() + public function getLocked() { - return $this->container['public_web_form']; + return $this->container['locked']; } /** - * Sets public_web_form + * Sets locked * - * @param bool|null $public_web_form public_web_form + * @param bool $locked locked * - * @return $this + * @return self */ - public function setPublicWebForm($public_web_form) + public function setLocked($locked) { - $this->container['public_web_form'] = $public_web_form; + if (is_null($locked)) { + throw new \InvalidArgumentException('non-nullable locked cannot be null'); + } + $this->container['locked'] = $locked; return $this; } /** - * Gets editable_submissions + * Gets webhook_url * - * @return bool|null + * @return string */ - public function getEditableSubmissions() + public function getWebhookUrl() { - return $this->container['editable_submissions']; + return $this->container['webhook_url']; } /** - * Sets editable_submissions + * Sets webhook_url * - * @param bool|null $editable_submissions editable_submissions + * @param string $webhook_url webhook_url * - * @return $this + * @return self */ - public function setEditableSubmissions($editable_submissions) + public function setWebhookUrl($webhook_url) { - $this->container['editable_submissions'] = $editable_submissions; + if (is_null($webhook_url)) { + array_push($this->openAPINullablesSetToNull, 'webhook_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('webhook_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['webhook_url'] = $webhook_url; return $this; } /** - * Gets expire_submissions + * Gets slack_webhook_url * - * @return bool|null + * @return string */ - public function getExpireSubmissions() + public function getSlackWebhookUrl() { - return $this->container['expire_submissions']; + return $this->container['slack_webhook_url']; } /** - * Sets expire_submissions + * Sets slack_webhook_url * - * @param bool|null $expire_submissions expire_submissions + * @param string $slack_webhook_url slack_webhook_url * - * @return $this + * @return self */ - public function setExpireSubmissions($expire_submissions) + public function setSlackWebhookUrl($slack_webhook_url) { - $this->container['expire_submissions'] = $expire_submissions; + if (is_null($slack_webhook_url)) { + array_push($this->openAPINullablesSetToNull, 'slack_webhook_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('slack_webhook_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['slack_webhook_url'] = $slack_webhook_url; return $this; } /** - * Gets name + * Gets redirect_url * - * @return string|null + * @return string */ - public function getName() + public function getRedirectUrl() { - return $this->container['name']; + return $this->container['redirect_url']; } /** - * Sets name + * Sets redirect_url * - * @param string|null $name name + * @param string $redirect_url redirect_url * - * @return $this + * @return self */ - public function setName($name) + public function setRedirectUrl($redirect_url) { - $this->container['name'] = $name; + if (is_null($redirect_url)) { + array_push($this->openAPINullablesSetToNull, 'redirect_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('redirect_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['redirect_url'] = $redirect_url; return $this; } /** - * Gets permanent_document_url + * Gets id * - * @return string|null + * @return string */ - public function getPermanentDocumentUrl() + public function getId() { - return $this->container['permanent_document_url']; + return $this->container['id']; } /** - * Sets permanent_document_url + * Sets id * - * @param string|null $permanent_document_url permanent_document_url + * @param string $id id * - * @return $this + * @return self */ - public function setPermanentDocumentUrl($permanent_document_url) + public function setId($id) { - $this->container['permanent_document_url'] = $permanent_document_url; + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; return $this; } @@ -691,7 +934,7 @@ public function setPermanentDocumentUrl($permanent_document_url) /** * Gets template_type * - * @return string|null + * @return string */ public function getTemplateType() { @@ -701,133 +944,179 @@ public function getTemplateType() /** * Sets template_type * - * @param string|null $template_type template_type + * @param string $template_type template_type * - * @return $this + * @return self */ public function setTemplateType($template_type) { + if (is_null($template_type)) { + throw new \InvalidArgumentException('non-nullable template_type cannot be null'); + } $this->container['template_type'] = $template_type; return $this; } /** - * Gets id + * Gets page_dimensions * - * @return string|null + * @return float[][] */ - public function getId() + public function getPageDimensions() { - return $this->container['id']; + return $this->container['page_dimensions']; } /** - * Sets id + * Sets page_dimensions * - * @param string|null $id id + * @param float[][] $page_dimensions page_dimensions * - * @return $this + * @return self */ - public function setId($id) + public function setPageDimensions($page_dimensions) { - $this->container['id'] = $id; + if (is_null($page_dimensions)) { + array_push($this->openAPINullablesSetToNull, 'page_dimensions'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('page_dimensions', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['page_dimensions'] = $page_dimensions; return $this; } /** - * Gets page_dimensions + * Gets document_url * - * @return float[][]|null + * @return string */ - public function getPageDimensions() + public function getDocumentUrl() { - return $this->container['page_dimensions']; + return $this->container['document_url']; } /** - * Sets page_dimensions + * Sets document_url * - * @param float[][]|null $page_dimensions page_dimensions + * @param string $document_url document_url * - * @return $this + * @return self */ - public function setPageDimensions($page_dimensions) + public function setDocumentUrl($document_url) { - $this->container['page_dimensions'] = $page_dimensions; + if (is_null($document_url)) { + array_push($this->openAPINullablesSetToNull, 'document_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('document_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['document_url'] = $document_url; return $this; } /** - * Gets locked + * Gets permanent_document_url * - * @return bool|null + * @return string */ - public function getLocked() + public function getPermanentDocumentUrl() { - return $this->container['locked']; + return $this->container['permanent_document_url']; } /** - * Sets locked + * Sets permanent_document_url * - * @param bool|null $locked locked + * @param string $permanent_document_url permanent_document_url * - * @return $this + * @return self */ - public function setLocked($locked) + public function setPermanentDocumentUrl($permanent_document_url) { - $this->container['locked'] = $locked; + if (is_null($permanent_document_url)) { + array_push($this->openAPINullablesSetToNull, 'permanent_document_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('permanent_document_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['permanent_document_url'] = $permanent_document_url; return $this; } /** - * Gets redirect_url + * Gets path * - * @return string|null + * @return string */ - public function getRedirectUrl() + public function getPath() { - return $this->container['redirect_url']; + return $this->container['path']; } /** - * Sets redirect_url + * Sets path * - * @param string|null $redirect_url redirect_url + * @param string $path path * - * @return $this + * @return self */ - public function setRedirectUrl($redirect_url) + public function setPath($path) { - $this->container['redirect_url'] = $redirect_url; + if (is_null($path)) { + throw new \InvalidArgumentException('non-nullable path cannot be null'); + } + $this->container['path'] = $path; return $this; } /** - * Gets document_url + * Gets parent_folder_id * - * @return string|null + * @return string */ - public function getDocumentUrl() + public function getParentFolderId() { - return $this->container['document_url']; + return $this->container['parent_folder_id']; } /** - * Sets document_url + * Sets parent_folder_id * - * @param string|null $document_url document_url + * @param string $parent_folder_id parent_folder_id * - * @return $this + * @return self */ - public function setDocumentUrl($document_url) + public function setParentFolderId($parent_folder_id) { - $this->container['document_url'] = $document_url; + if (is_null($parent_folder_id)) { + array_push($this->openAPINullablesSetToNull, 'parent_folder_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('parent_folder_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['parent_folder_id'] = $parent_folder_id; return $this; } @@ -838,7 +1127,7 @@ public function setDocumentUrl($document_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -848,22 +1137,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -879,11 +1169,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -896,6 +1199,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/TemplateData.php b/lib/Model/TemplateData.php index 0cc211b..b849560 100644 --- a/lib/Model/TemplateData.php +++ b/lib/Model/TemplateData.php @@ -2,7 +2,7 @@ /** * TemplateData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class TemplateData implements ModelInterface, ArrayAccess +class TemplateData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,48 +57,81 @@ class TemplateData implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'expiration_interval' => 'string', - 'webhook_url' => 'string', - 'scss' => 'string', 'allow_additional_properties' => 'bool', - 'expire_after' => 'float', 'description' => 'string', - 'public_submissions' => 'bool', - 'slack_webhook_url' => 'string', - 'header_html' => 'string', - 'public_web_form' => 'bool', 'editable_submissions' => 'bool', + 'expiration_interval' => 'string', + 'expire_after' => 'float', 'expire_submissions' => 'bool', - 'name' => 'string', 'footer_html' => 'string', + 'header_html' => 'string', 'html' => 'string', - 'redirect_url' => 'string' + 'name' => 'string', + 'public_submissions' => 'bool', + 'public_web_form' => 'bool', + 'redirect_url' => 'string', + 'scss' => 'string', + 'slack_webhook_url' => 'string', + 'webhook_url' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'expiration_interval' => null, - 'webhook_url' => null, - 'scss' => null, 'allow_additional_properties' => null, - 'expire_after' => null, 'description' => null, - 'public_submissions' => null, - 'slack_webhook_url' => null, - 'header_html' => null, - 'public_web_form' => null, 'editable_submissions' => null, + 'expiration_interval' => null, + 'expire_after' => null, 'expire_submissions' => null, - 'name' => null, 'footer_html' => null, + 'header_html' => null, 'html' => null, - 'redirect_url' => null + 'name' => null, + 'public_submissions' => null, + 'public_web_form' => null, + 'redirect_url' => null, + 'scss' => null, + 'slack_webhook_url' => null, + 'webhook_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'allow_additional_properties' => false, + 'description' => true, + 'editable_submissions' => false, + 'expiration_interval' => false, + 'expire_after' => false, + 'expire_submissions' => false, + 'footer_html' => true, + 'header_html' => true, + 'html' => true, + 'name' => true, + 'public_submissions' => false, + 'public_web_form' => false, + 'redirect_url' => true, + 'scss' => true, + 'slack_webhook_url' => true, + 'webhook_url' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -119,6 +152,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -126,22 +211,22 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'expiration_interval' => 'expiration_interval', - 'webhook_url' => 'webhook_url', - 'scss' => 'scss', 'allow_additional_properties' => 'allow_additional_properties', - 'expire_after' => 'expire_after', 'description' => 'description', - 'public_submissions' => 'public_submissions', - 'slack_webhook_url' => 'slack_webhook_url', - 'header_html' => 'header_html', - 'public_web_form' => 'public_web_form', 'editable_submissions' => 'editable_submissions', + 'expiration_interval' => 'expiration_interval', + 'expire_after' => 'expire_after', 'expire_submissions' => 'expire_submissions', - 'name' => 'name', 'footer_html' => 'footer_html', + 'header_html' => 'header_html', 'html' => 'html', - 'redirect_url' => 'redirect_url' + 'name' => 'name', + 'public_submissions' => 'public_submissions', + 'public_web_form' => 'public_web_form', + 'redirect_url' => 'redirect_url', + 'scss' => 'scss', + 'slack_webhook_url' => 'slack_webhook_url', + 'webhook_url' => 'webhook_url' ]; /** @@ -150,22 +235,22 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'expiration_interval' => 'setExpirationInterval', - 'webhook_url' => 'setWebhookUrl', - 'scss' => 'setScss', 'allow_additional_properties' => 'setAllowAdditionalProperties', - 'expire_after' => 'setExpireAfter', 'description' => 'setDescription', - 'public_submissions' => 'setPublicSubmissions', - 'slack_webhook_url' => 'setSlackWebhookUrl', - 'header_html' => 'setHeaderHtml', - 'public_web_form' => 'setPublicWebForm', 'editable_submissions' => 'setEditableSubmissions', + 'expiration_interval' => 'setExpirationInterval', + 'expire_after' => 'setExpireAfter', 'expire_submissions' => 'setExpireSubmissions', - 'name' => 'setName', 'footer_html' => 'setFooterHtml', + 'header_html' => 'setHeaderHtml', 'html' => 'setHtml', - 'redirect_url' => 'setRedirectUrl' + 'name' => 'setName', + 'public_submissions' => 'setPublicSubmissions', + 'public_web_form' => 'setPublicWebForm', + 'redirect_url' => 'setRedirectUrl', + 'scss' => 'setScss', + 'slack_webhook_url' => 'setSlackWebhookUrl', + 'webhook_url' => 'setWebhookUrl' ]; /** @@ -174,22 +259,22 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'expiration_interval' => 'getExpirationInterval', - 'webhook_url' => 'getWebhookUrl', - 'scss' => 'getScss', 'allow_additional_properties' => 'getAllowAdditionalProperties', - 'expire_after' => 'getExpireAfter', 'description' => 'getDescription', - 'public_submissions' => 'getPublicSubmissions', - 'slack_webhook_url' => 'getSlackWebhookUrl', - 'header_html' => 'getHeaderHtml', - 'public_web_form' => 'getPublicWebForm', 'editable_submissions' => 'getEditableSubmissions', + 'expiration_interval' => 'getExpirationInterval', + 'expire_after' => 'getExpireAfter', 'expire_submissions' => 'getExpireSubmissions', - 'name' => 'getName', 'footer_html' => 'getFooterHtml', + 'header_html' => 'getHeaderHtml', 'html' => 'getHtml', - 'redirect_url' => 'getRedirectUrl' + 'name' => 'getName', + 'public_submissions' => 'getPublicSubmissions', + 'public_web_form' => 'getPublicWebForm', + 'redirect_url' => 'getRedirectUrl', + 'scss' => 'getScss', + 'slack_webhook_url' => 'getSlackWebhookUrl', + 'webhook_url' => 'getWebhookUrl' ]; /** @@ -233,12 +318,10 @@ public function getModelName() return self::$openAPIModelName; } - const EXPIRATION_INTERVAL_MINUTES = 'minutes'; - const EXPIRATION_INTERVAL_HOURS = 'hours'; - const EXPIRATION_INTERVAL_DAYS = 'days'; - + public const EXPIRATION_INTERVAL_MINUTES = 'minutes'; + public const EXPIRATION_INTERVAL_HOURS = 'hours'; + public const EXPIRATION_INTERVAL_DAYS = 'days'; - /** * Gets allowable values of the enum * @@ -252,7 +335,6 @@ public function getExpirationIntervalAllowableValues() self::EXPIRATION_INTERVAL_DAYS, ]; } - /** * Associative array for storing property values @@ -269,22 +351,40 @@ public function getExpirationIntervalAllowableValues() */ public function __construct(array $data = null) { - $this->container['expiration_interval'] = isset($data['expiration_interval']) ? $data['expiration_interval'] : null; - $this->container['webhook_url'] = isset($data['webhook_url']) ? $data['webhook_url'] : null; - $this->container['scss'] = isset($data['scss']) ? $data['scss'] : null; - $this->container['allow_additional_properties'] = isset($data['allow_additional_properties']) ? $data['allow_additional_properties'] : null; - $this->container['expire_after'] = isset($data['expire_after']) ? $data['expire_after'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['public_submissions'] = isset($data['public_submissions']) ? $data['public_submissions'] : null; - $this->container['slack_webhook_url'] = isset($data['slack_webhook_url']) ? $data['slack_webhook_url'] : null; - $this->container['header_html'] = isset($data['header_html']) ? $data['header_html'] : null; - $this->container['public_web_form'] = isset($data['public_web_form']) ? $data['public_web_form'] : null; - $this->container['editable_submissions'] = isset($data['editable_submissions']) ? $data['editable_submissions'] : null; - $this->container['expire_submissions'] = isset($data['expire_submissions']) ? $data['expire_submissions'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['footer_html'] = isset($data['footer_html']) ? $data['footer_html'] : null; - $this->container['html'] = isset($data['html']) ? $data['html'] : null; - $this->container['redirect_url'] = isset($data['redirect_url']) ? $data['redirect_url'] : null; + $this->setIfExists('allow_additional_properties', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('editable_submissions', $data ?? [], null); + $this->setIfExists('expiration_interval', $data ?? [], null); + $this->setIfExists('expire_after', $data ?? [], null); + $this->setIfExists('expire_submissions', $data ?? [], null); + $this->setIfExists('footer_html', $data ?? [], null); + $this->setIfExists('header_html', $data ?? [], null); + $this->setIfExists('html', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('public_submissions', $data ?? [], null); + $this->setIfExists('public_web_form', $data ?? [], null); + $this->setIfExists('redirect_url', $data ?? [], null); + $this->setIfExists('scss', $data ?? [], null); + $this->setIfExists('slack_webhook_url', $data ?? [], null); + $this->setIfExists('webhook_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -299,7 +399,8 @@ public function listInvalidProperties() $allowedValues = $this->getExpirationIntervalAllowableValues(); if (!is_null($this->container['expiration_interval']) && !in_array($this->container['expiration_interval'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'expiration_interval', must be one of '%s'", + "invalid value '%s' for 'expiration_interval', must be one of '%s'", + $this->container['expiration_interval'], implode("', '", $allowedValues) ); } @@ -320,106 +421,126 @@ public function valid() /** - * Gets expiration_interval + * Gets allow_additional_properties * - * @return string|null + * @return bool|null */ - public function getExpirationInterval() + public function getAllowAdditionalProperties() { - return $this->container['expiration_interval']; + return $this->container['allow_additional_properties']; } /** - * Sets expiration_interval + * Sets allow_additional_properties * - * @param string|null $expiration_interval expiration_interval + * @param bool|null $allow_additional_properties allow_additional_properties * - * @return $this + * @return self */ - public function setExpirationInterval($expiration_interval) + public function setAllowAdditionalProperties($allow_additional_properties) { - $allowedValues = $this->getExpirationIntervalAllowableValues(); - if (!is_null($expiration_interval) && !in_array($expiration_interval, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'expiration_interval', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($allow_additional_properties)) { + throw new \InvalidArgumentException('non-nullable allow_additional_properties cannot be null'); } - $this->container['expiration_interval'] = $expiration_interval; + $this->container['allow_additional_properties'] = $allow_additional_properties; return $this; } /** - * Gets webhook_url + * Gets description * * @return string|null */ - public function getWebhookUrl() + public function getDescription() { - return $this->container['webhook_url']; + return $this->container['description']; } /** - * Sets webhook_url + * Sets description * - * @param string|null $webhook_url webhook_url + * @param string|null $description description * - * @return $this + * @return self */ - public function setWebhookUrl($webhook_url) + public function setDescription($description) { - $this->container['webhook_url'] = $webhook_url; + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; return $this; } /** - * Gets scss + * Gets editable_submissions * - * @return string|null + * @return bool|null */ - public function getScss() + public function getEditableSubmissions() { - return $this->container['scss']; + return $this->container['editable_submissions']; } /** - * Sets scss + * Sets editable_submissions * - * @param string|null $scss scss + * @param bool|null $editable_submissions editable_submissions * - * @return $this + * @return self */ - public function setScss($scss) + public function setEditableSubmissions($editable_submissions) { - $this->container['scss'] = $scss; + if (is_null($editable_submissions)) { + throw new \InvalidArgumentException('non-nullable editable_submissions cannot be null'); + } + $this->container['editable_submissions'] = $editable_submissions; return $this; } /** - * Gets allow_additional_properties + * Gets expiration_interval * - * @return bool|null + * @return string|null */ - public function getAllowAdditionalProperties() + public function getExpirationInterval() { - return $this->container['allow_additional_properties']; + return $this->container['expiration_interval']; } /** - * Sets allow_additional_properties + * Sets expiration_interval * - * @param bool|null $allow_additional_properties allow_additional_properties + * @param string|null $expiration_interval expiration_interval * - * @return $this + * @return self */ - public function setAllowAdditionalProperties($allow_additional_properties) + public function setExpirationInterval($expiration_interval) { - $this->container['allow_additional_properties'] = $allow_additional_properties; + if (is_null($expiration_interval)) { + throw new \InvalidArgumentException('non-nullable expiration_interval cannot be null'); + } + $allowedValues = $this->getExpirationIntervalAllowableValues(); + if (!in_array($expiration_interval, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'expiration_interval', must be one of '%s'", + $expiration_interval, + implode("', '", $allowedValues) + ) + ); + } + $this->container['expiration_interval'] = $expiration_interval; return $this; } @@ -439,275 +560,367 @@ public function getExpireAfter() * * @param float|null $expire_after expire_after * - * @return $this + * @return self */ public function setExpireAfter($expire_after) { + if (is_null($expire_after)) { + throw new \InvalidArgumentException('non-nullable expire_after cannot be null'); + } $this->container['expire_after'] = $expire_after; return $this; } /** - * Gets description + * Gets expire_submissions * - * @return string|null + * @return bool|null */ - public function getDescription() + public function getExpireSubmissions() { - return $this->container['description']; + return $this->container['expire_submissions']; } /** - * Sets description + * Sets expire_submissions * - * @param string|null $description description + * @param bool|null $expire_submissions expire_submissions * - * @return $this + * @return self */ - public function setDescription($description) + public function setExpireSubmissions($expire_submissions) { - $this->container['description'] = $description; + if (is_null($expire_submissions)) { + throw new \InvalidArgumentException('non-nullable expire_submissions cannot be null'); + } + $this->container['expire_submissions'] = $expire_submissions; return $this; } /** - * Gets public_submissions + * Gets footer_html * - * @return bool|null + * @return string|null */ - public function getPublicSubmissions() + public function getFooterHtml() { - return $this->container['public_submissions']; + return $this->container['footer_html']; } /** - * Sets public_submissions + * Sets footer_html * - * @param bool|null $public_submissions public_submissions + * @param string|null $footer_html footer_html * - * @return $this + * @return self */ - public function setPublicSubmissions($public_submissions) + public function setFooterHtml($footer_html) { - $this->container['public_submissions'] = $public_submissions; + if (is_null($footer_html)) { + array_push($this->openAPINullablesSetToNull, 'footer_html'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('footer_html', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['footer_html'] = $footer_html; return $this; } /** - * Gets slack_webhook_url + * Gets header_html * * @return string|null */ - public function getSlackWebhookUrl() + public function getHeaderHtml() { - return $this->container['slack_webhook_url']; + return $this->container['header_html']; } /** - * Sets slack_webhook_url + * Sets header_html * - * @param string|null $slack_webhook_url slack_webhook_url + * @param string|null $header_html header_html * - * @return $this + * @return self */ - public function setSlackWebhookUrl($slack_webhook_url) + public function setHeaderHtml($header_html) { - $this->container['slack_webhook_url'] = $slack_webhook_url; + if (is_null($header_html)) { + array_push($this->openAPINullablesSetToNull, 'header_html'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('header_html', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['header_html'] = $header_html; return $this; } /** - * Gets header_html + * Gets html * * @return string|null */ - public function getHeaderHtml() + public function getHtml() { - return $this->container['header_html']; + return $this->container['html']; } /** - * Sets header_html + * Sets html * - * @param string|null $header_html header_html + * @param string|null $html html * - * @return $this + * @return self */ - public function setHeaderHtml($header_html) + public function setHtml($html) { - $this->container['header_html'] = $header_html; + if (is_null($html)) { + array_push($this->openAPINullablesSetToNull, 'html'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('html', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['html'] = $html; return $this; } /** - * Gets public_web_form + * Gets name * - * @return bool|null + * @return string|null */ - public function getPublicWebForm() + public function getName() { - return $this->container['public_web_form']; + return $this->container['name']; } /** - * Sets public_web_form + * Sets name * - * @param bool|null $public_web_form public_web_form + * @param string|null $name name * - * @return $this + * @return self */ - public function setPublicWebForm($public_web_form) + public function setName($name) { - $this->container['public_web_form'] = $public_web_form; + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; return $this; } /** - * Gets editable_submissions + * Gets public_submissions * * @return bool|null */ - public function getEditableSubmissions() + public function getPublicSubmissions() { - return $this->container['editable_submissions']; + return $this->container['public_submissions']; } /** - * Sets editable_submissions + * Sets public_submissions * - * @param bool|null $editable_submissions editable_submissions + * @param bool|null $public_submissions public_submissions * - * @return $this + * @return self */ - public function setEditableSubmissions($editable_submissions) + public function setPublicSubmissions($public_submissions) { - $this->container['editable_submissions'] = $editable_submissions; + if (is_null($public_submissions)) { + throw new \InvalidArgumentException('non-nullable public_submissions cannot be null'); + } + $this->container['public_submissions'] = $public_submissions; return $this; } /** - * Gets expire_submissions + * Gets public_web_form * * @return bool|null */ - public function getExpireSubmissions() + public function getPublicWebForm() { - return $this->container['expire_submissions']; + return $this->container['public_web_form']; } /** - * Sets expire_submissions + * Sets public_web_form * - * @param bool|null $expire_submissions expire_submissions + * @param bool|null $public_web_form public_web_form * - * @return $this + * @return self */ - public function setExpireSubmissions($expire_submissions) + public function setPublicWebForm($public_web_form) { - $this->container['expire_submissions'] = $expire_submissions; + if (is_null($public_web_form)) { + throw new \InvalidArgumentException('non-nullable public_web_form cannot be null'); + } + $this->container['public_web_form'] = $public_web_form; return $this; } /** - * Gets name + * Gets redirect_url * * @return string|null */ - public function getName() + public function getRedirectUrl() { - return $this->container['name']; + return $this->container['redirect_url']; } /** - * Sets name + * Sets redirect_url * - * @param string|null $name name + * @param string|null $redirect_url redirect_url * - * @return $this + * @return self */ - public function setName($name) + public function setRedirectUrl($redirect_url) { - $this->container['name'] = $name; + if (is_null($redirect_url)) { + array_push($this->openAPINullablesSetToNull, 'redirect_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('redirect_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['redirect_url'] = $redirect_url; return $this; } /** - * Gets footer_html + * Gets scss * * @return string|null */ - public function getFooterHtml() + public function getScss() { - return $this->container['footer_html']; + return $this->container['scss']; } /** - * Sets footer_html + * Sets scss * - * @param string|null $footer_html footer_html + * @param string|null $scss scss * - * @return $this + * @return self */ - public function setFooterHtml($footer_html) + public function setScss($scss) { - $this->container['footer_html'] = $footer_html; + if (is_null($scss)) { + array_push($this->openAPINullablesSetToNull, 'scss'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('scss', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['scss'] = $scss; return $this; } /** - * Gets html + * Gets slack_webhook_url * * @return string|null */ - public function getHtml() + public function getSlackWebhookUrl() { - return $this->container['html']; + return $this->container['slack_webhook_url']; } /** - * Sets html + * Sets slack_webhook_url * - * @param string|null $html html + * @param string|null $slack_webhook_url slack_webhook_url * - * @return $this + * @return self */ - public function setHtml($html) + public function setSlackWebhookUrl($slack_webhook_url) { - $this->container['html'] = $html; + if (is_null($slack_webhook_url)) { + array_push($this->openAPINullablesSetToNull, 'slack_webhook_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('slack_webhook_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['slack_webhook_url'] = $slack_webhook_url; return $this; } /** - * Gets redirect_url + * Gets webhook_url * * @return string|null */ - public function getRedirectUrl() + public function getWebhookUrl() { - return $this->container['redirect_url']; + return $this->container['webhook_url']; } /** - * Sets redirect_url + * Sets webhook_url * - * @param string|null $redirect_url redirect_url + * @param string|null $webhook_url webhook_url * - * @return $this + * @return self */ - public function setRedirectUrl($redirect_url) + public function setWebhookUrl($webhook_url) { - $this->container['redirect_url'] = $redirect_url; + if (is_null($webhook_url)) { + array_push($this->openAPINullablesSetToNull, 'webhook_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('webhook_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['webhook_url'] = $webhook_url; return $this; } @@ -718,7 +931,7 @@ public function setRedirectUrl($redirect_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -728,22 +941,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -759,11 +973,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -776,6 +1003,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/FullTemplateDefaults.php b/lib/Model/TemplateDefaults.php similarity index 53% rename from lib/Model/FullTemplateDefaults.php rename to lib/Model/TemplateDefaults.php index 68c0331..58a64aa 100644 --- a/lib/Model/FullTemplateDefaults.php +++ b/lib/Model/TemplateDefaults.php @@ -1,8 +1,8 @@ */ -class FullTemplateDefaults implements ModelInterface, ArrayAccess +class TemplateDefaults implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. * * @var string */ - protected static $openAPIModelName = 'full_template_defaults'; + protected static $openAPIModelName = 'template_defaults'; /** * Array of property to type mappings. Used for (de)serialization @@ -66,6 +66,8 @@ class FullTemplateDefaults implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'color' => null, @@ -73,6 +75,24 @@ class FullTemplateDefaults implements ModelInterface, ArrayAccess 'typeface' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'color' => true, + 'font_size' => false, + 'typeface' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -93,6 +113,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -168,9 +240,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -187,9 +256,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['color'] = isset($data['color']) ? $data['color'] : null; - $this->container['font_size'] = isset($data['font_size']) ? $data['font_size'] : null; - $this->container['typeface'] = isset($data['typeface']) ? $data['typeface'] : null; + $this->setIfExists('color', $data ?? [], null); + $this->setIfExists('font_size', $data ?? [], null); + $this->setIfExists('typeface', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -201,6 +288,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['color'] === null) { + $invalidProperties[] = "'color' can't be null"; + } + if ($this->container['font_size'] === null) { + $invalidProperties[] = "'font_size' can't be null"; + } + if ($this->container['typeface'] === null) { + $invalidProperties[] = "'typeface' can't be null"; + } return $invalidProperties; } @@ -219,7 +315,7 @@ public function valid() /** * Gets color * - * @return string|null + * @return string */ public function getColor() { @@ -229,12 +325,22 @@ public function getColor() /** * Sets color * - * @param string|null $color color + * @param string $color color * - * @return $this + * @return self */ public function setColor($color) { + if (is_null($color)) { + array_push($this->openAPINullablesSetToNull, 'color'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('color', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['color'] = $color; return $this; @@ -243,7 +349,7 @@ public function setColor($color) /** * Gets font_size * - * @return float|null + * @return float */ public function getFontSize() { @@ -253,12 +359,15 @@ public function getFontSize() /** * Sets font_size * - * @param float|null $font_size font_size + * @param float $font_size font_size * - * @return $this + * @return self */ public function setFontSize($font_size) { + if (is_null($font_size)) { + throw new \InvalidArgumentException('non-nullable font_size cannot be null'); + } $this->container['font_size'] = $font_size; return $this; @@ -267,7 +376,7 @@ public function setFontSize($font_size) /** * Gets typeface * - * @return string|null + * @return string */ public function getTypeface() { @@ -277,12 +386,15 @@ public function getTypeface() /** * Sets typeface * - * @param string|null $typeface typeface + * @param string $typeface typeface * - * @return $this + * @return self */ public function setTypeface($typeface) { + if (is_null($typeface)) { + throw new \InvalidArgumentException('non-nullable typeface cannot be null'); + } $this->container['typeface'] = $typeface; return $this; @@ -294,7 +406,7 @@ public function setTypeface($typeface) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -304,22 +416,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -335,11 +448,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -352,6 +478,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/UploadTemplateDataDocument.php b/lib/Model/TemplateDocument.php similarity index 54% rename from lib/Model/UploadTemplateDataDocument.php rename to lib/Model/TemplateDocument.php index fa8940a..a18b236 100644 --- a/lib/Model/UploadTemplateDataDocument.php +++ b/lib/Model/TemplateDocument.php @@ -1,8 +1,8 @@ */ -class UploadTemplateDataDocument implements ModelInterface, ArrayAccess +class TemplateDocument implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. * * @var string */ - protected static $openAPIModelName = 'upload_template_data_document'; + protected static $openAPIModelName = 'template_document'; /** * Array of property to type mappings. Used for (de)serialization @@ -57,8 +57,8 @@ class UploadTemplateDataDocument implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'metadata' => '\DocSpring\Model\UploadTemplateDataDocumentMetadata', 'id' => 'string', + 'metadata' => '\DocSpring\Model\TemplateDocumentMetadata', 'storage' => 'string' ]; @@ -66,13 +66,33 @@ class UploadTemplateDataDocument implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'metadata' => null, 'id' => null, + 'metadata' => null, 'storage' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'metadata' => false, + 'storage' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -93,6 +113,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -100,8 +172,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'metadata' => 'metadata', 'id' => 'id', + 'metadata' => 'metadata', 'storage' => 'storage' ]; @@ -111,8 +183,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'metadata' => 'setMetadata', 'id' => 'setId', + 'metadata' => 'setMetadata', 'storage' => 'setStorage' ]; @@ -122,8 +194,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'metadata' => 'getMetadata', 'id' => 'getId', + 'metadata' => 'getMetadata', 'storage' => 'getStorage' ]; @@ -168,10 +240,8 @@ public function getModelName() return self::$openAPIModelName; } - const STORAGE_CACHE = 'cache'; - + public const STORAGE_CACHE = 'cache'; - /** * Gets allowable values of the enum * @@ -183,7 +253,6 @@ public function getStorageAllowableValues() self::STORAGE_CACHE, ]; } - /** * Associative array for storing property values @@ -200,9 +269,27 @@ public function getStorageAllowableValues() */ public function __construct(array $data = null) { - $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['storage'] = isset($data['storage']) ? $data['storage'] : null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('storage', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -214,10 +301,20 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['metadata'] === null) { + $invalidProperties[] = "'metadata' can't be null"; + } + if ($this->container['storage'] === null) { + $invalidProperties[] = "'storage' can't be null"; + } $allowedValues = $this->getStorageAllowableValues(); if (!is_null($this->container['storage']) && !in_array($this->container['storage'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'storage', must be one of '%s'", + "invalid value '%s' for 'storage', must be one of '%s'", + $this->container['storage'], implode("', '", $allowedValues) ); } @@ -238,49 +335,55 @@ public function valid() /** - * Gets metadata + * Gets id * - * @return \DocSpring\Model\UploadTemplateDataDocumentMetadata|null + * @return string */ - public function getMetadata() + public function getId() { - return $this->container['metadata']; + return $this->container['id']; } /** - * Sets metadata + * Sets id * - * @param \DocSpring\Model\UploadTemplateDataDocumentMetadata|null $metadata metadata + * @param string $id id * - * @return $this + * @return self */ - public function setMetadata($metadata) + public function setId($id) { - $this->container['metadata'] = $metadata; + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; return $this; } /** - * Gets id + * Gets metadata * - * @return string|null + * @return \DocSpring\Model\TemplateDocumentMetadata */ - public function getId() + public function getMetadata() { - return $this->container['id']; + return $this->container['metadata']; } /** - * Sets id + * Sets metadata * - * @param string|null $id id + * @param \DocSpring\Model\TemplateDocumentMetadata $metadata metadata * - * @return $this + * @return self */ - public function setId($id) + public function setMetadata($metadata) { - $this->container['id'] = $id; + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + $this->container['metadata'] = $metadata; return $this; } @@ -288,7 +391,7 @@ public function setId($id) /** * Gets storage * - * @return string|null + * @return string */ public function getStorage() { @@ -298,17 +401,21 @@ public function getStorage() /** * Sets storage * - * @param string|null $storage storage + * @param string $storage storage * - * @return $this + * @return self */ public function setStorage($storage) { + if (is_null($storage)) { + throw new \InvalidArgumentException('non-nullable storage cannot be null'); + } $allowedValues = $this->getStorageAllowableValues(); - if (!is_null($storage) && !in_array($storage, $allowedValues, true)) { + if (!in_array($storage, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'storage', must be one of '%s'", + "Invalid value '%s' for 'storage', must be one of '%s'", + $storage, implode("', '", $allowedValues) ) ); @@ -324,7 +431,7 @@ public function setStorage($storage) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -334,22 +441,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -365,11 +473,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -382,6 +503,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/UploadTemplateDataDocumentMetadata.php b/lib/Model/TemplateDocumentMetadata.php similarity index 52% rename from lib/Model/UploadTemplateDataDocumentMetadata.php rename to lib/Model/TemplateDocumentMetadata.php index 5b8b8e5..dca46b6 100644 --- a/lib/Model/UploadTemplateDataDocumentMetadata.php +++ b/lib/Model/TemplateDocumentMetadata.php @@ -1,8 +1,8 @@ */ -class UploadTemplateDataDocumentMetadata implements ModelInterface, ArrayAccess +class TemplateDocumentMetadata implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. * * @var string */ - protected static $openAPIModelName = 'upload_template_data_document_metadata'; + protected static $openAPIModelName = 'template_document_metadata'; /** * Array of property to type mappings. Used for (de)serialization @@ -58,21 +58,41 @@ class UploadTemplateDataDocumentMetadata implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'filename' => 'string', - 'size' => 'int', - 'mime_type' => 'string' + 'mime_type' => 'string', + 'size' => 'int' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'filename' => null, - 'size' => null, - 'mime_type' => null + 'mime_type' => null, + 'size' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'filename' => false, + 'mime_type' => false, + 'size' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -93,6 +113,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -101,8 +173,8 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'filename' => 'filename', - 'size' => 'size', - 'mime_type' => 'mime_type' + 'mime_type' => 'mime_type', + 'size' => 'size' ]; /** @@ -112,8 +184,8 @@ public static function openAPIFormats() */ protected static $setters = [ 'filename' => 'setFilename', - 'size' => 'setSize', - 'mime_type' => 'setMimeType' + 'mime_type' => 'setMimeType', + 'size' => 'setSize' ]; /** @@ -123,8 +195,8 @@ public static function openAPIFormats() */ protected static $getters = [ 'filename' => 'getFilename', - 'size' => 'getSize', - 'mime_type' => 'getMimeType' + 'mime_type' => 'getMimeType', + 'size' => 'getSize' ]; /** @@ -168,10 +240,8 @@ public function getModelName() return self::$openAPIModelName; } - const MIME_TYPE_APPLICATIONPDF = 'application/pdf'; - + public const MIME_TYPE_APPLICATION_PDF = 'application/pdf'; - /** * Gets allowable values of the enum * @@ -180,10 +250,9 @@ public function getModelName() public function getMimeTypeAllowableValues() { return [ - self::MIME_TYPE_APPLICATIONPDF, + self::MIME_TYPE_APPLICATION_PDF, ]; } - /** * Associative array for storing property values @@ -200,9 +269,27 @@ public function getMimeTypeAllowableValues() */ public function __construct(array $data = null) { - $this->container['filename'] = isset($data['filename']) ? $data['filename'] : null; - $this->container['size'] = isset($data['size']) ? $data['size'] : null; - $this->container['mime_type'] = isset($data['mime_type']) ? $data['mime_type'] : null; + $this->setIfExists('filename', $data ?? [], null); + $this->setIfExists('mime_type', $data ?? [], null); + $this->setIfExists('size', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -214,14 +301,24 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['filename'] === null) { + $invalidProperties[] = "'filename' can't be null"; + } + if ($this->container['mime_type'] === null) { + $invalidProperties[] = "'mime_type' can't be null"; + } $allowedValues = $this->getMimeTypeAllowableValues(); if (!is_null($this->container['mime_type']) && !in_array($this->container['mime_type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'mime_type', must be one of '%s'", + "invalid value '%s' for 'mime_type', must be one of '%s'", + $this->container['mime_type'], implode("', '", $allowedValues) ); } + if ($this->container['size'] === null) { + $invalidProperties[] = "'size' can't be null"; + } return $invalidProperties; } @@ -240,7 +337,7 @@ public function valid() /** * Gets filename * - * @return string|null + * @return string */ public function getFilename() { @@ -250,70 +347,80 @@ public function getFilename() /** * Sets filename * - * @param string|null $filename filename + * @param string $filename filename * - * @return $this + * @return self */ public function setFilename($filename) { + if (is_null($filename)) { + throw new \InvalidArgumentException('non-nullable filename cannot be null'); + } $this->container['filename'] = $filename; return $this; } /** - * Gets size + * Gets mime_type * - * @return int|null + * @return string */ - public function getSize() + public function getMimeType() { - return $this->container['size']; + return $this->container['mime_type']; } /** - * Sets size + * Sets mime_type * - * @param int|null $size size + * @param string $mime_type mime_type * - * @return $this + * @return self */ - public function setSize($size) + public function setMimeType($mime_type) { - $this->container['size'] = $size; + if (is_null($mime_type)) { + throw new \InvalidArgumentException('non-nullable mime_type cannot be null'); + } + $allowedValues = $this->getMimeTypeAllowableValues(); + if (!in_array($mime_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'mime_type', must be one of '%s'", + $mime_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['mime_type'] = $mime_type; return $this; } /** - * Gets mime_type + * Gets size * - * @return string|null + * @return int */ - public function getMimeType() + public function getSize() { - return $this->container['mime_type']; + return $this->container['size']; } /** - * Sets mime_type + * Sets size * - * @param string|null $mime_type mime_type + * @param int $size size * - * @return $this + * @return self */ - public function setMimeType($mime_type) + public function setSize($size) { - $allowedValues = $this->getMimeTypeAllowableValues(); - if (!is_null($mime_type) && !in_array($mime_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'mime_type', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); } - $this->container['mime_type'] = $mime_type; + $this->container['size'] = $size; return $this; } @@ -324,7 +431,7 @@ public function setMimeType($mime_type) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -334,22 +441,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -365,11 +473,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -382,6 +503,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/TemplatestemplateIdaddFieldsFields.php b/lib/Model/TemplatestemplateIdaddFieldsFields.php deleted file mode 100644 index 2f483c2..0000000 --- a/lib/Model/TemplatestemplateIdaddFieldsFields.php +++ /dev/null @@ -1,3402 +0,0 @@ - 'string', - 'uppercase' => 'bool', - 'metadata' => 'string', - 'barcode_symbology' => 'string', - 'min_length' => 'float', - 'integer' => 'bool', - 'type' => 'string', - 'required' => 'bool', - 'comb_value_offset' => 'float', - 'image_gravity' => 'string', - 'overflow' => 'string', - 'qrcode_color' => 'string', - 'color_field_required' => 'bool', - 'background_color_field_required' => 'bool', - 'id' => 'float', - 'image_scale_type' => 'string', - 'exclusive_minimum' => 'bool', - 'height' => 'float', - 'number_condition_range_exclusive_max' => 'bool', - 'invert_boolean_condition' => 'bool', - 'shape_fill_color_field_name' => 'string', - 'static' => 'bool', - 'shape_border_color_field_name' => 'string', - 'v_alignment' => 'string', - 'bold' => 'bool', - 'shape_border_width' => 'float', - 'comb_number_of_cells' => 'float', - 'shape_border_color' => 'string', - 'comb' => 'bool', - 'typeface' => 'string', - 'shape_type' => 'string', - 'condition' => 'string', - 'display_type' => 'string', - 'check_color' => 'string', - 'multiline_lines' => 'float', - 'multiline' => 'bool', - 'true_text' => 'string', - 'name' => 'string', - 'font_size' => 'float', - 'page' => 'float', - 'alignment' => 'string', - 'max_length' => 'float', - 'auto_calculate_max_length' => 'bool', - 'color_field_name' => 'string', - 'qrcode_color_field_name' => 'string', - 'number_condition_range_min' => 'float', - 'color' => 'string', - 'hidden' => 'bool', - 'check_color_field_required' => 'bool', - 'combined_field_format' => 'string', - 'description' => 'string', - 'shape_border_color_field_required' => 'bool', - 'combined_field_names' => 'string', - 'title' => 'string', - 'number_condition_range_exclusive_min' => 'bool', - 'combined_field_separator' => 'string', - 'exclusive_maximum' => 'bool', - 'default' => 'string', - 'combined_field_type' => 'string', - 'date_time_format' => 'string', - 'qrcode_color_field_required' => 'bool', - 'currency' => 'bool', - 'false_text' => 'string', - 'placeholder' => 'string', - 'strikethrough' => 'bool', - 'character_spacing' => 'float', - 'number_condition_range_max' => 'float', - 'background_color' => 'string', - 'check_color_field_name' => 'string', - 'check_character' => 'string', - 'rotation' => 'float', - 'option_list' => 'string', - 'shape_fill_color' => 'string', - 'string_condition_type' => 'string', - 'shape_fill_color_field_required' => 'bool', - 'decimal_places' => 'float', - 'include_time' => 'bool', - 'width' => 'float', - 'x' => 'float', - 'maximum' => 'float', - 'y' => 'float', - 'signature_allow_draw' => 'bool', - 'number_condition_type' => 'string', - 'opacity' => 'float', - 'minimum' => 'float', - 'signature_allow_type' => 'bool' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - 'background_color_field_name' => null, - 'uppercase' => null, - 'metadata' => null, - 'barcode_symbology' => null, - 'min_length' => null, - 'integer' => null, - 'type' => null, - 'required' => null, - 'comb_value_offset' => null, - 'image_gravity' => null, - 'overflow' => null, - 'qrcode_color' => null, - 'color_field_required' => null, - 'background_color_field_required' => null, - 'id' => null, - 'image_scale_type' => null, - 'exclusive_minimum' => null, - 'height' => null, - 'number_condition_range_exclusive_max' => null, - 'invert_boolean_condition' => null, - 'shape_fill_color_field_name' => null, - 'static' => null, - 'shape_border_color_field_name' => null, - 'v_alignment' => null, - 'bold' => null, - 'shape_border_width' => null, - 'comb_number_of_cells' => null, - 'shape_border_color' => null, - 'comb' => null, - 'typeface' => null, - 'shape_type' => null, - 'condition' => null, - 'display_type' => null, - 'check_color' => null, - 'multiline_lines' => null, - 'multiline' => null, - 'true_text' => null, - 'name' => null, - 'font_size' => null, - 'page' => null, - 'alignment' => null, - 'max_length' => null, - 'auto_calculate_max_length' => null, - 'color_field_name' => null, - 'qrcode_color_field_name' => null, - 'number_condition_range_min' => null, - 'color' => null, - 'hidden' => null, - 'check_color_field_required' => null, - 'combined_field_format' => null, - 'description' => null, - 'shape_border_color_field_required' => null, - 'combined_field_names' => null, - 'title' => null, - 'number_condition_range_exclusive_min' => null, - 'combined_field_separator' => null, - 'exclusive_maximum' => null, - 'default' => null, - 'combined_field_type' => null, - 'date_time_format' => null, - 'qrcode_color_field_required' => null, - 'currency' => null, - 'false_text' => null, - 'placeholder' => null, - 'strikethrough' => null, - 'character_spacing' => null, - 'number_condition_range_max' => null, - 'background_color' => null, - 'check_color_field_name' => null, - 'check_character' => null, - 'rotation' => null, - 'option_list' => null, - 'shape_fill_color' => null, - 'string_condition_type' => null, - 'shape_fill_color_field_required' => null, - 'decimal_places' => null, - 'include_time' => null, - 'width' => null, - 'x' => null, - 'maximum' => null, - 'y' => null, - 'signature_allow_draw' => null, - 'number_condition_type' => null, - 'opacity' => null, - 'minimum' => null, - 'signature_allow_type' => 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 = [ - 'background_color_field_name' => 'backgroundColorFieldName', - 'uppercase' => 'uppercase', - 'metadata' => 'metadata', - 'barcode_symbology' => 'barcodeSymbology', - 'min_length' => 'minLength', - 'integer' => 'integer', - 'type' => 'type', - 'required' => 'required', - 'comb_value_offset' => 'combValueOffset', - 'image_gravity' => 'imageGravity', - 'overflow' => 'overflow', - 'qrcode_color' => 'qrcodeColor', - 'color_field_required' => 'colorFieldRequired', - 'background_color_field_required' => 'backgroundColorFieldRequired', - 'id' => 'id', - 'image_scale_type' => 'imageScaleType', - 'exclusive_minimum' => 'exclusiveMinimum', - 'height' => 'height', - 'number_condition_range_exclusive_max' => 'numberConditionRangeExclusiveMax', - 'invert_boolean_condition' => 'invertBooleanCondition', - 'shape_fill_color_field_name' => 'shapeFillColorFieldName', - 'static' => 'static', - 'shape_border_color_field_name' => 'shapeBorderColorFieldName', - 'v_alignment' => 'vAlignment', - 'bold' => 'bold', - 'shape_border_width' => 'shapeBorderWidth', - 'comb_number_of_cells' => 'combNumberOfCells', - 'shape_border_color' => 'shapeBorderColor', - 'comb' => 'comb', - 'typeface' => 'typeface', - 'shape_type' => 'shapeType', - 'condition' => 'condition', - 'display_type' => 'displayType', - 'check_color' => 'checkColor', - 'multiline_lines' => 'multilineLines', - 'multiline' => 'multiline', - 'true_text' => 'trueText', - 'name' => 'name', - 'font_size' => 'fontSize', - 'page' => 'page', - 'alignment' => 'alignment', - 'max_length' => 'maxLength', - 'auto_calculate_max_length' => 'autoCalculateMaxLength', - 'color_field_name' => 'colorFieldName', - 'qrcode_color_field_name' => 'qrcodeColorFieldName', - 'number_condition_range_min' => 'numberConditionRangeMin', - 'color' => 'color', - 'hidden' => 'hidden', - 'check_color_field_required' => 'checkColorFieldRequired', - 'combined_field_format' => 'combinedFieldFormat', - 'description' => 'description', - 'shape_border_color_field_required' => 'shapeBorderColorFieldRequired', - 'combined_field_names' => 'combinedFieldNames', - 'title' => 'title', - 'number_condition_range_exclusive_min' => 'numberConditionRangeExclusiveMin', - 'combined_field_separator' => 'combinedFieldSeparator', - 'exclusive_maximum' => 'exclusiveMaximum', - 'default' => 'default', - 'combined_field_type' => 'combinedFieldType', - 'date_time_format' => 'dateTimeFormat', - 'qrcode_color_field_required' => 'qrcodeColorFieldRequired', - 'currency' => 'currency', - 'false_text' => 'falseText', - 'placeholder' => 'placeholder', - 'strikethrough' => 'strikethrough', - 'character_spacing' => 'characterSpacing', - 'number_condition_range_max' => 'numberConditionRangeMax', - 'background_color' => 'backgroundColor', - 'check_color_field_name' => 'checkColorFieldName', - 'check_character' => 'checkCharacter', - 'rotation' => 'rotation', - 'option_list' => 'optionList', - 'shape_fill_color' => 'shapeFillColor', - 'string_condition_type' => 'stringConditionType', - 'shape_fill_color_field_required' => 'shapeFillColorFieldRequired', - 'decimal_places' => 'decimalPlaces', - 'include_time' => 'includeTime', - 'width' => 'width', - 'x' => 'x', - 'maximum' => 'maximum', - 'y' => 'y', - 'signature_allow_draw' => 'signatureAllowDraw', - 'number_condition_type' => 'numberConditionType', - 'opacity' => 'opacity', - 'minimum' => 'minimum', - 'signature_allow_type' => 'signatureAllowType' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'background_color_field_name' => 'setBackgroundColorFieldName', - 'uppercase' => 'setUppercase', - 'metadata' => 'setMetadata', - 'barcode_symbology' => 'setBarcodeSymbology', - 'min_length' => 'setMinLength', - 'integer' => 'setInteger', - 'type' => 'setType', - 'required' => 'setRequired', - 'comb_value_offset' => 'setCombValueOffset', - 'image_gravity' => 'setImageGravity', - 'overflow' => 'setOverflow', - 'qrcode_color' => 'setQrcodeColor', - 'color_field_required' => 'setColorFieldRequired', - 'background_color_field_required' => 'setBackgroundColorFieldRequired', - 'id' => 'setId', - 'image_scale_type' => 'setImageScaleType', - 'exclusive_minimum' => 'setExclusiveMinimum', - 'height' => 'setHeight', - 'number_condition_range_exclusive_max' => 'setNumberConditionRangeExclusiveMax', - 'invert_boolean_condition' => 'setInvertBooleanCondition', - 'shape_fill_color_field_name' => 'setShapeFillColorFieldName', - 'static' => 'setStatic', - 'shape_border_color_field_name' => 'setShapeBorderColorFieldName', - 'v_alignment' => 'setVAlignment', - 'bold' => 'setBold', - 'shape_border_width' => 'setShapeBorderWidth', - 'comb_number_of_cells' => 'setCombNumberOfCells', - 'shape_border_color' => 'setShapeBorderColor', - 'comb' => 'setComb', - 'typeface' => 'setTypeface', - 'shape_type' => 'setShapeType', - 'condition' => 'setCondition', - 'display_type' => 'setDisplayType', - 'check_color' => 'setCheckColor', - 'multiline_lines' => 'setMultilineLines', - 'multiline' => 'setMultiline', - 'true_text' => 'setTrueText', - 'name' => 'setName', - 'font_size' => 'setFontSize', - 'page' => 'setPage', - 'alignment' => 'setAlignment', - 'max_length' => 'setMaxLength', - 'auto_calculate_max_length' => 'setAutoCalculateMaxLength', - 'color_field_name' => 'setColorFieldName', - 'qrcode_color_field_name' => 'setQrcodeColorFieldName', - 'number_condition_range_min' => 'setNumberConditionRangeMin', - 'color' => 'setColor', - 'hidden' => 'setHidden', - 'check_color_field_required' => 'setCheckColorFieldRequired', - 'combined_field_format' => 'setCombinedFieldFormat', - 'description' => 'setDescription', - 'shape_border_color_field_required' => 'setShapeBorderColorFieldRequired', - 'combined_field_names' => 'setCombinedFieldNames', - 'title' => 'setTitle', - 'number_condition_range_exclusive_min' => 'setNumberConditionRangeExclusiveMin', - 'combined_field_separator' => 'setCombinedFieldSeparator', - 'exclusive_maximum' => 'setExclusiveMaximum', - 'default' => 'setDefault', - 'combined_field_type' => 'setCombinedFieldType', - 'date_time_format' => 'setDateTimeFormat', - 'qrcode_color_field_required' => 'setQrcodeColorFieldRequired', - 'currency' => 'setCurrency', - 'false_text' => 'setFalseText', - 'placeholder' => 'setPlaceholder', - 'strikethrough' => 'setStrikethrough', - 'character_spacing' => 'setCharacterSpacing', - 'number_condition_range_max' => 'setNumberConditionRangeMax', - 'background_color' => 'setBackgroundColor', - 'check_color_field_name' => 'setCheckColorFieldName', - 'check_character' => 'setCheckCharacter', - 'rotation' => 'setRotation', - 'option_list' => 'setOptionList', - 'shape_fill_color' => 'setShapeFillColor', - 'string_condition_type' => 'setStringConditionType', - 'shape_fill_color_field_required' => 'setShapeFillColorFieldRequired', - 'decimal_places' => 'setDecimalPlaces', - 'include_time' => 'setIncludeTime', - 'width' => 'setWidth', - 'x' => 'setX', - 'maximum' => 'setMaximum', - 'y' => 'setY', - 'signature_allow_draw' => 'setSignatureAllowDraw', - 'number_condition_type' => 'setNumberConditionType', - 'opacity' => 'setOpacity', - 'minimum' => 'setMinimum', - 'signature_allow_type' => 'setSignatureAllowType' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'background_color_field_name' => 'getBackgroundColorFieldName', - 'uppercase' => 'getUppercase', - 'metadata' => 'getMetadata', - 'barcode_symbology' => 'getBarcodeSymbology', - 'min_length' => 'getMinLength', - 'integer' => 'getInteger', - 'type' => 'getType', - 'required' => 'getRequired', - 'comb_value_offset' => 'getCombValueOffset', - 'image_gravity' => 'getImageGravity', - 'overflow' => 'getOverflow', - 'qrcode_color' => 'getQrcodeColor', - 'color_field_required' => 'getColorFieldRequired', - 'background_color_field_required' => 'getBackgroundColorFieldRequired', - 'id' => 'getId', - 'image_scale_type' => 'getImageScaleType', - 'exclusive_minimum' => 'getExclusiveMinimum', - 'height' => 'getHeight', - 'number_condition_range_exclusive_max' => 'getNumberConditionRangeExclusiveMax', - 'invert_boolean_condition' => 'getInvertBooleanCondition', - 'shape_fill_color_field_name' => 'getShapeFillColorFieldName', - 'static' => 'getStatic', - 'shape_border_color_field_name' => 'getShapeBorderColorFieldName', - 'v_alignment' => 'getVAlignment', - 'bold' => 'getBold', - 'shape_border_width' => 'getShapeBorderWidth', - 'comb_number_of_cells' => 'getCombNumberOfCells', - 'shape_border_color' => 'getShapeBorderColor', - 'comb' => 'getComb', - 'typeface' => 'getTypeface', - 'shape_type' => 'getShapeType', - 'condition' => 'getCondition', - 'display_type' => 'getDisplayType', - 'check_color' => 'getCheckColor', - 'multiline_lines' => 'getMultilineLines', - 'multiline' => 'getMultiline', - 'true_text' => 'getTrueText', - 'name' => 'getName', - 'font_size' => 'getFontSize', - 'page' => 'getPage', - 'alignment' => 'getAlignment', - 'max_length' => 'getMaxLength', - 'auto_calculate_max_length' => 'getAutoCalculateMaxLength', - 'color_field_name' => 'getColorFieldName', - 'qrcode_color_field_name' => 'getQrcodeColorFieldName', - 'number_condition_range_min' => 'getNumberConditionRangeMin', - 'color' => 'getColor', - 'hidden' => 'getHidden', - 'check_color_field_required' => 'getCheckColorFieldRequired', - 'combined_field_format' => 'getCombinedFieldFormat', - 'description' => 'getDescription', - 'shape_border_color_field_required' => 'getShapeBorderColorFieldRequired', - 'combined_field_names' => 'getCombinedFieldNames', - 'title' => 'getTitle', - 'number_condition_range_exclusive_min' => 'getNumberConditionRangeExclusiveMin', - 'combined_field_separator' => 'getCombinedFieldSeparator', - 'exclusive_maximum' => 'getExclusiveMaximum', - 'default' => 'getDefault', - 'combined_field_type' => 'getCombinedFieldType', - 'date_time_format' => 'getDateTimeFormat', - 'qrcode_color_field_required' => 'getQrcodeColorFieldRequired', - 'currency' => 'getCurrency', - 'false_text' => 'getFalseText', - 'placeholder' => 'getPlaceholder', - 'strikethrough' => 'getStrikethrough', - 'character_spacing' => 'getCharacterSpacing', - 'number_condition_range_max' => 'getNumberConditionRangeMax', - 'background_color' => 'getBackgroundColor', - 'check_color_field_name' => 'getCheckColorFieldName', - 'check_character' => 'getCheckCharacter', - 'rotation' => 'getRotation', - 'option_list' => 'getOptionList', - 'shape_fill_color' => 'getShapeFillColor', - 'string_condition_type' => 'getStringConditionType', - 'shape_fill_color_field_required' => 'getShapeFillColorFieldRequired', - 'decimal_places' => 'getDecimalPlaces', - 'include_time' => 'getIncludeTime', - 'width' => 'getWidth', - 'x' => 'getX', - 'maximum' => 'getMaximum', - 'y' => 'getY', - 'signature_allow_draw' => 'getSignatureAllowDraw', - 'number_condition_type' => 'getNumberConditionType', - 'opacity' => 'getOpacity', - 'minimum' => 'getMinimum', - 'signature_allow_type' => 'getSignatureAllowType' - ]; - - /** - * 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; - } - - const TYPE_STRING = 'string'; - const TYPE_NUMBER = 'number'; - const TYPE_BOOLEAN = 'boolean'; - const TYPE_DATE = 'date'; - const TYPE_ADDRESS = 'address'; - const TYPE_COUNTRY = 'country'; - const TYPE_EMAIL = 'email'; - const TYPE_URL = 'url'; - const TYPE_IMAGE = 'image'; - const TYPE_SIGNATURE = 'signature'; - const TYPE_BARCODE = 'barcode'; - const TYPE_COMBINED = 'combined'; - const IMAGE_GRAVITY_NORTH_WEST = 'NorthWest'; - const IMAGE_GRAVITY_NORTH = 'North'; - const IMAGE_GRAVITY_NORTH_EAST = 'NorthEast'; - const IMAGE_GRAVITY_WEST = 'West'; - const IMAGE_GRAVITY_CENTER = 'Center'; - const IMAGE_GRAVITY_EAST = 'East'; - const IMAGE_GRAVITY_SOUTH_WEST = 'SouthWest'; - const IMAGE_GRAVITY_SOUTH = 'South'; - const IMAGE_GRAVITY_SOUTH_EAST = 'SouthEast'; - const OVERFLOW_SHRINK_TO_FIT = 'shrink_to_fit'; - const OVERFLOW_TRUNCATE = 'truncate'; - const IMAGE_SCALE_TYPE_FIT = 'fit'; - const IMAGE_SCALE_TYPE_FILL = 'fill'; - const IMAGE_SCALE_TYPE_STRETCH = 'stretch'; - const V_ALIGNMENT_BOTTOM = 'bottom'; - const V_ALIGNMENT_CENTER = 'center'; - const V_ALIGNMENT_TOP = 'top'; - const SHAPE_TYPE_SQUARE = 'square'; - const SHAPE_TYPE_RECTANGLE = 'rectangle'; - const SHAPE_TYPE_CIRCLE = 'circle'; - const SHAPE_TYPE_ELLIPSE = 'ellipse'; - const DISPLAY_TYPE_TEXT = 'text'; - const DISPLAY_TYPE_CHECK = 'check'; - const DISPLAY_TYPE_QRCODE = 'qrcode'; - const DISPLAY_TYPE_BARCODE = 'barcode'; - const DISPLAY_TYPE_IMAGE = 'image'; - const DISPLAY_TYPE_SHAPE = 'shape'; - const ALIGNMENT_LEFT = 'left'; - const ALIGNMENT_CENTER = 'center'; - const ALIGNMENT_RIGHT = 'right'; - const CHECK_CHARACTER__10003 = '✓'; - const CHECK_CHARACTER__10004 = '✔'; - const CHECK_CHARACTER__10006 = '✖'; - const CHECK_CHARACTER__10007 = '✗'; - const CHECK_CHARACTER__10008 = '✘'; - const STRING_CONDITION_TYPE_EQUALS = 'equals'; - const STRING_CONDITION_TYPE_CONTAINS = 'contains'; - const STRING_CONDITION_TYPE_STARTS_WITH = 'starts_with'; - const STRING_CONDITION_TYPE_ENDS_WITH = 'ends_with'; - const STRING_CONDITION_TYPE_REGEX = 'regex'; - const NUMBER_CONDITION_TYPE_EQUALS = 'equals'; - const NUMBER_CONDITION_TYPE_RANGE = 'range'; - const NUMBER_CONDITION_TYPE_GTE = 'gte'; - const NUMBER_CONDITION_TYPE_GT = 'gt'; - const NUMBER_CONDITION_TYPE_LTE = 'lte'; - const NUMBER_CONDITION_TYPE_LT = 'lt'; - - - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_STRING, - self::TYPE_NUMBER, - self::TYPE_BOOLEAN, - self::TYPE_DATE, - self::TYPE_ADDRESS, - self::TYPE_COUNTRY, - self::TYPE_EMAIL, - self::TYPE_URL, - self::TYPE_IMAGE, - self::TYPE_SIGNATURE, - self::TYPE_BARCODE, - self::TYPE_COMBINED, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getImageGravityAllowableValues() - { - return [ - self::IMAGE_GRAVITY_NORTH_WEST, - self::IMAGE_GRAVITY_NORTH, - self::IMAGE_GRAVITY_NORTH_EAST, - self::IMAGE_GRAVITY_WEST, - self::IMAGE_GRAVITY_CENTER, - self::IMAGE_GRAVITY_EAST, - self::IMAGE_GRAVITY_SOUTH_WEST, - self::IMAGE_GRAVITY_SOUTH, - self::IMAGE_GRAVITY_SOUTH_EAST, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getOverflowAllowableValues() - { - return [ - self::OVERFLOW_SHRINK_TO_FIT, - self::OVERFLOW_TRUNCATE, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getImageScaleTypeAllowableValues() - { - return [ - self::IMAGE_SCALE_TYPE_FIT, - self::IMAGE_SCALE_TYPE_FILL, - self::IMAGE_SCALE_TYPE_STRETCH, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getVAlignmentAllowableValues() - { - return [ - self::V_ALIGNMENT_BOTTOM, - self::V_ALIGNMENT_CENTER, - self::V_ALIGNMENT_TOP, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getShapeTypeAllowableValues() - { - return [ - self::SHAPE_TYPE_SQUARE, - self::SHAPE_TYPE_RECTANGLE, - self::SHAPE_TYPE_CIRCLE, - self::SHAPE_TYPE_ELLIPSE, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getDisplayTypeAllowableValues() - { - return [ - self::DISPLAY_TYPE_TEXT, - self::DISPLAY_TYPE_CHECK, - self::DISPLAY_TYPE_QRCODE, - self::DISPLAY_TYPE_BARCODE, - self::DISPLAY_TYPE_IMAGE, - self::DISPLAY_TYPE_SHAPE, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getAlignmentAllowableValues() - { - return [ - self::ALIGNMENT_LEFT, - self::ALIGNMENT_CENTER, - self::ALIGNMENT_RIGHT, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getCheckCharacterAllowableValues() - { - return [ - self::CHECK_CHARACTER__10003, - self::CHECK_CHARACTER__10004, - self::CHECK_CHARACTER__10006, - self::CHECK_CHARACTER__10007, - self::CHECK_CHARACTER__10008, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStringConditionTypeAllowableValues() - { - return [ - self::STRING_CONDITION_TYPE_EQUALS, - self::STRING_CONDITION_TYPE_CONTAINS, - self::STRING_CONDITION_TYPE_STARTS_WITH, - self::STRING_CONDITION_TYPE_ENDS_WITH, - self::STRING_CONDITION_TYPE_REGEX, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getNumberConditionTypeAllowableValues() - { - return [ - self::NUMBER_CONDITION_TYPE_EQUALS, - self::NUMBER_CONDITION_TYPE_RANGE, - self::NUMBER_CONDITION_TYPE_GTE, - self::NUMBER_CONDITION_TYPE_GT, - self::NUMBER_CONDITION_TYPE_LTE, - self::NUMBER_CONDITION_TYPE_LT, - ]; - } - - - /** - * 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['background_color_field_name'] = isset($data['background_color_field_name']) ? $data['background_color_field_name'] : null; - $this->container['uppercase'] = isset($data['uppercase']) ? $data['uppercase'] : null; - $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; - $this->container['barcode_symbology'] = isset($data['barcode_symbology']) ? $data['barcode_symbology'] : null; - $this->container['min_length'] = isset($data['min_length']) ? $data['min_length'] : null; - $this->container['integer'] = isset($data['integer']) ? $data['integer'] : null; - $this->container['type'] = isset($data['type']) ? $data['type'] : null; - $this->container['required'] = isset($data['required']) ? $data['required'] : null; - $this->container['comb_value_offset'] = isset($data['comb_value_offset']) ? $data['comb_value_offset'] : null; - $this->container['image_gravity'] = isset($data['image_gravity']) ? $data['image_gravity'] : null; - $this->container['overflow'] = isset($data['overflow']) ? $data['overflow'] : null; - $this->container['qrcode_color'] = isset($data['qrcode_color']) ? $data['qrcode_color'] : null; - $this->container['color_field_required'] = isset($data['color_field_required']) ? $data['color_field_required'] : null; - $this->container['background_color_field_required'] = isset($data['background_color_field_required']) ? $data['background_color_field_required'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['image_scale_type'] = isset($data['image_scale_type']) ? $data['image_scale_type'] : null; - $this->container['exclusive_minimum'] = isset($data['exclusive_minimum']) ? $data['exclusive_minimum'] : null; - $this->container['height'] = isset($data['height']) ? $data['height'] : null; - $this->container['number_condition_range_exclusive_max'] = isset($data['number_condition_range_exclusive_max']) ? $data['number_condition_range_exclusive_max'] : null; - $this->container['invert_boolean_condition'] = isset($data['invert_boolean_condition']) ? $data['invert_boolean_condition'] : null; - $this->container['shape_fill_color_field_name'] = isset($data['shape_fill_color_field_name']) ? $data['shape_fill_color_field_name'] : null; - $this->container['static'] = isset($data['static']) ? $data['static'] : null; - $this->container['shape_border_color_field_name'] = isset($data['shape_border_color_field_name']) ? $data['shape_border_color_field_name'] : null; - $this->container['v_alignment'] = isset($data['v_alignment']) ? $data['v_alignment'] : null; - $this->container['bold'] = isset($data['bold']) ? $data['bold'] : null; - $this->container['shape_border_width'] = isset($data['shape_border_width']) ? $data['shape_border_width'] : null; - $this->container['comb_number_of_cells'] = isset($data['comb_number_of_cells']) ? $data['comb_number_of_cells'] : null; - $this->container['shape_border_color'] = isset($data['shape_border_color']) ? $data['shape_border_color'] : null; - $this->container['comb'] = isset($data['comb']) ? $data['comb'] : null; - $this->container['typeface'] = isset($data['typeface']) ? $data['typeface'] : null; - $this->container['shape_type'] = isset($data['shape_type']) ? $data['shape_type'] : null; - $this->container['condition'] = isset($data['condition']) ? $data['condition'] : null; - $this->container['display_type'] = isset($data['display_type']) ? $data['display_type'] : null; - $this->container['check_color'] = isset($data['check_color']) ? $data['check_color'] : null; - $this->container['multiline_lines'] = isset($data['multiline_lines']) ? $data['multiline_lines'] : null; - $this->container['multiline'] = isset($data['multiline']) ? $data['multiline'] : null; - $this->container['true_text'] = isset($data['true_text']) ? $data['true_text'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['font_size'] = isset($data['font_size']) ? $data['font_size'] : null; - $this->container['page'] = isset($data['page']) ? $data['page'] : null; - $this->container['alignment'] = isset($data['alignment']) ? $data['alignment'] : null; - $this->container['max_length'] = isset($data['max_length']) ? $data['max_length'] : null; - $this->container['auto_calculate_max_length'] = isset($data['auto_calculate_max_length']) ? $data['auto_calculate_max_length'] : null; - $this->container['color_field_name'] = isset($data['color_field_name']) ? $data['color_field_name'] : null; - $this->container['qrcode_color_field_name'] = isset($data['qrcode_color_field_name']) ? $data['qrcode_color_field_name'] : null; - $this->container['number_condition_range_min'] = isset($data['number_condition_range_min']) ? $data['number_condition_range_min'] : null; - $this->container['color'] = isset($data['color']) ? $data['color'] : null; - $this->container['hidden'] = isset($data['hidden']) ? $data['hidden'] : null; - $this->container['check_color_field_required'] = isset($data['check_color_field_required']) ? $data['check_color_field_required'] : null; - $this->container['combined_field_format'] = isset($data['combined_field_format']) ? $data['combined_field_format'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['shape_border_color_field_required'] = isset($data['shape_border_color_field_required']) ? $data['shape_border_color_field_required'] : null; - $this->container['combined_field_names'] = isset($data['combined_field_names']) ? $data['combined_field_names'] : null; - $this->container['title'] = isset($data['title']) ? $data['title'] : null; - $this->container['number_condition_range_exclusive_min'] = isset($data['number_condition_range_exclusive_min']) ? $data['number_condition_range_exclusive_min'] : null; - $this->container['combined_field_separator'] = isset($data['combined_field_separator']) ? $data['combined_field_separator'] : null; - $this->container['exclusive_maximum'] = isset($data['exclusive_maximum']) ? $data['exclusive_maximum'] : null; - $this->container['default'] = isset($data['default']) ? $data['default'] : null; - $this->container['combined_field_type'] = isset($data['combined_field_type']) ? $data['combined_field_type'] : null; - $this->container['date_time_format'] = isset($data['date_time_format']) ? $data['date_time_format'] : null; - $this->container['qrcode_color_field_required'] = isset($data['qrcode_color_field_required']) ? $data['qrcode_color_field_required'] : null; - $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; - $this->container['false_text'] = isset($data['false_text']) ? $data['false_text'] : null; - $this->container['placeholder'] = isset($data['placeholder']) ? $data['placeholder'] : null; - $this->container['strikethrough'] = isset($data['strikethrough']) ? $data['strikethrough'] : null; - $this->container['character_spacing'] = isset($data['character_spacing']) ? $data['character_spacing'] : null; - $this->container['number_condition_range_max'] = isset($data['number_condition_range_max']) ? $data['number_condition_range_max'] : null; - $this->container['background_color'] = isset($data['background_color']) ? $data['background_color'] : null; - $this->container['check_color_field_name'] = isset($data['check_color_field_name']) ? $data['check_color_field_name'] : null; - $this->container['check_character'] = isset($data['check_character']) ? $data['check_character'] : null; - $this->container['rotation'] = isset($data['rotation']) ? $data['rotation'] : null; - $this->container['option_list'] = isset($data['option_list']) ? $data['option_list'] : null; - $this->container['shape_fill_color'] = isset($data['shape_fill_color']) ? $data['shape_fill_color'] : null; - $this->container['string_condition_type'] = isset($data['string_condition_type']) ? $data['string_condition_type'] : null; - $this->container['shape_fill_color_field_required'] = isset($data['shape_fill_color_field_required']) ? $data['shape_fill_color_field_required'] : null; - $this->container['decimal_places'] = isset($data['decimal_places']) ? $data['decimal_places'] : null; - $this->container['include_time'] = isset($data['include_time']) ? $data['include_time'] : null; - $this->container['width'] = isset($data['width']) ? $data['width'] : null; - $this->container['x'] = isset($data['x']) ? $data['x'] : null; - $this->container['maximum'] = isset($data['maximum']) ? $data['maximum'] : null; - $this->container['y'] = isset($data['y']) ? $data['y'] : null; - $this->container['signature_allow_draw'] = isset($data['signature_allow_draw']) ? $data['signature_allow_draw'] : null; - $this->container['number_condition_type'] = isset($data['number_condition_type']) ? $data['number_condition_type'] : null; - $this->container['opacity'] = isset($data['opacity']) ? $data['opacity'] : null; - $this->container['minimum'] = isset($data['minimum']) ? $data['minimum'] : null; - $this->container['signature_allow_type'] = isset($data['signature_allow_type']) ? $data['signature_allow_type'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'type', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - $allowedValues = $this->getImageGravityAllowableValues(); - if (!is_null($this->container['image_gravity']) && !in_array($this->container['image_gravity'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'image_gravity', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - $allowedValues = $this->getOverflowAllowableValues(); - if (!is_null($this->container['overflow']) && !in_array($this->container['overflow'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'overflow', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - if (!is_null($this->container['id']) && ($this->container['id'] < 0)) { - $invalidProperties[] = "invalid value for 'id', must be bigger than or equal to 0."; - } - - $allowedValues = $this->getImageScaleTypeAllowableValues(); - if (!is_null($this->container['image_scale_type']) && !in_array($this->container['image_scale_type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'image_scale_type', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - if (!is_null($this->container['height']) && ($this->container['height'] < 0)) { - $invalidProperties[] = "invalid value for 'height', must be bigger than or equal to 0."; - } - - $allowedValues = $this->getVAlignmentAllowableValues(); - if (!is_null($this->container['v_alignment']) && !in_array($this->container['v_alignment'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'v_alignment', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - if (!is_null($this->container['shape_border_width']) && ($this->container['shape_border_width'] < 0)) { - $invalidProperties[] = "invalid value for 'shape_border_width', must be bigger than or equal to 0."; - } - - if (!is_null($this->container['comb_number_of_cells']) && ($this->container['comb_number_of_cells'] < 0)) { - $invalidProperties[] = "invalid value for 'comb_number_of_cells', must be bigger than or equal to 0."; - } - - $allowedValues = $this->getShapeTypeAllowableValues(); - if (!is_null($this->container['shape_type']) && !in_array($this->container['shape_type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'shape_type', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - $allowedValues = $this->getDisplayTypeAllowableValues(); - if (!is_null($this->container['display_type']) && !in_array($this->container['display_type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'display_type', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - if (!is_null($this->container['multiline_lines']) && ($this->container['multiline_lines'] < 0)) { - $invalidProperties[] = "invalid value for 'multiline_lines', must be bigger than or equal to 0."; - } - - if (!is_null($this->container['font_size']) && ($this->container['font_size'] < 0)) { - $invalidProperties[] = "invalid value for 'font_size', must be bigger than or equal to 0."; - } - - if (!is_null($this->container['page']) && ($this->container['page'] < 1)) { - $invalidProperties[] = "invalid value for 'page', must be bigger than or equal to 1."; - } - - $allowedValues = $this->getAlignmentAllowableValues(); - if (!is_null($this->container['alignment']) && !in_array($this->container['alignment'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'alignment', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - $allowedValues = $this->getCheckCharacterAllowableValues(); - if (!is_null($this->container['check_character']) && !in_array($this->container['check_character'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'check_character', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - if (!is_null($this->container['rotation']) && ($this->container['rotation'] > 3.6E+2)) { - $invalidProperties[] = "invalid value for 'rotation', must be smaller than or equal to 3.6E+2."; - } - - if (!is_null($this->container['rotation']) && ($this->container['rotation'] < 0)) { - $invalidProperties[] = "invalid value for 'rotation', must be bigger than or equal to 0."; - } - - $allowedValues = $this->getStringConditionTypeAllowableValues(); - if (!is_null($this->container['string_condition_type']) && !in_array($this->container['string_condition_type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'string_condition_type', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - if (!is_null($this->container['decimal_places']) && ($this->container['decimal_places'] < 0)) { - $invalidProperties[] = "invalid value for 'decimal_places', must be bigger than or equal to 0."; - } - - if (!is_null($this->container['width']) && ($this->container['width'] < 0)) { - $invalidProperties[] = "invalid value for 'width', must be bigger than or equal to 0."; - } - - if (!is_null($this->container['x']) && ($this->container['x'] < 0)) { - $invalidProperties[] = "invalid value for 'x', must be bigger than or equal to 0."; - } - - if (!is_null($this->container['y']) && ($this->container['y'] < 0)) { - $invalidProperties[] = "invalid value for 'y', must be bigger than or equal to 0."; - } - - $allowedValues = $this->getNumberConditionTypeAllowableValues(); - if (!is_null($this->container['number_condition_type']) && !in_array($this->container['number_condition_type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'number_condition_type', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - if (!is_null($this->container['opacity']) && ($this->container['opacity'] > 1)) { - $invalidProperties[] = "invalid value for 'opacity', must be smaller than or equal to 1."; - } - - if (!is_null($this->container['opacity']) && ($this->container['opacity'] < 0)) { - $invalidProperties[] = "invalid value for 'opacity', must be bigger than or equal to 0."; - } - - 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 background_color_field_name - * - * @return string|null - */ - public function getBackgroundColorFieldName() - { - return $this->container['background_color_field_name']; - } - - /** - * Sets background_color_field_name - * - * @param string|null $background_color_field_name background_color_field_name - * - * @return $this - */ - public function setBackgroundColorFieldName($background_color_field_name) - { - $this->container['background_color_field_name'] = $background_color_field_name; - - return $this; - } - - /** - * Gets uppercase - * - * @return bool|null - */ - public function getUppercase() - { - return $this->container['uppercase']; - } - - /** - * Sets uppercase - * - * @param bool|null $uppercase uppercase - * - * @return $this - */ - public function setUppercase($uppercase) - { - $this->container['uppercase'] = $uppercase; - - return $this; - } - - /** - * Gets metadata - * - * @return string|null - */ - public function getMetadata() - { - return $this->container['metadata']; - } - - /** - * Sets metadata - * - * @param string|null $metadata metadata - * - * @return $this - */ - public function setMetadata($metadata) - { - $this->container['metadata'] = $metadata; - - return $this; - } - - /** - * Gets barcode_symbology - * - * @return string|null - */ - public function getBarcodeSymbology() - { - return $this->container['barcode_symbology']; - } - - /** - * Sets barcode_symbology - * - * @param string|null $barcode_symbology barcode_symbology - * - * @return $this - */ - public function setBarcodeSymbology($barcode_symbology) - { - $this->container['barcode_symbology'] = $barcode_symbology; - - return $this; - } - - /** - * Gets min_length - * - * @return float|null - */ - public function getMinLength() - { - return $this->container['min_length']; - } - - /** - * Sets min_length - * - * @param float|null $min_length min_length - * - * @return $this - */ - public function setMinLength($min_length) - { - $this->container['min_length'] = $min_length; - - return $this; - } - - /** - * Gets integer - * - * @return bool|null - */ - public function getInteger() - { - return $this->container['integer']; - } - - /** - * Sets integer - * - * @param bool|null $integer integer - * - * @return $this - */ - public function setInteger($integer) - { - $this->container['integer'] = $integer; - - return $this; - } - - /** - * Gets type - * - * @return string|null - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string|null $type type - * - * @return $this - */ - public function setType($type) - { - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($type) && !in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'type', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets required - * - * @return bool|null - */ - public function getRequired() - { - return $this->container['required']; - } - - /** - * Sets required - * - * @param bool|null $required required - * - * @return $this - */ - public function setRequired($required) - { - $this->container['required'] = $required; - - return $this; - } - - /** - * Gets comb_value_offset - * - * @return float|null - */ - public function getCombValueOffset() - { - return $this->container['comb_value_offset']; - } - - /** - * Sets comb_value_offset - * - * @param float|null $comb_value_offset comb_value_offset - * - * @return $this - */ - public function setCombValueOffset($comb_value_offset) - { - $this->container['comb_value_offset'] = $comb_value_offset; - - return $this; - } - - /** - * Gets image_gravity - * - * @return string|null - */ - public function getImageGravity() - { - return $this->container['image_gravity']; - } - - /** - * Sets image_gravity - * - * @param string|null $image_gravity image_gravity - * - * @return $this - */ - public function setImageGravity($image_gravity) - { - $allowedValues = $this->getImageGravityAllowableValues(); - if (!is_null($image_gravity) && !in_array($image_gravity, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'image_gravity', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['image_gravity'] = $image_gravity; - - return $this; - } - - /** - * Gets overflow - * - * @return string|null - */ - public function getOverflow() - { - return $this->container['overflow']; - } - - /** - * Sets overflow - * - * @param string|null $overflow overflow - * - * @return $this - */ - public function setOverflow($overflow) - { - $allowedValues = $this->getOverflowAllowableValues(); - if (!is_null($overflow) && !in_array($overflow, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'overflow', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['overflow'] = $overflow; - - return $this; - } - - /** - * Gets qrcode_color - * - * @return string|null - */ - public function getQrcodeColor() - { - return $this->container['qrcode_color']; - } - - /** - * Sets qrcode_color - * - * @param string|null $qrcode_color qrcode_color - * - * @return $this - */ - public function setQrcodeColor($qrcode_color) - { - $this->container['qrcode_color'] = $qrcode_color; - - return $this; - } - - /** - * Gets color_field_required - * - * @return bool|null - */ - public function getColorFieldRequired() - { - return $this->container['color_field_required']; - } - - /** - * Sets color_field_required - * - * @param bool|null $color_field_required color_field_required - * - * @return $this - */ - public function setColorFieldRequired($color_field_required) - { - $this->container['color_field_required'] = $color_field_required; - - return $this; - } - - /** - * Gets background_color_field_required - * - * @return bool|null - */ - public function getBackgroundColorFieldRequired() - { - return $this->container['background_color_field_required']; - } - - /** - * Sets background_color_field_required - * - * @param bool|null $background_color_field_required background_color_field_required - * - * @return $this - */ - public function setBackgroundColorFieldRequired($background_color_field_required) - { - $this->container['background_color_field_required'] = $background_color_field_required; - - return $this; - } - - /** - * Gets id - * - * @return float|null - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param float|null $id id - * - * @return $this - */ - public function setId($id) - { - - if (!is_null($id) && ($id < 0)) { - throw new \InvalidArgumentException('invalid value for $id when calling TemplatestemplateIdaddFieldsFields., must be bigger than or equal to 0.'); - } - - $this->container['id'] = $id; - - return $this; - } - - /** - * Gets image_scale_type - * - * @return string|null - */ - public function getImageScaleType() - { - return $this->container['image_scale_type']; - } - - /** - * Sets image_scale_type - * - * @param string|null $image_scale_type image_scale_type - * - * @return $this - */ - public function setImageScaleType($image_scale_type) - { - $allowedValues = $this->getImageScaleTypeAllowableValues(); - if (!is_null($image_scale_type) && !in_array($image_scale_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'image_scale_type', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['image_scale_type'] = $image_scale_type; - - return $this; - } - - /** - * Gets exclusive_minimum - * - * @return bool|null - */ - public function getExclusiveMinimum() - { - return $this->container['exclusive_minimum']; - } - - /** - * Sets exclusive_minimum - * - * @param bool|null $exclusive_minimum exclusive_minimum - * - * @return $this - */ - public function setExclusiveMinimum($exclusive_minimum) - { - $this->container['exclusive_minimum'] = $exclusive_minimum; - - return $this; - } - - /** - * Gets height - * - * @return float|null - */ - public function getHeight() - { - return $this->container['height']; - } - - /** - * Sets height - * - * @param float|null $height height - * - * @return $this - */ - public function setHeight($height) - { - - if (!is_null($height) && ($height < 0)) { - throw new \InvalidArgumentException('invalid value for $height when calling TemplatestemplateIdaddFieldsFields., must be bigger than or equal to 0.'); - } - - $this->container['height'] = $height; - - return $this; - } - - /** - * Gets number_condition_range_exclusive_max - * - * @return bool|null - */ - public function getNumberConditionRangeExclusiveMax() - { - return $this->container['number_condition_range_exclusive_max']; - } - - /** - * Sets number_condition_range_exclusive_max - * - * @param bool|null $number_condition_range_exclusive_max number_condition_range_exclusive_max - * - * @return $this - */ - public function setNumberConditionRangeExclusiveMax($number_condition_range_exclusive_max) - { - $this->container['number_condition_range_exclusive_max'] = $number_condition_range_exclusive_max; - - return $this; - } - - /** - * Gets invert_boolean_condition - * - * @return bool|null - */ - public function getInvertBooleanCondition() - { - return $this->container['invert_boolean_condition']; - } - - /** - * Sets invert_boolean_condition - * - * @param bool|null $invert_boolean_condition invert_boolean_condition - * - * @return $this - */ - public function setInvertBooleanCondition($invert_boolean_condition) - { - $this->container['invert_boolean_condition'] = $invert_boolean_condition; - - return $this; - } - - /** - * Gets shape_fill_color_field_name - * - * @return string|null - */ - public function getShapeFillColorFieldName() - { - return $this->container['shape_fill_color_field_name']; - } - - /** - * Sets shape_fill_color_field_name - * - * @param string|null $shape_fill_color_field_name shape_fill_color_field_name - * - * @return $this - */ - public function setShapeFillColorFieldName($shape_fill_color_field_name) - { - $this->container['shape_fill_color_field_name'] = $shape_fill_color_field_name; - - return $this; - } - - /** - * Gets static - * - * @return bool|null - */ - public function getStatic() - { - return $this->container['static']; - } - - /** - * Sets static - * - * @param bool|null $static static - * - * @return $this - */ - public function setStatic($static) - { - $this->container['static'] = $static; - - return $this; - } - - /** - * Gets shape_border_color_field_name - * - * @return string|null - */ - public function getShapeBorderColorFieldName() - { - return $this->container['shape_border_color_field_name']; - } - - /** - * Sets shape_border_color_field_name - * - * @param string|null $shape_border_color_field_name shape_border_color_field_name - * - * @return $this - */ - public function setShapeBorderColorFieldName($shape_border_color_field_name) - { - $this->container['shape_border_color_field_name'] = $shape_border_color_field_name; - - return $this; - } - - /** - * Gets v_alignment - * - * @return string|null - */ - public function getVAlignment() - { - return $this->container['v_alignment']; - } - - /** - * Sets v_alignment - * - * @param string|null $v_alignment v_alignment - * - * @return $this - */ - public function setVAlignment($v_alignment) - { - $allowedValues = $this->getVAlignmentAllowableValues(); - if (!is_null($v_alignment) && !in_array($v_alignment, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'v_alignment', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['v_alignment'] = $v_alignment; - - return $this; - } - - /** - * Gets bold - * - * @return bool|null - */ - public function getBold() - { - return $this->container['bold']; - } - - /** - * Sets bold - * - * @param bool|null $bold bold - * - * @return $this - */ - public function setBold($bold) - { - $this->container['bold'] = $bold; - - return $this; - } - - /** - * Gets shape_border_width - * - * @return float|null - */ - public function getShapeBorderWidth() - { - return $this->container['shape_border_width']; - } - - /** - * Sets shape_border_width - * - * @param float|null $shape_border_width shape_border_width - * - * @return $this - */ - public function setShapeBorderWidth($shape_border_width) - { - - if (!is_null($shape_border_width) && ($shape_border_width < 0)) { - throw new \InvalidArgumentException('invalid value for $shape_border_width when calling TemplatestemplateIdaddFieldsFields., must be bigger than or equal to 0.'); - } - - $this->container['shape_border_width'] = $shape_border_width; - - return $this; - } - - /** - * Gets comb_number_of_cells - * - * @return float|null - */ - public function getCombNumberOfCells() - { - return $this->container['comb_number_of_cells']; - } - - /** - * Sets comb_number_of_cells - * - * @param float|null $comb_number_of_cells comb_number_of_cells - * - * @return $this - */ - public function setCombNumberOfCells($comb_number_of_cells) - { - - if (!is_null($comb_number_of_cells) && ($comb_number_of_cells < 0)) { - throw new \InvalidArgumentException('invalid value for $comb_number_of_cells when calling TemplatestemplateIdaddFieldsFields., must be bigger than or equal to 0.'); - } - - $this->container['comb_number_of_cells'] = $comb_number_of_cells; - - return $this; - } - - /** - * Gets shape_border_color - * - * @return string|null - */ - public function getShapeBorderColor() - { - return $this->container['shape_border_color']; - } - - /** - * Sets shape_border_color - * - * @param string|null $shape_border_color shape_border_color - * - * @return $this - */ - public function setShapeBorderColor($shape_border_color) - { - $this->container['shape_border_color'] = $shape_border_color; - - return $this; - } - - /** - * Gets comb - * - * @return bool|null - */ - public function getComb() - { - return $this->container['comb']; - } - - /** - * Sets comb - * - * @param bool|null $comb comb - * - * @return $this - */ - public function setComb($comb) - { - $this->container['comb'] = $comb; - - return $this; - } - - /** - * Gets typeface - * - * @return string|null - */ - public function getTypeface() - { - return $this->container['typeface']; - } - - /** - * Sets typeface - * - * @param string|null $typeface typeface - * - * @return $this - */ - public function setTypeface($typeface) - { - $this->container['typeface'] = $typeface; - - return $this; - } - - /** - * Gets shape_type - * - * @return string|null - */ - public function getShapeType() - { - return $this->container['shape_type']; - } - - /** - * Sets shape_type - * - * @param string|null $shape_type shape_type - * - * @return $this - */ - public function setShapeType($shape_type) - { - $allowedValues = $this->getShapeTypeAllowableValues(); - if (!is_null($shape_type) && !in_array($shape_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'shape_type', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['shape_type'] = $shape_type; - - return $this; - } - - /** - * Gets condition - * - * @return string|null - */ - public function getCondition() - { - return $this->container['condition']; - } - - /** - * Sets condition - * - * @param string|null $condition condition - * - * @return $this - */ - public function setCondition($condition) - { - $this->container['condition'] = $condition; - - return $this; - } - - /** - * Gets display_type - * - * @return string|null - */ - public function getDisplayType() - { - return $this->container['display_type']; - } - - /** - * Sets display_type - * - * @param string|null $display_type display_type - * - * @return $this - */ - public function setDisplayType($display_type) - { - $allowedValues = $this->getDisplayTypeAllowableValues(); - if (!is_null($display_type) && !in_array($display_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'display_type', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['display_type'] = $display_type; - - return $this; - } - - /** - * Gets check_color - * - * @return string|null - */ - public function getCheckColor() - { - return $this->container['check_color']; - } - - /** - * Sets check_color - * - * @param string|null $check_color check_color - * - * @return $this - */ - public function setCheckColor($check_color) - { - $this->container['check_color'] = $check_color; - - return $this; - } - - /** - * Gets multiline_lines - * - * @return float|null - */ - public function getMultilineLines() - { - return $this->container['multiline_lines']; - } - - /** - * Sets multiline_lines - * - * @param float|null $multiline_lines multiline_lines - * - * @return $this - */ - public function setMultilineLines($multiline_lines) - { - - if (!is_null($multiline_lines) && ($multiline_lines < 0)) { - throw new \InvalidArgumentException('invalid value for $multiline_lines when calling TemplatestemplateIdaddFieldsFields., must be bigger than or equal to 0.'); - } - - $this->container['multiline_lines'] = $multiline_lines; - - return $this; - } - - /** - * Gets multiline - * - * @return bool|null - */ - public function getMultiline() - { - return $this->container['multiline']; - } - - /** - * Sets multiline - * - * @param bool|null $multiline multiline - * - * @return $this - */ - public function setMultiline($multiline) - { - $this->container['multiline'] = $multiline; - - return $this; - } - - /** - * Gets true_text - * - * @return string|null - */ - public function getTrueText() - { - return $this->container['true_text']; - } - - /** - * Sets true_text - * - * @param string|null $true_text true_text - * - * @return $this - */ - public function setTrueText($true_text) - { - $this->container['true_text'] = $true_text; - - return $this; - } - - /** - * Gets name - * - * @return string|null - */ - public function getName() - { - return $this->container['name']; - } - - /** - * Sets name - * - * @param string|null $name name - * - * @return $this - */ - public function setName($name) - { - $this->container['name'] = $name; - - return $this; - } - - /** - * Gets font_size - * - * @return float|null - */ - public function getFontSize() - { - return $this->container['font_size']; - } - - /** - * Sets font_size - * - * @param float|null $font_size font_size - * - * @return $this - */ - public function setFontSize($font_size) - { - - if (!is_null($font_size) && ($font_size < 0)) { - throw new \InvalidArgumentException('invalid value for $font_size when calling TemplatestemplateIdaddFieldsFields., must be bigger than or equal to 0.'); - } - - $this->container['font_size'] = $font_size; - - return $this; - } - - /** - * Gets page - * - * @return float|null - */ - public function getPage() - { - return $this->container['page']; - } - - /** - * Sets page - * - * @param float|null $page page - * - * @return $this - */ - public function setPage($page) - { - - if (!is_null($page) && ($page < 1)) { - throw new \InvalidArgumentException('invalid value for $page when calling TemplatestemplateIdaddFieldsFields., must be bigger than or equal to 1.'); - } - - $this->container['page'] = $page; - - return $this; - } - - /** - * Gets alignment - * - * @return string|null - */ - public function getAlignment() - { - return $this->container['alignment']; - } - - /** - * Sets alignment - * - * @param string|null $alignment alignment - * - * @return $this - */ - public function setAlignment($alignment) - { - $allowedValues = $this->getAlignmentAllowableValues(); - if (!is_null($alignment) && !in_array($alignment, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'alignment', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['alignment'] = $alignment; - - return $this; - } - - /** - * Gets max_length - * - * @return float|null - */ - public function getMaxLength() - { - return $this->container['max_length']; - } - - /** - * Sets max_length - * - * @param float|null $max_length max_length - * - * @return $this - */ - public function setMaxLength($max_length) - { - $this->container['max_length'] = $max_length; - - return $this; - } - - /** - * Gets auto_calculate_max_length - * - * @return bool|null - */ - public function getAutoCalculateMaxLength() - { - return $this->container['auto_calculate_max_length']; - } - - /** - * Sets auto_calculate_max_length - * - * @param bool|null $auto_calculate_max_length auto_calculate_max_length - * - * @return $this - */ - public function setAutoCalculateMaxLength($auto_calculate_max_length) - { - $this->container['auto_calculate_max_length'] = $auto_calculate_max_length; - - return $this; - } - - /** - * Gets color_field_name - * - * @return string|null - */ - public function getColorFieldName() - { - return $this->container['color_field_name']; - } - - /** - * Sets color_field_name - * - * @param string|null $color_field_name color_field_name - * - * @return $this - */ - public function setColorFieldName($color_field_name) - { - $this->container['color_field_name'] = $color_field_name; - - return $this; - } - - /** - * Gets qrcode_color_field_name - * - * @return string|null - */ - public function getQrcodeColorFieldName() - { - return $this->container['qrcode_color_field_name']; - } - - /** - * Sets qrcode_color_field_name - * - * @param string|null $qrcode_color_field_name qrcode_color_field_name - * - * @return $this - */ - public function setQrcodeColorFieldName($qrcode_color_field_name) - { - $this->container['qrcode_color_field_name'] = $qrcode_color_field_name; - - return $this; - } - - /** - * Gets number_condition_range_min - * - * @return float|null - */ - public function getNumberConditionRangeMin() - { - return $this->container['number_condition_range_min']; - } - - /** - * Sets number_condition_range_min - * - * @param float|null $number_condition_range_min number_condition_range_min - * - * @return $this - */ - public function setNumberConditionRangeMin($number_condition_range_min) - { - $this->container['number_condition_range_min'] = $number_condition_range_min; - - return $this; - } - - /** - * Gets color - * - * @return string|null - */ - public function getColor() - { - return $this->container['color']; - } - - /** - * Sets color - * - * @param string|null $color color - * - * @return $this - */ - public function setColor($color) - { - $this->container['color'] = $color; - - return $this; - } - - /** - * Gets hidden - * - * @return bool|null - */ - public function getHidden() - { - return $this->container['hidden']; - } - - /** - * Sets hidden - * - * @param bool|null $hidden hidden - * - * @return $this - */ - public function setHidden($hidden) - { - $this->container['hidden'] = $hidden; - - return $this; - } - - /** - * Gets check_color_field_required - * - * @return bool|null - */ - public function getCheckColorFieldRequired() - { - return $this->container['check_color_field_required']; - } - - /** - * Sets check_color_field_required - * - * @param bool|null $check_color_field_required check_color_field_required - * - * @return $this - */ - public function setCheckColorFieldRequired($check_color_field_required) - { - $this->container['check_color_field_required'] = $check_color_field_required; - - return $this; - } - - /** - * Gets combined_field_format - * - * @return string|null - */ - public function getCombinedFieldFormat() - { - return $this->container['combined_field_format']; - } - - /** - * Sets combined_field_format - * - * @param string|null $combined_field_format combined_field_format - * - * @return $this - */ - public function setCombinedFieldFormat($combined_field_format) - { - $this->container['combined_field_format'] = $combined_field_format; - - return $this; - } - - /** - * Gets description - * - * @return string|null - */ - public function getDescription() - { - return $this->container['description']; - } - - /** - * Sets description - * - * @param string|null $description description - * - * @return $this - */ - public function setDescription($description) - { - $this->container['description'] = $description; - - return $this; - } - - /** - * Gets shape_border_color_field_required - * - * @return bool|null - */ - public function getShapeBorderColorFieldRequired() - { - return $this->container['shape_border_color_field_required']; - } - - /** - * Sets shape_border_color_field_required - * - * @param bool|null $shape_border_color_field_required shape_border_color_field_required - * - * @return $this - */ - public function setShapeBorderColorFieldRequired($shape_border_color_field_required) - { - $this->container['shape_border_color_field_required'] = $shape_border_color_field_required; - - return $this; - } - - /** - * Gets combined_field_names - * - * @return string|null - */ - public function getCombinedFieldNames() - { - return $this->container['combined_field_names']; - } - - /** - * Sets combined_field_names - * - * @param string|null $combined_field_names combined_field_names - * - * @return $this - */ - public function setCombinedFieldNames($combined_field_names) - { - $this->container['combined_field_names'] = $combined_field_names; - - return $this; - } - - /** - * Gets title - * - * @return string|null - */ - public function getTitle() - { - return $this->container['title']; - } - - /** - * Sets title - * - * @param string|null $title title - * - * @return $this - */ - public function setTitle($title) - { - $this->container['title'] = $title; - - return $this; - } - - /** - * Gets number_condition_range_exclusive_min - * - * @return bool|null - */ - public function getNumberConditionRangeExclusiveMin() - { - return $this->container['number_condition_range_exclusive_min']; - } - - /** - * Sets number_condition_range_exclusive_min - * - * @param bool|null $number_condition_range_exclusive_min number_condition_range_exclusive_min - * - * @return $this - */ - public function setNumberConditionRangeExclusiveMin($number_condition_range_exclusive_min) - { - $this->container['number_condition_range_exclusive_min'] = $number_condition_range_exclusive_min; - - return $this; - } - - /** - * Gets combined_field_separator - * - * @return string|null - */ - public function getCombinedFieldSeparator() - { - return $this->container['combined_field_separator']; - } - - /** - * Sets combined_field_separator - * - * @param string|null $combined_field_separator combined_field_separator - * - * @return $this - */ - public function setCombinedFieldSeparator($combined_field_separator) - { - $this->container['combined_field_separator'] = $combined_field_separator; - - return $this; - } - - /** - * Gets exclusive_maximum - * - * @return bool|null - */ - public function getExclusiveMaximum() - { - return $this->container['exclusive_maximum']; - } - - /** - * Sets exclusive_maximum - * - * @param bool|null $exclusive_maximum exclusive_maximum - * - * @return $this - */ - public function setExclusiveMaximum($exclusive_maximum) - { - $this->container['exclusive_maximum'] = $exclusive_maximum; - - return $this; - } - - /** - * Gets default - * - * @return string|null - */ - public function getDefault() - { - return $this->container['default']; - } - - /** - * Sets default - * - * @param string|null $default default - * - * @return $this - */ - public function setDefault($default) - { - $this->container['default'] = $default; - - return $this; - } - - /** - * Gets combined_field_type - * - * @return string|null - */ - public function getCombinedFieldType() - { - return $this->container['combined_field_type']; - } - - /** - * Sets combined_field_type - * - * @param string|null $combined_field_type combined_field_type - * - * @return $this - */ - public function setCombinedFieldType($combined_field_type) - { - $this->container['combined_field_type'] = $combined_field_type; - - return $this; - } - - /** - * Gets date_time_format - * - * @return string|null - */ - public function getDateTimeFormat() - { - return $this->container['date_time_format']; - } - - /** - * Sets date_time_format - * - * @param string|null $date_time_format date_time_format - * - * @return $this - */ - public function setDateTimeFormat($date_time_format) - { - $this->container['date_time_format'] = $date_time_format; - - return $this; - } - - /** - * Gets qrcode_color_field_required - * - * @return bool|null - */ - public function getQrcodeColorFieldRequired() - { - return $this->container['qrcode_color_field_required']; - } - - /** - * Sets qrcode_color_field_required - * - * @param bool|null $qrcode_color_field_required qrcode_color_field_required - * - * @return $this - */ - public function setQrcodeColorFieldRequired($qrcode_color_field_required) - { - $this->container['qrcode_color_field_required'] = $qrcode_color_field_required; - - return $this; - } - - /** - * Gets currency - * - * @return bool|null - */ - public function getCurrency() - { - return $this->container['currency']; - } - - /** - * Sets currency - * - * @param bool|null $currency currency - * - * @return $this - */ - public function setCurrency($currency) - { - $this->container['currency'] = $currency; - - return $this; - } - - /** - * Gets false_text - * - * @return string|null - */ - public function getFalseText() - { - return $this->container['false_text']; - } - - /** - * Sets false_text - * - * @param string|null $false_text false_text - * - * @return $this - */ - public function setFalseText($false_text) - { - $this->container['false_text'] = $false_text; - - return $this; - } - - /** - * Gets placeholder - * - * @return string|null - */ - public function getPlaceholder() - { - return $this->container['placeholder']; - } - - /** - * Sets placeholder - * - * @param string|null $placeholder placeholder - * - * @return $this - */ - public function setPlaceholder($placeholder) - { - $this->container['placeholder'] = $placeholder; - - return $this; - } - - /** - * Gets strikethrough - * - * @return bool|null - */ - public function getStrikethrough() - { - return $this->container['strikethrough']; - } - - /** - * Sets strikethrough - * - * @param bool|null $strikethrough strikethrough - * - * @return $this - */ - public function setStrikethrough($strikethrough) - { - $this->container['strikethrough'] = $strikethrough; - - return $this; - } - - /** - * Gets character_spacing - * - * @return float|null - */ - public function getCharacterSpacing() - { - return $this->container['character_spacing']; - } - - /** - * Sets character_spacing - * - * @param float|null $character_spacing character_spacing - * - * @return $this - */ - public function setCharacterSpacing($character_spacing) - { - $this->container['character_spacing'] = $character_spacing; - - return $this; - } - - /** - * Gets number_condition_range_max - * - * @return float|null - */ - public function getNumberConditionRangeMax() - { - return $this->container['number_condition_range_max']; - } - - /** - * Sets number_condition_range_max - * - * @param float|null $number_condition_range_max number_condition_range_max - * - * @return $this - */ - public function setNumberConditionRangeMax($number_condition_range_max) - { - $this->container['number_condition_range_max'] = $number_condition_range_max; - - return $this; - } - - /** - * Gets background_color - * - * @return string|null - */ - public function getBackgroundColor() - { - return $this->container['background_color']; - } - - /** - * Sets background_color - * - * @param string|null $background_color background_color - * - * @return $this - */ - public function setBackgroundColor($background_color) - { - $this->container['background_color'] = $background_color; - - return $this; - } - - /** - * Gets check_color_field_name - * - * @return string|null - */ - public function getCheckColorFieldName() - { - return $this->container['check_color_field_name']; - } - - /** - * Sets check_color_field_name - * - * @param string|null $check_color_field_name check_color_field_name - * - * @return $this - */ - public function setCheckColorFieldName($check_color_field_name) - { - $this->container['check_color_field_name'] = $check_color_field_name; - - return $this; - } - - /** - * Gets check_character - * - * @return string|null - */ - public function getCheckCharacter() - { - return $this->container['check_character']; - } - - /** - * Sets check_character - * - * @param string|null $check_character check_character - * - * @return $this - */ - public function setCheckCharacter($check_character) - { - $allowedValues = $this->getCheckCharacterAllowableValues(); - if (!is_null($check_character) && !in_array($check_character, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'check_character', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['check_character'] = $check_character; - - return $this; - } - - /** - * Gets rotation - * - * @return float|null - */ - public function getRotation() - { - return $this->container['rotation']; - } - - /** - * Sets rotation - * - * @param float|null $rotation rotation - * - * @return $this - */ - public function setRotation($rotation) - { - - if (!is_null($rotation) && ($rotation > 3.6E+2)) { - throw new \InvalidArgumentException('invalid value for $rotation when calling TemplatestemplateIdaddFieldsFields., must be smaller than or equal to 3.6E+2.'); - } - if (!is_null($rotation) && ($rotation < 0)) { - throw new \InvalidArgumentException('invalid value for $rotation when calling TemplatestemplateIdaddFieldsFields., must be bigger than or equal to 0.'); - } - - $this->container['rotation'] = $rotation; - - return $this; - } - - /** - * Gets option_list - * - * @return string|null - */ - public function getOptionList() - { - return $this->container['option_list']; - } - - /** - * Sets option_list - * - * @param string|null $option_list option_list - * - * @return $this - */ - public function setOptionList($option_list) - { - $this->container['option_list'] = $option_list; - - return $this; - } - - /** - * Gets shape_fill_color - * - * @return string|null - */ - public function getShapeFillColor() - { - return $this->container['shape_fill_color']; - } - - /** - * Sets shape_fill_color - * - * @param string|null $shape_fill_color shape_fill_color - * - * @return $this - */ - public function setShapeFillColor($shape_fill_color) - { - $this->container['shape_fill_color'] = $shape_fill_color; - - return $this; - } - - /** - * Gets string_condition_type - * - * @return string|null - */ - public function getStringConditionType() - { - return $this->container['string_condition_type']; - } - - /** - * Sets string_condition_type - * - * @param string|null $string_condition_type string_condition_type - * - * @return $this - */ - public function setStringConditionType($string_condition_type) - { - $allowedValues = $this->getStringConditionTypeAllowableValues(); - if (!is_null($string_condition_type) && !in_array($string_condition_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'string_condition_type', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['string_condition_type'] = $string_condition_type; - - return $this; - } - - /** - * Gets shape_fill_color_field_required - * - * @return bool|null - */ - public function getShapeFillColorFieldRequired() - { - return $this->container['shape_fill_color_field_required']; - } - - /** - * Sets shape_fill_color_field_required - * - * @param bool|null $shape_fill_color_field_required shape_fill_color_field_required - * - * @return $this - */ - public function setShapeFillColorFieldRequired($shape_fill_color_field_required) - { - $this->container['shape_fill_color_field_required'] = $shape_fill_color_field_required; - - return $this; - } - - /** - * Gets decimal_places - * - * @return float|null - */ - public function getDecimalPlaces() - { - return $this->container['decimal_places']; - } - - /** - * Sets decimal_places - * - * @param float|null $decimal_places decimal_places - * - * @return $this - */ - public function setDecimalPlaces($decimal_places) - { - - if (!is_null($decimal_places) && ($decimal_places < 0)) { - throw new \InvalidArgumentException('invalid value for $decimal_places when calling TemplatestemplateIdaddFieldsFields., must be bigger than or equal to 0.'); - } - - $this->container['decimal_places'] = $decimal_places; - - return $this; - } - - /** - * Gets include_time - * - * @return bool|null - */ - public function getIncludeTime() - { - return $this->container['include_time']; - } - - /** - * Sets include_time - * - * @param bool|null $include_time include_time - * - * @return $this - */ - public function setIncludeTime($include_time) - { - $this->container['include_time'] = $include_time; - - return $this; - } - - /** - * Gets width - * - * @return float|null - */ - public function getWidth() - { - return $this->container['width']; - } - - /** - * Sets width - * - * @param float|null $width width - * - * @return $this - */ - public function setWidth($width) - { - - if (!is_null($width) && ($width < 0)) { - throw new \InvalidArgumentException('invalid value for $width when calling TemplatestemplateIdaddFieldsFields., must be bigger than or equal to 0.'); - } - - $this->container['width'] = $width; - - return $this; - } - - /** - * Gets x - * - * @return float|null - */ - public function getX() - { - return $this->container['x']; - } - - /** - * Sets x - * - * @param float|null $x x - * - * @return $this - */ - public function setX($x) - { - - if (!is_null($x) && ($x < 0)) { - throw new \InvalidArgumentException('invalid value for $x when calling TemplatestemplateIdaddFieldsFields., must be bigger than or equal to 0.'); - } - - $this->container['x'] = $x; - - return $this; - } - - /** - * Gets maximum - * - * @return float|null - */ - public function getMaximum() - { - return $this->container['maximum']; - } - - /** - * Sets maximum - * - * @param float|null $maximum maximum - * - * @return $this - */ - public function setMaximum($maximum) - { - $this->container['maximum'] = $maximum; - - return $this; - } - - /** - * Gets y - * - * @return float|null - */ - public function getY() - { - return $this->container['y']; - } - - /** - * Sets y - * - * @param float|null $y y - * - * @return $this - */ - public function setY($y) - { - - if (!is_null($y) && ($y < 0)) { - throw new \InvalidArgumentException('invalid value for $y when calling TemplatestemplateIdaddFieldsFields., must be bigger than or equal to 0.'); - } - - $this->container['y'] = $y; - - return $this; - } - - /** - * Gets signature_allow_draw - * - * @return bool|null - */ - public function getSignatureAllowDraw() - { - return $this->container['signature_allow_draw']; - } - - /** - * Sets signature_allow_draw - * - * @param bool|null $signature_allow_draw signature_allow_draw - * - * @return $this - */ - public function setSignatureAllowDraw($signature_allow_draw) - { - $this->container['signature_allow_draw'] = $signature_allow_draw; - - return $this; - } - - /** - * Gets number_condition_type - * - * @return string|null - */ - public function getNumberConditionType() - { - return $this->container['number_condition_type']; - } - - /** - * Sets number_condition_type - * - * @param string|null $number_condition_type number_condition_type - * - * @return $this - */ - public function setNumberConditionType($number_condition_type) - { - $allowedValues = $this->getNumberConditionTypeAllowableValues(); - if (!is_null($number_condition_type) && !in_array($number_condition_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'number_condition_type', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['number_condition_type'] = $number_condition_type; - - return $this; - } - - /** - * Gets opacity - * - * @return float|null - */ - public function getOpacity() - { - return $this->container['opacity']; - } - - /** - * Sets opacity - * - * @param float|null $opacity opacity - * - * @return $this - */ - public function setOpacity($opacity) - { - - if (!is_null($opacity) && ($opacity > 1)) { - throw new \InvalidArgumentException('invalid value for $opacity when calling TemplatestemplateIdaddFieldsFields., must be smaller than or equal to 1.'); - } - if (!is_null($opacity) && ($opacity < 0)) { - throw new \InvalidArgumentException('invalid value for $opacity when calling TemplatestemplateIdaddFieldsFields., must be bigger than or equal to 0.'); - } - - $this->container['opacity'] = $opacity; - - return $this; - } - - /** - * Gets minimum - * - * @return float|null - */ - public function getMinimum() - { - return $this->container['minimum']; - } - - /** - * Sets minimum - * - * @param float|null $minimum minimum - * - * @return $this - */ - public function setMinimum($minimum) - { - $this->container['minimum'] = $minimum; - - return $this; - } - - /** - * Gets signature_allow_type - * - * @return bool|null - */ - public function getSignatureAllowType() - { - return $this->container['signature_allow_type']; - } - - /** - * Sets signature_allow_type - * - * @param bool|null $signature_allow_type signature_allow_type - * - * @return $this - */ - public function setSignatureAllowType($signature_allow_type) - { - $this->container['signature_allow_type'] = $signature_allow_type; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset) - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed - */ - public function offsetGet($offset) - { - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - /** - * Sets value based on offset. - * - * @param integer $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value) - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset) - { - unset($this->container[$offset]); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } -} - - diff --git a/lib/Model/UpdateDataRequestResponse.php b/lib/Model/UpdateDataRequestResponse.php index 7c67962..d162a8f 100644 --- a/lib/Model/UpdateDataRequestResponse.php +++ b/lib/Model/UpdateDataRequestResponse.php @@ -2,7 +2,7 @@ /** * UpdateDataRequestResponse * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class UpdateDataRequestResponse implements ModelInterface, ArrayAccess +class UpdateDataRequestResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,22 +57,42 @@ class UpdateDataRequestResponse implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'data_request' => '\DocSpring\Model\SubmissionDataRequest', + 'status' => 'string', 'errors' => 'string[]', - 'status' => 'string' + 'data_request' => '\DocSpring\Model\SubmissionDataRequest' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'data_request' => null, + 'status' => null, 'errors' => null, - 'status' => null + 'data_request' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'errors' => false, + 'data_request' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -93,6 +113,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -100,9 +172,9 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'data_request' => 'data_request', + 'status' => 'status', 'errors' => 'errors', - 'status' => 'status' + 'data_request' => 'data_request' ]; /** @@ -111,9 +183,9 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'data_request' => 'setDataRequest', + 'status' => 'setStatus', 'errors' => 'setErrors', - 'status' => 'setStatus' + 'data_request' => 'setDataRequest' ]; /** @@ -122,9 +194,9 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'data_request' => 'getDataRequest', + 'status' => 'getStatus', 'errors' => 'getErrors', - 'status' => 'getStatus' + 'data_request' => 'getDataRequest' ]; /** @@ -168,11 +240,9 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_SUCCESS = 'success'; - const STATUS_ERROR = 'error'; - + public const STATUS_SUCCESS = 'success'; + public const STATUS_ERROR = 'error'; - /** * Gets allowable values of the enum * @@ -185,7 +255,6 @@ public function getStatusAllowableValues() self::STATUS_ERROR, ]; } - /** * Associative array for storing property values @@ -202,9 +271,27 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['data_request'] = isset($data['data_request']) ? $data['data_request'] : null; - $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('data_request', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -216,14 +303,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } + if ($this->container['data_request'] === null) { + $invalidProperties[] = "'data_request' can't be null"; + } return $invalidProperties; } @@ -240,25 +334,38 @@ public function valid() /** - * Gets data_request + * Gets status * - * @return \DocSpring\Model\SubmissionDataRequest|null + * @return string */ - public function getDataRequest() + public function getStatus() { - return $this->container['data_request']; + return $this->container['status']; } /** - * Sets data_request + * Sets status * - * @param \DocSpring\Model\SubmissionDataRequest|null $data_request data_request + * @param string $status status * - * @return $this + * @return self */ - public function setDataRequest($data_request) + public function setStatus($status) { - $this->container['data_request'] = $data_request; + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; return $this; } @@ -278,44 +385,41 @@ public function getErrors() * * @param string[]|null $errors errors * - * @return $this + * @return self */ public function setErrors($errors) { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } $this->container['errors'] = $errors; return $this; } /** - * Gets status + * Gets data_request * - * @return string|null + * @return \DocSpring\Model\SubmissionDataRequest */ - public function getStatus() + public function getDataRequest() { - return $this->container['status']; + return $this->container['data_request']; } /** - * Sets status + * Sets data_request * - * @param string|null $status status + * @param \DocSpring\Model\SubmissionDataRequest $data_request data_request * - * @return $this + * @return self */ - public function setStatus($status) + public function setDataRequest($data_request) { - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'status', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($data_request)) { + throw new \InvalidArgumentException('non-nullable data_request cannot be null'); } - $this->container['status'] = $status; + $this->container['data_request'] = $data_request; return $this; } @@ -326,7 +430,7 @@ public function setStatus($status) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -336,22 +440,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -367,11 +472,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -384,6 +502,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/UpdateSubmissionDataRequestData.php b/lib/Model/UpdateSubmissionDataRequestData.php index 0f536dd..713c4d3 100644 --- a/lib/Model/UpdateSubmissionDataRequestData.php +++ b/lib/Model/UpdateSubmissionDataRequestData.php @@ -2,7 +2,7 @@ /** * UpdateSubmissionDataRequestData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class UpdateSubmissionDataRequestData implements ModelInterface, ArrayAccess +class UpdateSubmissionDataRequestData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -76,6 +76,8 @@ class UpdateSubmissionDataRequestData implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'auth_phone_number_hash' => null, @@ -93,6 +95,34 @@ class UpdateSubmissionDataRequestData implements ModelInterface, ArrayAccess 'order' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'auth_phone_number_hash' => true, + 'auth_provider' => true, + 'auth_second_factor_type' => false, + 'auth_session_id_hash' => true, + 'auth_session_started_at' => true, + 'auth_type' => false, + 'auth_user_id_hash' => true, + 'auth_username_hash' => true, + 'email' => true, + 'fields' => false, + 'metadata' => false, + 'name' => true, + 'order' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -113,6 +143,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -218,22 +300,20 @@ public function getModelName() return self::$openAPIModelName; } - const AUTH_SECOND_FACTOR_TYPE_NONE = 'none'; - const AUTH_SECOND_FACTOR_TYPE_PHONE_NUMBER = 'phone_number'; - const AUTH_SECOND_FACTOR_TYPE_TOTP = 'totp'; - const AUTH_SECOND_FACTOR_TYPE_MOBILE_PUSH = 'mobile_push'; - const AUTH_SECOND_FACTOR_TYPE_SECURITY_KEY = 'security_key'; - const AUTH_SECOND_FACTOR_TYPE_FINGERPRINT = 'fingerprint'; - const AUTH_TYPE_NONE = 'none'; - const AUTH_TYPE_PASSWORD = 'password'; - const AUTH_TYPE_OAUTH = 'oauth'; - const AUTH_TYPE_EMAIL_LINK = 'email_link'; - const AUTH_TYPE_PHONE_NUMBER = 'phone_number'; - const AUTH_TYPE_LDAP = 'ldap'; - const AUTH_TYPE_SAML = 'saml'; - + public const AUTH_SECOND_FACTOR_TYPE_NONE = 'none'; + public const AUTH_SECOND_FACTOR_TYPE_PHONE_NUMBER = 'phone_number'; + public const AUTH_SECOND_FACTOR_TYPE_TOTP = 'totp'; + public const AUTH_SECOND_FACTOR_TYPE_MOBILE_PUSH = 'mobile_push'; + public const AUTH_SECOND_FACTOR_TYPE_SECURITY_KEY = 'security_key'; + public const AUTH_SECOND_FACTOR_TYPE_FINGERPRINT = 'fingerprint'; + public const AUTH_TYPE_NONE = 'none'; + public const AUTH_TYPE_PASSWORD = 'password'; + public const AUTH_TYPE_OAUTH = 'oauth'; + public const AUTH_TYPE_EMAIL_LINK = 'email_link'; + public const AUTH_TYPE_PHONE_NUMBER = 'phone_number'; + public const AUTH_TYPE_LDAP = 'ldap'; + public const AUTH_TYPE_SAML = 'saml'; - /** * Gets allowable values of the enum * @@ -250,7 +330,7 @@ public function getAuthSecondFactorTypeAllowableValues() self::AUTH_SECOND_FACTOR_TYPE_FINGERPRINT, ]; } - + /** * Gets allowable values of the enum * @@ -268,7 +348,6 @@ public function getAuthTypeAllowableValues() self::AUTH_TYPE_SAML, ]; } - /** * Associative array for storing property values @@ -285,19 +364,37 @@ public function getAuthTypeAllowableValues() */ public function __construct(array $data = null) { - $this->container['auth_phone_number_hash'] = isset($data['auth_phone_number_hash']) ? $data['auth_phone_number_hash'] : null; - $this->container['auth_provider'] = isset($data['auth_provider']) ? $data['auth_provider'] : null; - $this->container['auth_second_factor_type'] = isset($data['auth_second_factor_type']) ? $data['auth_second_factor_type'] : null; - $this->container['auth_session_id_hash'] = isset($data['auth_session_id_hash']) ? $data['auth_session_id_hash'] : null; - $this->container['auth_session_started_at'] = isset($data['auth_session_started_at']) ? $data['auth_session_started_at'] : null; - $this->container['auth_type'] = isset($data['auth_type']) ? $data['auth_type'] : null; - $this->container['auth_user_id_hash'] = isset($data['auth_user_id_hash']) ? $data['auth_user_id_hash'] : null; - $this->container['auth_username_hash'] = isset($data['auth_username_hash']) ? $data['auth_username_hash'] : null; - $this->container['email'] = isset($data['email']) ? $data['email'] : null; - $this->container['fields'] = isset($data['fields']) ? $data['fields'] : null; - $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['order'] = isset($data['order']) ? $data['order'] : null; + $this->setIfExists('auth_phone_number_hash', $data ?? [], null); + $this->setIfExists('auth_provider', $data ?? [], null); + $this->setIfExists('auth_second_factor_type', $data ?? [], null); + $this->setIfExists('auth_session_id_hash', $data ?? [], null); + $this->setIfExists('auth_session_started_at', $data ?? [], null); + $this->setIfExists('auth_type', $data ?? [], null); + $this->setIfExists('auth_user_id_hash', $data ?? [], null); + $this->setIfExists('auth_username_hash', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('fields', $data ?? [], null); + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('order', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -312,7 +409,8 @@ public function listInvalidProperties() $allowedValues = $this->getAuthSecondFactorTypeAllowableValues(); if (!is_null($this->container['auth_second_factor_type']) && !in_array($this->container['auth_second_factor_type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'auth_second_factor_type', must be one of '%s'", + "invalid value '%s' for 'auth_second_factor_type', must be one of '%s'", + $this->container['auth_second_factor_type'], implode("', '", $allowedValues) ); } @@ -320,7 +418,8 @@ public function listInvalidProperties() $allowedValues = $this->getAuthTypeAllowableValues(); if (!is_null($this->container['auth_type']) && !in_array($this->container['auth_type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'auth_type', must be one of '%s'", + "invalid value '%s' for 'auth_type', must be one of '%s'", + $this->container['auth_type'], implode("', '", $allowedValues) ); } @@ -355,10 +454,20 @@ public function getAuthPhoneNumberHash() * * @param string|null $auth_phone_number_hash auth_phone_number_hash * - * @return $this + * @return self */ public function setAuthPhoneNumberHash($auth_phone_number_hash) { + if (is_null($auth_phone_number_hash)) { + array_push($this->openAPINullablesSetToNull, 'auth_phone_number_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_phone_number_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['auth_phone_number_hash'] = $auth_phone_number_hash; return $this; @@ -379,10 +488,20 @@ public function getAuthProvider() * * @param string|null $auth_provider auth_provider * - * @return $this + * @return self */ public function setAuthProvider($auth_provider) { + if (is_null($auth_provider)) { + array_push($this->openAPINullablesSetToNull, 'auth_provider'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_provider', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['auth_provider'] = $auth_provider; return $this; @@ -403,15 +522,19 @@ public function getAuthSecondFactorType() * * @param string|null $auth_second_factor_type auth_second_factor_type * - * @return $this + * @return self */ public function setAuthSecondFactorType($auth_second_factor_type) { + if (is_null($auth_second_factor_type)) { + throw new \InvalidArgumentException('non-nullable auth_second_factor_type cannot be null'); + } $allowedValues = $this->getAuthSecondFactorTypeAllowableValues(); - if (!is_null($auth_second_factor_type) && !in_array($auth_second_factor_type, $allowedValues, true)) { + if (!in_array($auth_second_factor_type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'auth_second_factor_type', must be one of '%s'", + "Invalid value '%s' for 'auth_second_factor_type', must be one of '%s'", + $auth_second_factor_type, implode("', '", $allowedValues) ) ); @@ -436,10 +559,20 @@ public function getAuthSessionIdHash() * * @param string|null $auth_session_id_hash auth_session_id_hash * - * @return $this + * @return self */ public function setAuthSessionIdHash($auth_session_id_hash) { + if (is_null($auth_session_id_hash)) { + array_push($this->openAPINullablesSetToNull, 'auth_session_id_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_session_id_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['auth_session_id_hash'] = $auth_session_id_hash; return $this; @@ -460,10 +593,20 @@ public function getAuthSessionStartedAt() * * @param string|null $auth_session_started_at auth_session_started_at * - * @return $this + * @return self */ public function setAuthSessionStartedAt($auth_session_started_at) { + if (is_null($auth_session_started_at)) { + array_push($this->openAPINullablesSetToNull, 'auth_session_started_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_session_started_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['auth_session_started_at'] = $auth_session_started_at; return $this; @@ -484,15 +627,19 @@ public function getAuthType() * * @param string|null $auth_type auth_type * - * @return $this + * @return self */ public function setAuthType($auth_type) { + if (is_null($auth_type)) { + throw new \InvalidArgumentException('non-nullable auth_type cannot be null'); + } $allowedValues = $this->getAuthTypeAllowableValues(); - if (!is_null($auth_type) && !in_array($auth_type, $allowedValues, true)) { + if (!in_array($auth_type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'auth_type', must be one of '%s'", + "Invalid value '%s' for 'auth_type', must be one of '%s'", + $auth_type, implode("', '", $allowedValues) ) ); @@ -517,10 +664,20 @@ public function getAuthUserIdHash() * * @param string|null $auth_user_id_hash auth_user_id_hash * - * @return $this + * @return self */ public function setAuthUserIdHash($auth_user_id_hash) { + if (is_null($auth_user_id_hash)) { + array_push($this->openAPINullablesSetToNull, 'auth_user_id_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_user_id_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['auth_user_id_hash'] = $auth_user_id_hash; return $this; @@ -541,10 +698,20 @@ public function getAuthUsernameHash() * * @param string|null $auth_username_hash auth_username_hash * - * @return $this + * @return self */ public function setAuthUsernameHash($auth_username_hash) { + if (is_null($auth_username_hash)) { + array_push($this->openAPINullablesSetToNull, 'auth_username_hash'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('auth_username_hash', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['auth_username_hash'] = $auth_username_hash; return $this; @@ -565,10 +732,20 @@ public function getEmail() * * @param string|null $email email * - * @return $this + * @return self */ public function setEmail($email) { + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['email'] = $email; return $this; @@ -589,10 +766,13 @@ public function getFields() * * @param string[]|null $fields fields * - * @return $this + * @return self */ public function setFields($fields) { + if (is_null($fields)) { + throw new \InvalidArgumentException('non-nullable fields cannot be null'); + } $this->container['fields'] = $fields; return $this; @@ -613,10 +793,13 @@ public function getMetadata() * * @param object|null $metadata metadata * - * @return $this + * @return self */ public function setMetadata($metadata) { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } $this->container['metadata'] = $metadata; return $this; @@ -637,10 +820,20 @@ public function getName() * * @param string|null $name name * - * @return $this + * @return self */ public function setName($name) { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['name'] = $name; return $this; @@ -661,10 +854,13 @@ public function getOrder() * * @param int|null $order order * - * @return $this + * @return self */ public function setOrder($order) { + if (is_null($order)) { + throw new \InvalidArgumentException('non-nullable order cannot be null'); + } $this->container['order'] = $order; return $this; @@ -676,7 +872,7 @@ public function setOrder($order) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -686,22 +882,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -717,11 +914,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -734,6 +944,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/UpdateTemplateData.php b/lib/Model/UpdateTemplateData.php index 137681a..91e2fc5 100644 --- a/lib/Model/UpdateTemplateData.php +++ b/lib/Model/UpdateTemplateData.php @@ -2,7 +2,7 @@ /** * UpdateTemplateData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class UpdateTemplateData implements ModelInterface, ArrayAccess +class UpdateTemplateData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -64,11 +64,29 @@ class UpdateTemplateData implements ModelInterface, ArrayAccess * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ 'template' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'template' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -89,6 +107,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -158,9 +228,6 @@ public function getModelName() return self::$openAPIModelName; } - - - /** * Associative array for storing property values @@ -177,7 +244,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['template'] = isset($data['template']) ? $data['template'] : null; + $this->setIfExists('template', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -222,10 +307,13 @@ public function getTemplate() * * @param \DocSpring\Model\TemplateData $template template * - * @return $this + * @return self */ public function setTemplate($template) { + if (is_null($template)) { + throw new \InvalidArgumentException('non-nullable template cannot be null'); + } $this->container['template'] = $template; return $this; @@ -237,7 +325,7 @@ public function setTemplate($template) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -247,22 +335,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -278,11 +367,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -295,6 +397,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/UpdateTemplateResponse.php b/lib/Model/UpdateTemplateResponse.php index d9b9643..d77271f 100644 --- a/lib/Model/UpdateTemplateResponse.php +++ b/lib/Model/UpdateTemplateResponse.php @@ -2,7 +2,7 @@ /** * UpdateTemplateResponse * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class UpdateTemplateResponse implements ModelInterface, ArrayAccess +class UpdateTemplateResponse implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,20 +57,39 @@ class UpdateTemplateResponse implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'errors' => 'string[]', - 'status' => 'string' + 'status' => 'string', + 'errors' => 'string[]' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'errors' => null, - 'status' => null + 'status' => null, + 'errors' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false, + 'errors' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -91,6 +110,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -98,8 +169,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'errors' => 'errors', - 'status' => 'status' + 'status' => 'status', + 'errors' => 'errors' ]; /** @@ -108,8 +179,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'errors' => 'setErrors', - 'status' => 'setStatus' + 'status' => 'setStatus', + 'errors' => 'setErrors' ]; /** @@ -118,8 +189,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'errors' => 'getErrors', - 'status' => 'getStatus' + 'status' => 'getStatus', + 'errors' => 'getErrors' ]; /** @@ -163,11 +234,9 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_SUCCESS = 'success'; - const STATUS_ERROR = 'error'; - + public const STATUS_SUCCESS = 'success'; + public const STATUS_ERROR = 'error'; - /** * Gets allowable values of the enum * @@ -180,7 +249,6 @@ public function getStatusAllowableValues() self::STATUS_ERROR, ]; } - /** * Associative array for storing property values @@ -197,8 +265,26 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -210,10 +296,14 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'status', must be one of '%s'", + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], implode("', '", $allowedValues) ); } @@ -234,58 +324,65 @@ public function valid() /** - * Gets errors + * Gets status * - * @return string[]|null + * @return string */ - public function getErrors() + public function getStatus() { - return $this->container['errors']; + return $this->container['status']; } /** - * Sets errors + * Sets status * - * @param string[]|null $errors errors + * @param string $status status * - * @return $this + * @return self */ - public function setErrors($errors) + public function setStatus($status) { - $this->container['errors'] = $errors; + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; return $this; } /** - * Gets status + * Gets errors * - * @return string|null + * @return string[]|null */ - public function getStatus() + public function getErrors() { - return $this->container['status']; + return $this->container['errors']; } /** - * Sets status + * Sets errors * - * @param string|null $status status + * @param string[]|null $errors errors * - * @return $this + * @return self */ - public function setStatus($status) + public function setErrors($errors) { - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'status', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['status'] = $status; + $this->container['errors'] = $errors; return $this; } @@ -296,7 +393,7 @@ public function setStatus($status) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -306,22 +403,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -337,11 +435,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -354,6 +465,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/Model/UploadTemplateData.php b/lib/Model/UploadTemplateData.php index b8cdf4e..c6b2cbe 100644 --- a/lib/Model/UploadTemplateData.php +++ b/lib/Model/UploadTemplateData.php @@ -2,7 +2,7 @@ /** * UploadTemplateData * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -39,10 +38,11 @@ * @package DocSpring * @author OpenAPI Generator team * @link https://openapi-generator.tech + * @implements \ArrayAccess */ -class UploadTemplateData implements ModelInterface, ArrayAccess +class UploadTemplateData implements ModelInterface, ArrayAccess, \JsonSerializable { - const DISCRIMINATOR = null; + public const DISCRIMINATOR = null; /** * The original name of the model. @@ -57,52 +57,87 @@ class UploadTemplateData implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'expiration_interval' => 'string', - 'webhook_url' => 'string', - 'scss' => 'string', 'allow_additional_properties' => 'bool', - 'document' => '\DocSpring\Model\UploadTemplateDataDocument', - 'expire_after' => 'float', 'description' => 'string', - 'public_submissions' => 'bool', - 'slack_webhook_url' => 'string', - 'header_html' => 'string', - 'public_web_form' => 'bool', + 'document' => '\DocSpring\Model\TemplateDocument', 'editable_submissions' => 'bool', + 'expiration_interval' => 'string', + 'expire_after' => 'float', 'expire_submissions' => 'bool', - 'name' => 'string', 'footer_html' => 'string', + 'header_html' => 'string', 'html' => 'string', + 'name' => 'string', + 'public_submissions' => 'bool', + 'public_web_form' => 'bool', + 'redirect_url' => 'string', + 'scss' => 'string', + 'slack_webhook_url' => 'string', 'template_type' => 'string', - 'redirect_url' => 'string' + 'webhook_url' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] + * @phpstan-var array + * @psalm-var array */ protected static $openAPIFormats = [ - 'expiration_interval' => null, - 'webhook_url' => null, - 'scss' => null, 'allow_additional_properties' => null, - 'document' => null, - 'expire_after' => null, 'description' => null, - 'public_submissions' => null, - 'slack_webhook_url' => null, - 'header_html' => null, - 'public_web_form' => null, + 'document' => null, 'editable_submissions' => null, + 'expiration_interval' => null, + 'expire_after' => null, 'expire_submissions' => null, - 'name' => null, 'footer_html' => null, + 'header_html' => null, 'html' => null, + 'name' => null, + 'public_submissions' => null, + 'public_web_form' => null, + 'redirect_url' => null, + 'scss' => null, + 'slack_webhook_url' => null, 'template_type' => null, - 'redirect_url' => null + 'webhook_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'allow_additional_properties' => false, + 'description' => true, + 'document' => false, + 'editable_submissions' => false, + 'expiration_interval' => false, + 'expire_after' => false, + 'expire_submissions' => false, + 'footer_html' => true, + 'header_html' => true, + 'html' => true, + 'name' => true, + 'public_submissions' => false, + 'public_web_form' => false, + 'redirect_url' => true, + 'scss' => true, + 'slack_webhook_url' => true, + 'template_type' => false, + 'webhook_url' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -123,6 +158,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -130,24 +217,24 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'expiration_interval' => 'expiration_interval', - 'webhook_url' => 'webhook_url', - 'scss' => 'scss', 'allow_additional_properties' => 'allow_additional_properties', - 'document' => 'document', - 'expire_after' => 'expire_after', 'description' => 'description', - 'public_submissions' => 'public_submissions', - 'slack_webhook_url' => 'slack_webhook_url', - 'header_html' => 'header_html', - 'public_web_form' => 'public_web_form', + 'document' => 'document', 'editable_submissions' => 'editable_submissions', + 'expiration_interval' => 'expiration_interval', + 'expire_after' => 'expire_after', 'expire_submissions' => 'expire_submissions', - 'name' => 'name', 'footer_html' => 'footer_html', + 'header_html' => 'header_html', 'html' => 'html', + 'name' => 'name', + 'public_submissions' => 'public_submissions', + 'public_web_form' => 'public_web_form', + 'redirect_url' => 'redirect_url', + 'scss' => 'scss', + 'slack_webhook_url' => 'slack_webhook_url', 'template_type' => 'template_type', - 'redirect_url' => 'redirect_url' + 'webhook_url' => 'webhook_url' ]; /** @@ -156,24 +243,24 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'expiration_interval' => 'setExpirationInterval', - 'webhook_url' => 'setWebhookUrl', - 'scss' => 'setScss', 'allow_additional_properties' => 'setAllowAdditionalProperties', - 'document' => 'setDocument', - 'expire_after' => 'setExpireAfter', 'description' => 'setDescription', - 'public_submissions' => 'setPublicSubmissions', - 'slack_webhook_url' => 'setSlackWebhookUrl', - 'header_html' => 'setHeaderHtml', - 'public_web_form' => 'setPublicWebForm', + 'document' => 'setDocument', 'editable_submissions' => 'setEditableSubmissions', + 'expiration_interval' => 'setExpirationInterval', + 'expire_after' => 'setExpireAfter', 'expire_submissions' => 'setExpireSubmissions', - 'name' => 'setName', 'footer_html' => 'setFooterHtml', + 'header_html' => 'setHeaderHtml', 'html' => 'setHtml', + 'name' => 'setName', + 'public_submissions' => 'setPublicSubmissions', + 'public_web_form' => 'setPublicWebForm', + 'redirect_url' => 'setRedirectUrl', + 'scss' => 'setScss', + 'slack_webhook_url' => 'setSlackWebhookUrl', 'template_type' => 'setTemplateType', - 'redirect_url' => 'setRedirectUrl' + 'webhook_url' => 'setWebhookUrl' ]; /** @@ -182,24 +269,24 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'expiration_interval' => 'getExpirationInterval', - 'webhook_url' => 'getWebhookUrl', - 'scss' => 'getScss', 'allow_additional_properties' => 'getAllowAdditionalProperties', - 'document' => 'getDocument', - 'expire_after' => 'getExpireAfter', 'description' => 'getDescription', - 'public_submissions' => 'getPublicSubmissions', - 'slack_webhook_url' => 'getSlackWebhookUrl', - 'header_html' => 'getHeaderHtml', - 'public_web_form' => 'getPublicWebForm', + 'document' => 'getDocument', 'editable_submissions' => 'getEditableSubmissions', + 'expiration_interval' => 'getExpirationInterval', + 'expire_after' => 'getExpireAfter', 'expire_submissions' => 'getExpireSubmissions', - 'name' => 'getName', 'footer_html' => 'getFooterHtml', + 'header_html' => 'getHeaderHtml', 'html' => 'getHtml', + 'name' => 'getName', + 'public_submissions' => 'getPublicSubmissions', + 'public_web_form' => 'getPublicWebForm', + 'redirect_url' => 'getRedirectUrl', + 'scss' => 'getScss', + 'slack_webhook_url' => 'getSlackWebhookUrl', 'template_type' => 'getTemplateType', - 'redirect_url' => 'getRedirectUrl' + 'webhook_url' => 'getWebhookUrl' ]; /** @@ -243,14 +330,12 @@ public function getModelName() return self::$openAPIModelName; } - const EXPIRATION_INTERVAL_MINUTES = 'minutes'; - const EXPIRATION_INTERVAL_HOURS = 'hours'; - const EXPIRATION_INTERVAL_DAYS = 'days'; - const TEMPLATE_TYPE_PDF = 'pdf'; - const TEMPLATE_TYPE_HTML = 'html'; - + public const EXPIRATION_INTERVAL_MINUTES = 'minutes'; + public const EXPIRATION_INTERVAL_HOURS = 'hours'; + public const EXPIRATION_INTERVAL_DAYS = 'days'; + public const TEMPLATE_TYPE_PDF = 'pdf'; + public const TEMPLATE_TYPE_HTML = 'html'; - /** * Gets allowable values of the enum * @@ -264,7 +349,7 @@ public function getExpirationIntervalAllowableValues() self::EXPIRATION_INTERVAL_DAYS, ]; } - + /** * Gets allowable values of the enum * @@ -277,7 +362,6 @@ public function getTemplateTypeAllowableValues() self::TEMPLATE_TYPE_HTML, ]; } - /** * Associative array for storing property values @@ -294,24 +378,42 @@ public function getTemplateTypeAllowableValues() */ public function __construct(array $data = null) { - $this->container['expiration_interval'] = isset($data['expiration_interval']) ? $data['expiration_interval'] : null; - $this->container['webhook_url'] = isset($data['webhook_url']) ? $data['webhook_url'] : null; - $this->container['scss'] = isset($data['scss']) ? $data['scss'] : null; - $this->container['allow_additional_properties'] = isset($data['allow_additional_properties']) ? $data['allow_additional_properties'] : null; - $this->container['document'] = isset($data['document']) ? $data['document'] : null; - $this->container['expire_after'] = isset($data['expire_after']) ? $data['expire_after'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['public_submissions'] = isset($data['public_submissions']) ? $data['public_submissions'] : null; - $this->container['slack_webhook_url'] = isset($data['slack_webhook_url']) ? $data['slack_webhook_url'] : null; - $this->container['header_html'] = isset($data['header_html']) ? $data['header_html'] : null; - $this->container['public_web_form'] = isset($data['public_web_form']) ? $data['public_web_form'] : null; - $this->container['editable_submissions'] = isset($data['editable_submissions']) ? $data['editable_submissions'] : null; - $this->container['expire_submissions'] = isset($data['expire_submissions']) ? $data['expire_submissions'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['footer_html'] = isset($data['footer_html']) ? $data['footer_html'] : null; - $this->container['html'] = isset($data['html']) ? $data['html'] : null; - $this->container['template_type'] = isset($data['template_type']) ? $data['template_type'] : null; - $this->container['redirect_url'] = isset($data['redirect_url']) ? $data['redirect_url'] : null; + $this->setIfExists('allow_additional_properties', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('document', $data ?? [], null); + $this->setIfExists('editable_submissions', $data ?? [], null); + $this->setIfExists('expiration_interval', $data ?? [], null); + $this->setIfExists('expire_after', $data ?? [], null); + $this->setIfExists('expire_submissions', $data ?? [], null); + $this->setIfExists('footer_html', $data ?? [], null); + $this->setIfExists('header_html', $data ?? [], null); + $this->setIfExists('html', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('public_submissions', $data ?? [], null); + $this->setIfExists('public_web_form', $data ?? [], null); + $this->setIfExists('redirect_url', $data ?? [], null); + $this->setIfExists('scss', $data ?? [], null); + $this->setIfExists('slack_webhook_url', $data ?? [], null); + $this->setIfExists('template_type', $data ?? [], null); + $this->setIfExists('webhook_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -326,15 +428,20 @@ public function listInvalidProperties() $allowedValues = $this->getExpirationIntervalAllowableValues(); if (!is_null($this->container['expiration_interval']) && !in_array($this->container['expiration_interval'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'expiration_interval', must be one of '%s'", + "invalid value '%s' for 'expiration_interval', must be one of '%s'", + $this->container['expiration_interval'], implode("', '", $allowedValues) ); } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } $allowedValues = $this->getTemplateTypeAllowableValues(); if (!is_null($this->container['template_type']) && !in_array($this->container['template_type'], $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'template_type', must be one of '%s'", + "invalid value '%s' for 'template_type', must be one of '%s'", + $this->container['template_type'], implode("', '", $allowedValues) ); } @@ -355,130 +462,153 @@ public function valid() /** - * Gets expiration_interval + * Gets allow_additional_properties * - * @return string|null + * @return bool|null */ - public function getExpirationInterval() + public function getAllowAdditionalProperties() { - return $this->container['expiration_interval']; + return $this->container['allow_additional_properties']; } /** - * Sets expiration_interval + * Sets allow_additional_properties * - * @param string|null $expiration_interval expiration_interval + * @param bool|null $allow_additional_properties allow_additional_properties * - * @return $this + * @return self */ - public function setExpirationInterval($expiration_interval) + public function setAllowAdditionalProperties($allow_additional_properties) { - $allowedValues = $this->getExpirationIntervalAllowableValues(); - if (!is_null($expiration_interval) && !in_array($expiration_interval, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'expiration_interval', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); + if (is_null($allow_additional_properties)) { + throw new \InvalidArgumentException('non-nullable allow_additional_properties cannot be null'); } - $this->container['expiration_interval'] = $expiration_interval; + $this->container['allow_additional_properties'] = $allow_additional_properties; return $this; } /** - * Gets webhook_url + * Gets description * * @return string|null */ - public function getWebhookUrl() + public function getDescription() { - return $this->container['webhook_url']; + return $this->container['description']; } /** - * Sets webhook_url + * Sets description * - * @param string|null $webhook_url webhook_url + * @param string|null $description description * - * @return $this + * @return self */ - public function setWebhookUrl($webhook_url) + public function setDescription($description) { - $this->container['webhook_url'] = $webhook_url; + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; return $this; } /** - * Gets scss + * Gets document * - * @return string|null + * @return \DocSpring\Model\TemplateDocument|null */ - public function getScss() + public function getDocument() { - return $this->container['scss']; + return $this->container['document']; } /** - * Sets scss + * Sets document * - * @param string|null $scss scss + * @param \DocSpring\Model\TemplateDocument|null $document document * - * @return $this + * @return self */ - public function setScss($scss) + public function setDocument($document) { - $this->container['scss'] = $scss; + if (is_null($document)) { + throw new \InvalidArgumentException('non-nullable document cannot be null'); + } + $this->container['document'] = $document; return $this; } /** - * Gets allow_additional_properties + * Gets editable_submissions * * @return bool|null */ - public function getAllowAdditionalProperties() + public function getEditableSubmissions() { - return $this->container['allow_additional_properties']; + return $this->container['editable_submissions']; } /** - * Sets allow_additional_properties + * Sets editable_submissions * - * @param bool|null $allow_additional_properties allow_additional_properties + * @param bool|null $editable_submissions editable_submissions * - * @return $this + * @return self */ - public function setAllowAdditionalProperties($allow_additional_properties) + public function setEditableSubmissions($editable_submissions) { - $this->container['allow_additional_properties'] = $allow_additional_properties; + if (is_null($editable_submissions)) { + throw new \InvalidArgumentException('non-nullable editable_submissions cannot be null'); + } + $this->container['editable_submissions'] = $editable_submissions; return $this; } /** - * Gets document + * Gets expiration_interval * - * @return \DocSpring\Model\UploadTemplateDataDocument|null + * @return string|null */ - public function getDocument() + public function getExpirationInterval() { - return $this->container['document']; + return $this->container['expiration_interval']; } /** - * Sets document + * Sets expiration_interval * - * @param \DocSpring\Model\UploadTemplateDataDocument|null $document document + * @param string|null $expiration_interval expiration_interval * - * @return $this + * @return self */ - public function setDocument($document) + public function setExpirationInterval($expiration_interval) { - $this->container['document'] = $document; + if (is_null($expiration_interval)) { + throw new \InvalidArgumentException('non-nullable expiration_interval cannot be null'); + } + $allowedValues = $this->getExpirationIntervalAllowableValues(); + if (!in_array($expiration_interval, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'expiration_interval', must be one of '%s'", + $expiration_interval, + implode("', '", $allowedValues) + ) + ); + } + $this->container['expiration_interval'] = $expiration_interval; return $this; } @@ -498,251 +628,333 @@ public function getExpireAfter() * * @param float|null $expire_after expire_after * - * @return $this + * @return self */ public function setExpireAfter($expire_after) { + if (is_null($expire_after)) { + throw new \InvalidArgumentException('non-nullable expire_after cannot be null'); + } $this->container['expire_after'] = $expire_after; return $this; } /** - * Gets description + * Gets expire_submissions * - * @return string|null + * @return bool|null */ - public function getDescription() + public function getExpireSubmissions() { - return $this->container['description']; + return $this->container['expire_submissions']; } /** - * Sets description + * Sets expire_submissions * - * @param string|null $description description + * @param bool|null $expire_submissions expire_submissions * - * @return $this + * @return self */ - public function setDescription($description) + public function setExpireSubmissions($expire_submissions) { - $this->container['description'] = $description; + if (is_null($expire_submissions)) { + throw new \InvalidArgumentException('non-nullable expire_submissions cannot be null'); + } + $this->container['expire_submissions'] = $expire_submissions; return $this; } /** - * Gets public_submissions + * Gets footer_html * - * @return bool|null + * @return string|null */ - public function getPublicSubmissions() + public function getFooterHtml() { - return $this->container['public_submissions']; + return $this->container['footer_html']; } /** - * Sets public_submissions + * Sets footer_html * - * @param bool|null $public_submissions public_submissions + * @param string|null $footer_html footer_html * - * @return $this + * @return self */ - public function setPublicSubmissions($public_submissions) + public function setFooterHtml($footer_html) { - $this->container['public_submissions'] = $public_submissions; + if (is_null($footer_html)) { + array_push($this->openAPINullablesSetToNull, 'footer_html'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('footer_html', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['footer_html'] = $footer_html; return $this; } /** - * Gets slack_webhook_url + * Gets header_html * * @return string|null */ - public function getSlackWebhookUrl() + public function getHeaderHtml() { - return $this->container['slack_webhook_url']; + return $this->container['header_html']; } /** - * Sets slack_webhook_url + * Sets header_html * - * @param string|null $slack_webhook_url slack_webhook_url + * @param string|null $header_html header_html * - * @return $this + * @return self */ - public function setSlackWebhookUrl($slack_webhook_url) + public function setHeaderHtml($header_html) { - $this->container['slack_webhook_url'] = $slack_webhook_url; + if (is_null($header_html)) { + array_push($this->openAPINullablesSetToNull, 'header_html'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('header_html', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['header_html'] = $header_html; return $this; } /** - * Gets header_html + * Gets html * * @return string|null */ - public function getHeaderHtml() + public function getHtml() { - return $this->container['header_html']; + return $this->container['html']; } /** - * Sets header_html + * Sets html * - * @param string|null $header_html header_html + * @param string|null $html html * - * @return $this + * @return self */ - public function setHeaderHtml($header_html) + public function setHtml($html) { - $this->container['header_html'] = $header_html; + if (is_null($html)) { + array_push($this->openAPINullablesSetToNull, 'html'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('html', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['html'] = $html; return $this; } /** - * Gets public_web_form + * Gets name * - * @return bool|null + * @return string */ - public function getPublicWebForm() + public function getName() { - return $this->container['public_web_form']; + return $this->container['name']; } /** - * Sets public_web_form + * Sets name * - * @param bool|null $public_web_form public_web_form + * @param string $name name * - * @return $this + * @return self */ - public function setPublicWebForm($public_web_form) + public function setName($name) { - $this->container['public_web_form'] = $public_web_form; + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; return $this; } /** - * Gets editable_submissions + * Gets public_submissions * * @return bool|null */ - public function getEditableSubmissions() + public function getPublicSubmissions() { - return $this->container['editable_submissions']; + return $this->container['public_submissions']; } /** - * Sets editable_submissions + * Sets public_submissions * - * @param bool|null $editable_submissions editable_submissions + * @param bool|null $public_submissions public_submissions * - * @return $this + * @return self */ - public function setEditableSubmissions($editable_submissions) + public function setPublicSubmissions($public_submissions) { - $this->container['editable_submissions'] = $editable_submissions; + if (is_null($public_submissions)) { + throw new \InvalidArgumentException('non-nullable public_submissions cannot be null'); + } + $this->container['public_submissions'] = $public_submissions; return $this; } /** - * Gets expire_submissions + * Gets public_web_form * * @return bool|null */ - public function getExpireSubmissions() + public function getPublicWebForm() { - return $this->container['expire_submissions']; + return $this->container['public_web_form']; } /** - * Sets expire_submissions + * Sets public_web_form * - * @param bool|null $expire_submissions expire_submissions + * @param bool|null $public_web_form public_web_form * - * @return $this + * @return self */ - public function setExpireSubmissions($expire_submissions) + public function setPublicWebForm($public_web_form) { - $this->container['expire_submissions'] = $expire_submissions; + if (is_null($public_web_form)) { + throw new \InvalidArgumentException('non-nullable public_web_form cannot be null'); + } + $this->container['public_web_form'] = $public_web_form; return $this; } /** - * Gets name + * Gets redirect_url * * @return string|null */ - public function getName() + public function getRedirectUrl() { - return $this->container['name']; + return $this->container['redirect_url']; } /** - * Sets name + * Sets redirect_url * - * @param string|null $name name + * @param string|null $redirect_url redirect_url * - * @return $this + * @return self */ - public function setName($name) + public function setRedirectUrl($redirect_url) { - $this->container['name'] = $name; + if (is_null($redirect_url)) { + array_push($this->openAPINullablesSetToNull, 'redirect_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('redirect_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['redirect_url'] = $redirect_url; return $this; } /** - * Gets footer_html + * Gets scss * * @return string|null */ - public function getFooterHtml() + public function getScss() { - return $this->container['footer_html']; + return $this->container['scss']; } /** - * Sets footer_html + * Sets scss * - * @param string|null $footer_html footer_html + * @param string|null $scss scss * - * @return $this + * @return self */ - public function setFooterHtml($footer_html) + public function setScss($scss) { - $this->container['footer_html'] = $footer_html; + if (is_null($scss)) { + array_push($this->openAPINullablesSetToNull, 'scss'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('scss', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['scss'] = $scss; return $this; } /** - * Gets html + * Gets slack_webhook_url * * @return string|null */ - public function getHtml() + public function getSlackWebhookUrl() { - return $this->container['html']; + return $this->container['slack_webhook_url']; } /** - * Sets html + * Sets slack_webhook_url * - * @param string|null $html html + * @param string|null $slack_webhook_url slack_webhook_url * - * @return $this + * @return self */ - public function setHtml($html) + public function setSlackWebhookUrl($slack_webhook_url) { - $this->container['html'] = $html; + if (is_null($slack_webhook_url)) { + array_push($this->openAPINullablesSetToNull, 'slack_webhook_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('slack_webhook_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['slack_webhook_url'] = $slack_webhook_url; return $this; } @@ -762,15 +974,19 @@ public function getTemplateType() * * @param string|null $template_type template_type * - * @return $this + * @return self */ public function setTemplateType($template_type) { + if (is_null($template_type)) { + throw new \InvalidArgumentException('non-nullable template_type cannot be null'); + } $allowedValues = $this->getTemplateTypeAllowableValues(); - if (!is_null($template_type) && !in_array($template_type, $allowedValues, true)) { + if (!in_array($template_type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'template_type', must be one of '%s'", + "Invalid value '%s' for 'template_type', must be one of '%s'", + $template_type, implode("', '", $allowedValues) ) ); @@ -781,25 +997,35 @@ public function setTemplateType($template_type) } /** - * Gets redirect_url + * Gets webhook_url * * @return string|null */ - public function getRedirectUrl() + public function getWebhookUrl() { - return $this->container['redirect_url']; + return $this->container['webhook_url']; } /** - * Sets redirect_url + * Sets webhook_url * - * @param string|null $redirect_url redirect_url + * @param string|null $webhook_url webhook_url * - * @return $this + * @return self */ - public function setRedirectUrl($redirect_url) + public function setWebhookUrl($webhook_url) { - $this->container['redirect_url'] = $redirect_url; + if (is_null($webhook_url)) { + array_push($this->openAPINullablesSetToNull, 'webhook_url'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('webhook_url', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['webhook_url'] = $webhook_url; return $this; } @@ -810,7 +1036,7 @@ public function setRedirectUrl($redirect_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -820,22 +1046,23 @@ public function offsetExists($offset) * * @param integer $offset Offset * - * @return mixed + * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return $this->container[$offset] ?? null; } /** * Sets value based on offset. * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @param int|null $offset Offset + * @param mixed $value Value to be set * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -851,11 +1078,24 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + 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. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + /** * Gets the string presentation of the object * @@ -868,6 +1108,16 @@ public function __toString() JSON_PRETTY_PRINT ); } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } } diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index de69f8b..4e018df 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -29,6 +28,7 @@ namespace DocSpring; +use GuzzleHttp\Psr7\Utils; use DocSpring\Model\ModelInterface; /** @@ -41,6 +41,19 @@ */ 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 * @@ -48,34 +61,44 @@ class ObjectSerializer * @param string $type the OpenAPIToolsType of the data * @param string $format the format of the OpenAPITools type of the data * - * @return string|object serialized form of $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; - } elseif ($data instanceof \DateTime) { - return ($format === 'date') ? $data->format('Y-m-d') : $data->format(\DateTime::ATOM); - } elseif (is_array($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; - } elseif (is_object($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', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) - && method_exists($openAPIType, 'getAllowableEnumValues') - && !in_array($value, $openAPIType::getAllowableEnumValues(), true)) { - $imploded = implode("', '", $openAPIType::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', '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) { + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); } } @@ -107,6 +130,20 @@ public static function sanitizeFilename($filename) } } + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) return $timestamp; + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + /** * Take value and turn it into a string suitable for inclusion in * the path, by url-encoding. @@ -121,22 +158,141 @@ public static function toPathValue($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. + * Checks if a value is empty, based on its OpenAPI type. * - * @param string[]|string|\DateTime $object an object to be serialized to a string + * @param mixed $value + * @param string $openApiType * - * @return string the serialized object + * @return bool true if $value is empty */ - public static function toQueryValue($object) + private static function isEmptyValue($value, string $openApiType): bool { - if (is_array($object)) { - return implode(',', $object); - } else { - return self::toString($object); + # If empty() returns false, it is not empty regardless of its type. + if (!empty($value)) { + return false; + } + + # Null is always empty, as we cannot send a real "null" value in a query parameter. + if ($value === null) { + return true; + } + + switch ($openApiType) { + # For numeric values, false and '' are considered empty. + # This comparison is safe for floating point values, since the previous call to empty() will + # filter out values that don't match 0. + case 'int': + case 'integer': + return $value !== 0; + + case 'number': + case 'float': + return $value !== 0 && $value !== 0.0; + + # For boolean values, '' is considered empty + case 'bool': + case 'boolean': + return !in_array($value, [false, 0], true); + + # For all the other types, any value at this point can be considered empty. + default: + return true; + } + } + + /** + * Take query parameter properties and turn it into an array suitable for + * native http_build_query or GuzzleHttp\Psr7\Query::build. + * + * @param mixed $value Parameter value + * @param string $paramName Parameter name + * @param string $openApiType OpenAPIType eg. array or object + * @param string $style Parameter serialization style + * @param bool $explode Parameter explode option + * @param bool $required Whether query param is required or not + * + * @return array + */ + public static function toQueryValue( + $value, + string $paramName, + string $openApiType = 'string', + string $style = 'form', + bool $explode = true, + bool $required = true + ): array { + + # Check if we should omit this parameter from the query. This should only happen when: + # - Parameter is NOT required; AND + # - its value is set to a value that is equivalent to "empty", depending on its OpenAPI type. For + # example, 0 as "int" or "boolean" is NOT an empty value. + if (self::isEmptyValue($value, $openApiType)) { + if ($required) { + return ["{$paramName}" => '']; + } else { + return []; + } + } + + # Handle DateTime objects in query + if($openApiType === "\\DateTime" && $value instanceof \DateTime) { + return ["{$paramName}" => $value->format(self::$dateTimeFormat)]; + } + + $query = []; + $value = (in_array($openApiType, ['object', 'array'], true)) ? (array)$value : $value; + + // since \GuzzleHttp\Psr7\Query::build fails with nested arrays + // need to flatten array first + $flattenArray = function ($arr, $name, &$result = []) use (&$flattenArray, $style, $explode) { + if (!is_array($arr)) return $arr; + + foreach ($arr as $k => $v) { + $prop = ($style === 'deepObject') ? $prop = "{$name}[{$k}]" : $k; + + if (is_array($v)) { + $flattenArray($v, $prop, $result); + } else { + if ($style !== 'deepObject' && !$explode) { + // push key itself + $result[] = $prop; + } + $result[$prop] = $v; + } + } + return $result; + }; + + $value = $flattenArray($value, $paramName); + + if ($openApiType === 'object' && ($style === 'deepObject' || $explode)) { + return $value; + } + + if ('boolean' === $openApiType && is_bool($value)) { + $value = self::convertBoolToQueryStringFormat($value); + } + + // handle style in serializeCollection + $query[$paramName] = ($explode) ? $value : self::serializeCollection((array)$value, $style); + + return $query; + } + + /** + * Convert boolean value to format for query string. + * + * @param bool $value Boolean value + * + * @return int|string Boolean value in format + */ + public static function convertBoolToQueryStringFormat(bool $value) + { + if (Configuration::BOOLEAN_FORMAT_STRING == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) { + return $value ? 'true' : 'false'; } + + return (int) $value; } /** @@ -150,6 +306,11 @@ public static function toQueryValue($object) */ public static function toHeaderValue($value) { + $callable = [$value, 'toHeaderValue']; + if (is_callable($callable)) { + return $callable(); + } + return self::toString($value); } @@ -175,17 +336,20 @@ public static function toFormValue($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|\DateTime $value the value of the parameter + * @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(\DateTime::ATOM); + return $value->format(self::$dateTimeFormat); + } elseif (is_bool($value)) { + return $value ? 'true' : 'false'; } else { - return $value; + return (string) $value; } } @@ -193,29 +357,32 @@ public static function toString($value) * Serialize an array to a string. * * @param array $collection collection to serialize to a string - * @param string $collectionFormat the format use for serialization (csv, + * @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, $collectionFormat, $allowCollectionFormatMulti = false) + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) { - if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { + 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 ($collectionFormat) { + 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: @@ -237,7 +404,24 @@ public static function deserialize($data, $class, $httpHeaders = null) { if (null === $data) { return null; - } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] + } + + 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); @@ -250,38 +434,48 @@ public static function deserialize($data, $class, $httpHeaders = null) } } return $deserialized; - } elseif (strcasecmp(substr($class, -2), '[]') === 0) { - $data = is_string($data) ? json_decode($data) : $data; - $subClass = substr($class, 0, -2); - $values = []; - foreach ($data as $key => $value) { - $values[] = self::deserialize($value, $subClass, null); - } - return $values; - } elseif ($class === 'object') { + } + + if ($class === 'object') { settype($data, 'array'); return $data; - } elseif ($class === '\DateTime') { - // Some API's return an invalid, empty string as a + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a // date-time property. DateTime::__construct() will return // the current time for empty input which is probably not // what is meant. The invalid empty string is probably to // be interpreted as a missing field/value. Let's handle // this graceful. if (!empty($data)) { - return new \DateTime($data); + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } } else { return null; } - } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { - settype($data, $class); - return $data; - } elseif ($class === '\SplFileObject') { + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + /** @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)) { + if ( + is_array($httpHeaders) + && 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(), ''); @@ -294,7 +488,16 @@ public static function deserialize($data, $class, $httpHeaders = null) fclose($file); return new \SplFileObject($filename, 'r'); - } elseif (method_exists($class, 'getAllowableEnumValues')) { + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (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'"); @@ -302,6 +505,11 @@ public static function deserialize($data, $class, $httpHeaders = null) return $data; } else { $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$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})) { @@ -310,20 +518,50 @@ public static function deserialize($data, $class, $httpHeaders = null) $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]})) { + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + continue; } - $propertyValue = $data->{$instance::attributeMap()[$property]}; - if (isset($propertyValue)) { + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); } } return $instance; } } + + /** + * Native `http_build_query` wrapper. + * @see https://www.php.net/manual/en/function.http-build-query + * + * @param array|object $data May be an array or object containing properties. + * @param string $numeric_prefix If numeric indices are used in the base array and this parameter is provided, it will be prepended to the numeric index for elements in the base array only. + * @param string|null $arg_separator arg_separator.output is used to separate arguments but may be overridden by specifying this parameter. + * @param int $encoding_type Encoding type. By default, PHP_QUERY_RFC1738. + * + * @return string + */ + public static function buildQuery( + $data, + string $numeric_prefix = '', + ?string $arg_separator = null, + int $encoding_type = \PHP_QUERY_RFC3986 + ): string { + return \GuzzleHttp\Psr7\Query::build($data, $encoding_type); + } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 49fdde8..a9946a7 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -10,18 +10,18 @@ - + ./test ./test/Api ./test/Model - - + + ./lib ./lib/Api ./lib/Model - - + + diff --git a/test/Api/PDFApiIntegrationTest.php b/test/Api/PDFApiIntegrationTest.php index 29276ab..47e02e7 100644 --- a/test/Api/PDFApiIntegrationTest.php +++ b/test/Api/PDFApiIntegrationTest.php @@ -28,6 +28,7 @@ namespace DocSpring; +use \PHPUnit\Framework\TestCase; use \DocSpring\Configuration; use \DocSpring\ApiException; use \DocSpring\ObjectSerializer; @@ -40,26 +41,26 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class PDFApiTest extends \PHPUnit_Framework_TestCase +class PDFApiTest extends TestCase { - + private $docspring; /** * Setup before running any test cases */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { // Configure HTTP basic authorization: api_token_basic $config = \DocSpring\Configuration::getDefaultConfiguration() ->setUsername('api_token123') ->setPassword('testsecret123') - ->setHost('http://api.docspring.local:31337/api/v1'); + ->setHost('http://api.docspring.localhost:31337/api/v1'); $this->docspring = new \DocSpring\Api\PDFApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. @@ -71,14 +72,14 @@ public function setUp() /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -92,7 +93,7 @@ public function testGeneratePDF() { $docspring = $this->docspring; $template_id = 'tpl_000000000000000001'; // string | - $submission_data = new \DocSpring\Model\SubmissionData(); + $submission_data = new \DocSpring\Model\CreateSubmissionData(); $submission_data->setData([ "first_name" => 'John', "last_name" => 'Smith', diff --git a/test/Api/PDFApiTest.php.original b/test/Api/PDFApiTest.php.original index 2a97fd0..5b194dd 100644 --- a/test/Api/PDFApiTest.php.original +++ b/test/Api/PDFApiTest.php.original @@ -14,10 +14,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -89,11 +88,11 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Add new fields to a Template. * */ - public function testAddFieldsToTemplate() + public function test() { $template_id = tpl_000000000000000002; // string | - $add_fields_data = new \DocSpring\Model\AddFieldsData(); // \DocSpring\Model\AddFieldsData | - $result = $apiInstance->addFieldsToTemplate($template_id, $add_fields_data); + $data = new \DocSpring\Model\AddFieldsData(); // \DocSpring\Model\AddFieldsData | + $result = $apiInstance->addFieldsToTemplate($template_id$data); } /** @@ -102,11 +101,11 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Generates multiple PDFs. * */ - public function testBatchGeneratePdfV1() + public function test() { $template_id = tpl_000000000000000001; // string | - $request_body = array(new \DocSpring\Model\array()); // object[] | - $result = $apiInstance->batchGeneratePdfV1($template_id, $request_body); + $data = array(new \DocSpring\Model\SubmissionData()); // \DocSpring\Model\SubmissionData[] | + $result = $apiInstance->batchGeneratePdfV1($template_id$data); } /** @@ -115,10 +114,10 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Generates multiple PDFs. * */ - public function testBatchGeneratePdfs() + public function test() { - $submission_batch_data = new \DocSpring\Model\SubmissionBatchData(); // \DocSpring\Model\SubmissionBatchData | - $result = $apiInstance->batchGeneratePdfs($submission_batch_data); + $data = new \DocSpring\Model\SubmissionBatchData(); // \DocSpring\Model\SubmissionBatchData | + $result = $apiInstance->batchGeneratePdfs($data); } /** @@ -127,10 +126,10 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Merge submission PDFs, template PDFs, or custom files. * */ - public function testCombinePdfs() + public function test() { - $combine_pdfs_data = new \DocSpring\Model\CombinePdfsData(); // \DocSpring\Model\CombinePdfsData | - $result = $apiInstance->combinePdfs($combine_pdfs_data); + $data = new \DocSpring\Model\CombinePdfsData(); // \DocSpring\Model\CombinePdfsData | + $result = $apiInstance->combinePdfs($data); } /** @@ -139,10 +138,10 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Merge generated PDFs together. * */ - public function testCombineSubmissions() + public function test() { - $combined_submission_data = new \DocSpring\Model\CombinedSubmissionData(); // \DocSpring\Model\CombinedSubmissionData | - $result = $apiInstance->combineSubmissions($combined_submission_data); + $data = new \DocSpring\Model\CombinedSubmissionData(); // \DocSpring\Model\CombinedSubmissionData | + $result = $apiInstance->combineSubmissions($data); } /** @@ -151,11 +150,11 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Copy a Template. * */ - public function testCopyTemplate() + public function test() { $template_id = tpl_000000000000000001; // string | - $copy_template_data = new \DocSpring\Model\CopyTemplateData(); // \DocSpring\Model\CopyTemplateData | - $result = $apiInstance->copyTemplate($template_id, $copy_template_data); + $data = new \DocSpring\Model\CopyTemplateData(); // \DocSpring\Model\CopyTemplateData | + $result = $apiInstance->copyTemplate($template_id$data); } /** @@ -164,10 +163,10 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Create a new custom file from a cached presign upload. * */ - public function testCreateCustomFileFromUpload() + public function test() { - $create_custom_file_data = new \DocSpring\Model\CreateCustomFileData(); // \DocSpring\Model\CreateCustomFileData | - $result = $apiInstance->createCustomFileFromUpload($create_custom_file_data); + $data = new \DocSpring\Model\CreateCustomFileData(); // \DocSpring\Model\CreateCustomFileData | + $result = $apiInstance->createCustomFileFromUpload($data); } /** @@ -176,7 +175,7 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Creates a new data request token for form authentication. * */ - public function testCreateDataRequestToken() + public function test() { $data_request_id = drq_000000000000000001; // string | $result = $apiInstance->createDataRequestToken($data_request_id); @@ -188,10 +187,10 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Create a folder. * */ - public function testCreateFolder() + public function test() { - $create_folder_data = new \DocSpring\Model\CreateFolderData(); // \DocSpring\Model\CreateFolderData | - $result = $apiInstance->createFolder($create_folder_data); + $data = new \DocSpring\Model\CreateFolderData(); // \DocSpring\Model\CreateFolderData | + $result = $apiInstance->createFolder($data); } /** @@ -200,10 +199,10 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Create a new HTML template. * */ - public function testCreateHTMLTemplate() + public function test() { - $create_html_template_data = new \DocSpring\Model\CreateHtmlTemplateData(); // \DocSpring\Model\CreateHtmlTemplateData | - $result = $apiInstance->createHTMLTemplate($create_html_template_data); + $data = new \DocSpring\Model\CreateHtmlTemplateData(); // \DocSpring\Model\CreateHtmlTemplateData | + $result = $apiInstance->createHTMLTemplate($data); } /** @@ -212,12 +211,12 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Create a new PDF template with a form POST file upload. * */ - public function testCreatePDFTemplate() + public function test() { $template_document = "/path/to/file.txt"; // \SplFileObject | $template_name = 'template_name_example'; // string | $template_parent_folder_id = 'template_parent_folder_id_example'; // string | - $result = $apiInstance->createPDFTemplate($template_document, $template_name, $template_parent_folder_id); + $result = $apiInstance->createPDFTemplate($template_document$template_name$template_parent_folder_id); } /** @@ -226,10 +225,10 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Create a new PDF template from a cached presign upload. * */ - public function testCreatePDFTemplateFromUpload() + public function test() { - $create_template_from_upload_data = new \DocSpring\Model\CreateTemplateFromUploadData(); // \DocSpring\Model\CreateTemplateFromUploadData | - $result = $apiInstance->createPDFTemplateFromUpload($create_template_from_upload_data); + $data = new \DocSpring\Model\CreateTemplateFromUploadData(); // \DocSpring\Model\CreateTemplateFromUploadData | + $result = $apiInstance->createPDFTemplateFromUpload($data); } /** @@ -238,19 +237,31 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Delete a folder. * */ - public function testDeleteFolder() + public function test() { $folder_id = fld_000000000000000001; // string | $result = $apiInstance->deleteFolder($folder_id); } + /** + * Test case for deleteTemplate + * + * Delete a template. + * + */ + public function test() + { + $template_id = tpl_000000000000000001; // string | + $result = $apiInstance->deleteTemplate($template_id); + } + /** * Test case for expireCombinedSubmission * * Expire a combined submission. * */ - public function testExpireCombinedSubmission() + public function test() { $combined_submission_id = com_000000000000000001; // string | $result = $apiInstance->expireCombinedSubmission($combined_submission_id); @@ -262,7 +273,7 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Expire a PDF submission. * */ - public function testExpireSubmission() + public function test() { $submission_id = sub_000000000000000001; // string | $result = $apiInstance->expireSubmission($submission_id); @@ -274,11 +285,11 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Generates a new PDF. * */ - public function testGeneratePDF() + public function test() { $template_id = tpl_000000000000000001; // string | - $submission_data = new \DocSpring\Model\SubmissionData(); // \DocSpring\Model\SubmissionData | - $result = $apiInstance->generatePDF($template_id, $submission_data); + $submission = new \DocSpring\Model\CreateSubmissionData(); // \DocSpring\Model\CreateSubmissionData | + $result = $apiInstance->generatePDF($template_id$submission); } /** @@ -287,7 +298,7 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Check the status of a combined submission (merged PDFs). * */ - public function testGetCombinedSubmission() + public function test() { $combined_submission_id = com_000000000000000001; // string | $result = $apiInstance->getCombinedSubmission($combined_submission_id); @@ -299,7 +310,7 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Look up a submission data request. * */ - public function testGetDataRequest() + public function test() { $data_request_id = drq_000000000000000001; // string | $result = $apiInstance->getDataRequest($data_request_id); @@ -311,7 +322,7 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Fetch the full template attributes. * */ - public function testGetFullTemplate() + public function test() { $template_id = tpl_000000000000000001; // string | $result = $apiInstance->getFullTemplate($template_id); @@ -323,7 +334,7 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Get a presigned URL so that you can upload a file to our AWS S3 bucket. * */ - public function testGetPresignUrl() + public function test() { $result = $apiInstance->getPresignUrl(); } @@ -334,11 +345,11 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Check the status of a PDF. * */ - public function testGetSubmission() + public function test() { $submission_id = sub_000000000000000001; // string | $include_data = true; // bool | - $result = $apiInstance->getSubmission($submission_id, $include_data); + $result = $apiInstance->getSubmission($submission_id$include_data); } /** @@ -347,11 +358,11 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Check the status of a submission batch job. * */ - public function testGetSubmissionBatch() + public function test() { $submission_batch_id = sbb_000000000000000001; // string | $include_submissions = true; // bool | - $result = $apiInstance->getSubmissionBatch($submission_batch_id, $include_submissions); + $result = $apiInstance->getSubmissionBatch($submission_batch_id$include_submissions); } /** @@ -360,7 +371,7 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Check the status of an uploaded template. * */ - public function testGetTemplate() + public function test() { $template_id = tpl_000000000000000001; // string | $result = $apiInstance->getTemplate($template_id); @@ -372,19 +383,32 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Fetch the JSON schema for a template. * */ - public function testGetTemplateSchema() + public function test() { $template_id = tpl_000000000000000001; // string | $result = $apiInstance->getTemplateSchema($template_id); } + /** + * Test case for listCombinedSubmissions + * + * Get a list of all combined submissions. + * + */ + public function test() + { + $page = 2; // int | Default: 1 + $per_page = 1; // int | Default: 50 + $result = $apiInstance->listCombinedSubmissions($page$per_page); + } + /** * Test case for listFolders * * Get a list of all folders. * */ - public function testListFolders() + public function test() { $parent_folder_id = fld_000000000000000002; // string | Filter By Folder Id $result = $apiInstance->listFolders($parent_folder_id); @@ -396,24 +420,24 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * List all submissions. * */ - public function testListSubmissions() + public function test() { $cursor = sub_list_000012; // string | $limit = 3; // float | $created_after = 2019-01-01T09:00:00-05:00; // string | - $created_before = 2020-01-01T09:00:00-05:00; // string | + $created_before = 2020-01-01T09:00:00.000+0200; // string | $type = test; // string | $include_data = true; // bool | - $result = $apiInstance->listSubmissions($cursor, $limit, $created_after, $created_before, $type, $include_data); + $result = $apiInstance->listSubmissions($cursor$limit$created_after$created_before$type$include_data); } /** - * Test case for listSubmissions_0 + * Test case for listTemplateSubmissions * * List all submissions for a given template. * */ - public function testListSubmissions0() + public function test() { $template_id = tpl_000000000000000002; // string | $cursor = 'cursor_example'; // string | @@ -422,7 +446,7 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase $created_before = 'created_before_example'; // string | $type = 'type_example'; // string | $include_data = true; // bool | - $result = $apiInstance->listSubmissions_0($template_id, $cursor, $limit, $created_after, $created_before, $type, $include_data); + $result = $apiInstance->listTemplateSubmissions($template_id$cursor$limit$created_after$created_before$type$include_data); } /** @@ -431,13 +455,13 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Get a list of all templates. * */ - public function testListTemplates() + public function test() { $query = 2; // string | Search By Name $parent_folder_id = fld_000000000000000001; // string | Filter By Folder Id $page = 2; // int | Default: 1 $per_page = 1; // int | Default: 50 - $result = $apiInstance->listTemplates($query, $parent_folder_id, $page, $per_page); + $result = $apiInstance->listTemplates($query$parent_folder_id$page$per_page); } /** @@ -446,11 +470,11 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Move a folder. * */ - public function testMoveFolderToFolder() + public function test() { $folder_id = fld_000000000000000001; // string | - $move_folder_data = new \DocSpring\Model\MoveFolderData(); // \DocSpring\Model\MoveFolderData | - $result = $apiInstance->moveFolderToFolder($folder_id, $move_folder_data); + $data = new \DocSpring\Model\MoveFolderData(); // \DocSpring\Model\MoveFolderData | + $result = $apiInstance->moveFolderToFolder($folder_id$data); } /** @@ -459,11 +483,11 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Move Template to folder. * */ - public function testMoveTemplateToFolder() + public function test() { $template_id = tpl_000000000000000001; // string | - $move_template_data = new \DocSpring\Model\MoveTemplateData(); // \DocSpring\Model\MoveTemplateData | - $result = $apiInstance->moveTemplateToFolder($template_id, $move_template_data); + $data = new \DocSpring\Model\MoveTemplateData(); // \DocSpring\Model\MoveTemplateData | + $result = $apiInstance->moveTemplateToFolder($template_id$data); } /** @@ -472,11 +496,11 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Rename a folder. * */ - public function testRenameFolder() + public function test() { $folder_id = fld_000000000000000001; // string | - $rename_folder_data = new \DocSpring\Model\RenameFolderData(); // \DocSpring\Model\RenameFolderData | - $apiInstance->renameFolder($folder_id, $rename_folder_data); } + $data = new \DocSpring\Model\RenameFolderData(); // \DocSpring\Model\RenameFolderData | + $apiInstance->renameFolder($folder_id$data); } /** * Test case for testAuthentication @@ -484,7 +508,7 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Test Authentication. * */ - public function testTestAuthentication() + public function test() { $result = $apiInstance->testAuthentication(); } @@ -495,11 +519,11 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Update a submission data request. * */ - public function testUpdateDataRequest() + public function test() { $data_request_id = drq_000000000000000001; // string | - $update_submission_data_request_data = new \DocSpring\Model\UpdateSubmissionDataRequestData(); // \DocSpring\Model\UpdateSubmissionDataRequestData | - $result = $apiInstance->updateDataRequest($data_request_id, $update_submission_data_request_data); + $data = new \DocSpring\Model\UpdateSubmissionDataRequestData(); // \DocSpring\Model\UpdateSubmissionDataRequestData | + $result = $apiInstance->updateDataRequest($data_request_id$data); } /** @@ -508,10 +532,10 @@ class PDFApiTest extends \PHPUnit_Framework_TestCase * Update a Template. * */ - public function testUpdateTemplate() + public function test() { $template_id = tpl_000000000000000003; // string | - $update_template_data = new \DocSpring\Model\UpdateTemplateData(); // \DocSpring\Model\UpdateTemplateData | - $result = $apiInstance->updateTemplate($template_id, $update_template_data); + $data = new \DocSpring\Model\UpdateTemplateData(); // \DocSpring\Model\UpdateTemplateData | + $result = $apiInstance->updateTemplate($template_id$data); } } diff --git a/test/ClientIntegrationTest.php b/test/ClientIntegrationTest.php index 8d5524f..a3a6825 100644 --- a/test/ClientIntegrationTest.php +++ b/test/ClientIntegrationTest.php @@ -28,6 +28,7 @@ namespace DocSpring; +use \PHPUnit\Framework\TestCase; use \DocSpring\Configuration; use \DocSpring\ApiException; use \DocSpring\ObjectSerializer; @@ -40,19 +41,20 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class ClientTest extends \PHPUnit_Framework_TestCase +class ClientTest extends TestCase { + private $docspring; /** * Setup before running any test cases */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { $docspring = new \DocSpring\Client(); $docspring->getConfig() @@ -60,20 +62,20 @@ public function setUp() ->setPassword("testsecret123"); $this->docspring = $docspring; $this->docspring->getConfig() - ->setHost('http://api.docspring.local:31337/api/v1'); + ->setHost('http://api.docspring.localhost:31337/api/v1'); } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -87,7 +89,7 @@ public function testGeneratePDF() { $docspring = $this->docspring; $template_id = 'tpl_000000000000000001'; // string | - $submission_data = new \DocSpring\Model\SubmissionData(); + $submission_data = new \DocSpring\Model\CreateSubmissionData(); $submission_data->setData([ "first_name" => 'John', "last_name" => 'Smith', diff --git a/test/Model/AddFieldsDataTest.php b/test/Model/AddFieldsDataTest.php index fcca391..e7bf583 100644 --- a/test/Model/AddFieldsDataTest.php +++ b/test/Model/AddFieldsDataTest.php @@ -2,7 +2,7 @@ /** * AddFieldsDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * AddFieldsDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class AddFieldsDataTest extends \PHPUnit_Framework_TestCase +class AddFieldsDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testAddFieldsData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,5 +84,7 @@ public function testAddFieldsData() */ public function testPropertyFields() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/AddFieldsTemplateResponseTest.php b/test/Model/AddFieldsTemplateResponseTest.php index 7b807a7..fe81076 100644 --- a/test/Model/AddFieldsTemplateResponseTest.php +++ b/test/Model/AddFieldsTemplateResponseTest.php @@ -2,7 +2,7 @@ /** * AddFieldsTemplateResponseTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * AddFieldsTemplateResponseTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class AddFieldsTemplateResponseTest extends \PHPUnit_Framework_TestCase +class AddFieldsTemplateResponseTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,13 +75,17 @@ public static function tearDownAfterClass() */ public function testAddFieldsTemplateResponse() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "new_field_ids" + * Test attribute "status" */ - public function testPropertyNewFieldIds() + public function testPropertyStatus() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,12 +93,16 @@ public function testPropertyNewFieldIds() */ public function testPropertyErrors() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "status" + * Test attribute "new_field_ids" */ - public function testPropertyStatus() + public function testPropertyNewFieldIds() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/AuthenticationErrorTest.php b/test/Model/AuthenticationErrorTest.php index 8dd3d74..dfa6851 100644 --- a/test/Model/AuthenticationErrorTest.php +++ b/test/Model/AuthenticationErrorTest.php @@ -2,7 +2,7 @@ /** * AuthenticationErrorTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * AuthenticationErrorTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class AuthenticationErrorTest extends \PHPUnit_Framework_TestCase +class AuthenticationErrorTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testAuthenticationError() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,6 +84,8 @@ public function testAuthenticationError() */ public function testPropertyStatus() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,5 +93,7 @@ public function testPropertyStatus() */ public function testPropertyError() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/AuthenticationSuccessResponseTest.php b/test/Model/AuthenticationSuccessResponseTest.php index fc10ff9..aeccde2 100644 --- a/test/Model/AuthenticationSuccessResponseTest.php +++ b/test/Model/AuthenticationSuccessResponseTest.php @@ -2,7 +2,7 @@ /** * AuthenticationSuccessResponseTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * AuthenticationSuccessResponseTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class AuthenticationSuccessResponseTest extends \PHPUnit_Framework_TestCase +class AuthenticationSuccessResponseTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testAuthenticationSuccessResponse() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,5 +84,7 @@ public function testAuthenticationSuccessResponse() */ public function testPropertyStatus() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/CombinePdfsDataTest.php b/test/Model/CombinePdfsDataTest.php index 7b6ca92..01828be 100644 --- a/test/Model/CombinePdfsDataTest.php +++ b/test/Model/CombinePdfsDataTest.php @@ -2,7 +2,7 @@ /** * CombinePdfsDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * CombinePdfsDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CombinePdfsDataTest extends \PHPUnit_Framework_TestCase +class CombinePdfsDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testCombinePdfsData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,6 +84,8 @@ public function testCombinePdfsData() */ public function testPropertyDeleteCustomFiles() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,6 +93,8 @@ public function testPropertyDeleteCustomFiles() */ public function testPropertyExpiresIn() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -95,6 +102,8 @@ public function testPropertyExpiresIn() */ public function testPropertyMetadata() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -102,6 +111,8 @@ public function testPropertyMetadata() */ public function testPropertyPassword() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -109,6 +120,8 @@ public function testPropertyPassword() */ public function testPropertySourcePdfs() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -116,5 +129,7 @@ public function testPropertySourcePdfs() */ public function testPropertyTest() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/CombinedSubmissionActionTest.php b/test/Model/CombinedSubmissionActionTest.php index 0af9549..92e6802 100644 --- a/test/Model/CombinedSubmissionActionTest.php +++ b/test/Model/CombinedSubmissionActionTest.php @@ -2,7 +2,7 @@ /** * CombinedSubmissionActionTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * CombinedSubmissionActionTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CombinedSubmissionActionTest extends \PHPUnit_Framework_TestCase +class CombinedSubmissionActionTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testCombinedSubmissionAction() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,6 +84,8 @@ public function testCombinedSubmissionAction() */ public function testPropertyId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,6 +93,8 @@ public function testPropertyId() */ public function testPropertyIntegrationId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -95,6 +102,8 @@ public function testPropertyIntegrationId() */ public function testPropertyState() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -102,6 +111,8 @@ public function testPropertyState() */ public function testPropertyActionCategory() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -109,6 +120,8 @@ public function testPropertyActionCategory() */ public function testPropertyActionType() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -116,5 +129,7 @@ public function testPropertyActionType() */ public function testPropertyResultData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/CombinedSubmissionDataTest.php b/test/Model/CombinedSubmissionDataTest.php index a9e43b9..d086319 100644 --- a/test/Model/CombinedSubmissionDataTest.php +++ b/test/Model/CombinedSubmissionDataTest.php @@ -2,7 +2,7 @@ /** * CombinedSubmissionDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * CombinedSubmissionDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CombinedSubmissionDataTest extends \PHPUnit_Framework_TestCase +class CombinedSubmissionDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testCombinedSubmissionData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,6 +84,8 @@ public function testCombinedSubmissionData() */ public function testPropertyExpiresIn() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,6 +93,8 @@ public function testPropertyExpiresIn() */ public function testPropertyMetadata() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -95,6 +102,8 @@ public function testPropertyMetadata() */ public function testPropertyPassword() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -102,6 +111,8 @@ public function testPropertyPassword() */ public function testPropertySubmissionIds() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -109,5 +120,7 @@ public function testPropertySubmissionIds() */ public function testPropertyTest() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/CombinedSubmissionTest.php b/test/Model/CombinedSubmissionTest.php index b183011..3b063e7 100644 --- a/test/Model/CombinedSubmissionTest.php +++ b/test/Model/CombinedSubmissionTest.php @@ -2,7 +2,7 @@ /** * CombinedSubmissionTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * CombinedSubmissionTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CombinedSubmissionTest extends \PHPUnit_Framework_TestCase +class CombinedSubmissionTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,27 +75,35 @@ public static function tearDownAfterClass() */ public function testCombinedSubmission() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "metadata" + * Test attribute "id" */ - public function testPropertyMetadata() + public function testPropertyId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "password" + * Test attribute "expired" */ - public function testPropertyPassword() + public function testPropertyExpired() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "expired" + * Test attribute "expires_in" */ - public function testPropertyExpired() + public function testPropertyExpiresIn() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -102,27 +111,44 @@ public function testPropertyExpired() */ public function testPropertyExpiresAt() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "source_pdfs" + * Test attribute "state" */ - public function testPropertySourcePdfs() + public function testPropertyState() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "pdf_hash" + * Test attribute "error_message" */ - public function testPropertyPdfHash() + public function testPropertyErrorMessage() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "download_url" + * Test attribute "metadata" */ - public function testPropertyDownloadUrl() + public function testPropertyMetadata() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "password" + */ + public function testPropertyPassword() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -130,20 +156,35 @@ public function testPropertyDownloadUrl() */ public function testPropertySubmissionIds() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "id" + * Test attribute "source_pdfs" */ - public function testPropertyId() + public function testPropertySourcePdfs() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "state" + * Test attribute "download_url" */ - public function testPropertyState() + public function testPropertyDownloadUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "pdf_hash" + */ + public function testPropertyPdfHash() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -151,5 +192,7 @@ public function testPropertyState() */ public function testPropertyActions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/CopyTemplateDataTest.php b/test/Model/CopyTemplateDataTest.php index 7ecdc34..3122125 100644 --- a/test/Model/CopyTemplateDataTest.php +++ b/test/Model/CopyTemplateDataTest.php @@ -2,7 +2,7 @@ /** * CopyTemplateDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * CopyTemplateDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CopyTemplateDataTest extends \PHPUnit_Framework_TestCase +class CopyTemplateDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testCopyTemplateData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,6 +84,8 @@ public function testCopyTemplateData() */ public function testPropertyName() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,5 +93,7 @@ public function testPropertyName() */ public function testPropertyParentFolderId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/CreateCombinedSubmissionResponseTest.php b/test/Model/CreateCombinedSubmissionResponseTest.php index dbdf77b..969ad3b 100644 --- a/test/Model/CreateCombinedSubmissionResponseTest.php +++ b/test/Model/CreateCombinedSubmissionResponseTest.php @@ -2,7 +2,7 @@ /** * CreateCombinedSubmissionResponseTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * CreateCombinedSubmissionResponseTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CreateCombinedSubmissionResponseTest extends \PHPUnit_Framework_TestCase +class CreateCombinedSubmissionResponseTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,13 +75,17 @@ public static function tearDownAfterClass() */ public function testCreateCombinedSubmissionResponse() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "combined_submission" + * Test attribute "status" */ - public function testPropertyCombinedSubmission() + public function testPropertyStatus() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,12 +93,16 @@ public function testPropertyCombinedSubmission() */ public function testPropertyErrors() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "status" + * Test attribute "combined_submission" */ - public function testPropertyStatus() + public function testPropertyCombinedSubmission() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/CreateCustomFileDataTest.php b/test/Model/CreateCustomFileDataTest.php index 896c75b..534bd82 100644 --- a/test/Model/CreateCustomFileDataTest.php +++ b/test/Model/CreateCustomFileDataTest.php @@ -2,7 +2,7 @@ /** * CreateCustomFileDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * CreateCustomFileDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CreateCustomFileDataTest extends \PHPUnit_Framework_TestCase +class CreateCustomFileDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testCreateCustomFileData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,5 +84,7 @@ public function testCreateCustomFileData() */ public function testPropertyCacheId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/CreateCustomFileResponseTest.php b/test/Model/CreateCustomFileResponseTest.php index f5decf8..bc4c8ff 100644 --- a/test/Model/CreateCustomFileResponseTest.php +++ b/test/Model/CreateCustomFileResponseTest.php @@ -2,7 +2,7 @@ /** * CreateCustomFileResponseTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * CreateCustomFileResponseTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CreateCustomFileResponseTest extends \PHPUnit_Framework_TestCase +class CreateCustomFileResponseTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,13 +75,17 @@ public static function tearDownAfterClass() */ public function testCreateCustomFileResponse() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "custom_file" + * Test attribute "status" */ - public function testPropertyCustomFile() + public function testPropertyStatus() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,12 +93,16 @@ public function testPropertyCustomFile() */ public function testPropertyErrors() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "status" + * Test attribute "custom_file" */ - public function testPropertyStatus() + public function testPropertyCustomFile() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/FoldersFolderTest.php b/test/Model/CreateFolderAttributesTest.php similarity index 58% rename from test/Model/FoldersFolderTest.php rename to test/Model/CreateFolderAttributesTest.php index 3ce1c5b..95a1cd3 100644 --- a/test/Model/FoldersFolderTest.php +++ b/test/Model/CreateFolderAttributesTest.php @@ -1,8 +1,8 @@ markTestIncomplete('Not implemented'); } /** - * Test attribute "parent_folder_id" + * Test attribute "name" */ - public function testPropertyParentFolderId() + public function testPropertyName() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "name" + * Test attribute "parent_folder_id" */ - public function testPropertyName() + public function testPropertyParentFolderId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/CreateFolderDataTest.php b/test/Model/CreateFolderDataTest.php index 757611c..42c2a57 100644 --- a/test/Model/CreateFolderDataTest.php +++ b/test/Model/CreateFolderDataTest.php @@ -2,7 +2,7 @@ /** * CreateFolderDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * CreateFolderDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CreateFolderDataTest extends \PHPUnit_Framework_TestCase +class CreateFolderDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testCreateFolderData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,5 +84,7 @@ public function testCreateFolderData() */ public function testPropertyFolder() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/CreateHtmlTemplateDataTest.php b/test/Model/CreateHtmlTemplateDataTest.php index 142c082..daa35f2 100644 --- a/test/Model/CreateHtmlTemplateDataTest.php +++ b/test/Model/CreateHtmlTemplateDataTest.php @@ -2,7 +2,7 @@ /** * CreateHtmlTemplateDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * CreateHtmlTemplateDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CreateHtmlTemplateDataTest extends \PHPUnit_Framework_TestCase +class CreateHtmlTemplateDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testCreateHtmlTemplateData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,5 +84,7 @@ public function testCreateHtmlTemplateData() */ public function testPropertyTemplate() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/CreateSubmissionBatchResponseTest.php b/test/Model/CreateSubmissionBatchResponseTest.php index 38c13fc..faa9178 100644 --- a/test/Model/CreateSubmissionBatchResponseTest.php +++ b/test/Model/CreateSubmissionBatchResponseTest.php @@ -2,7 +2,7 @@ /** * CreateSubmissionBatchResponseTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * CreateSubmissionBatchResponseTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CreateSubmissionBatchResponseTest extends \PHPUnit_Framework_TestCase +class CreateSubmissionBatchResponseTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,40 +75,52 @@ public static function tearDownAfterClass() */ public function testCreateSubmissionBatchResponse() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "submission_batch" + * Test attribute "status" */ - public function testPropertySubmissionBatch() + public function testPropertyStatus() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "submissions" + * Test attribute "error" */ - public function testPropertySubmissions() + public function testPropertyError() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "error" + * Test attribute "errors" */ - public function testPropertyError() + public function testPropertyErrors() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "errors" + * Test attribute "submission_batch" */ - public function testPropertyErrors() + public function testPropertySubmissionBatch() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "status" + * Test attribute "submissions" */ - public function testPropertyStatus() + public function testPropertySubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/CreateSubmissionBatchSubmissionsResponseTest.php b/test/Model/CreateSubmissionBatchSubmissionsResponseTest.php index 12d9c39..bea8c5f 100644 --- a/test/Model/CreateSubmissionBatchSubmissionsResponseTest.php +++ b/test/Model/CreateSubmissionBatchSubmissionsResponseTest.php @@ -2,7 +2,7 @@ /** * CreateSubmissionBatchSubmissionsResponseTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * CreateSubmissionBatchSubmissionsResponseTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CreateSubmissionBatchSubmissionsResponseTest extends \PHPUnit_Framework_TestCase +class CreateSubmissionBatchSubmissionsResponseTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,13 +75,17 @@ public static function tearDownAfterClass() */ public function testCreateSubmissionBatchSubmissionsResponse() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "submission" + * Test attribute "status" */ - public function testPropertySubmission() + public function testPropertyStatus() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,12 +93,16 @@ public function testPropertySubmission() */ public function testPropertyErrors() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "status" + * Test attribute "submission" */ - public function testPropertyStatus() + public function testPropertySubmission() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/CreateSubmissionDataRequestDataTest.php b/test/Model/CreateSubmissionDataRequestDataTest.php index 68b75b2..5a1cbd3 100644 --- a/test/Model/CreateSubmissionDataRequestDataTest.php +++ b/test/Model/CreateSubmissionDataRequestDataTest.php @@ -2,7 +2,7 @@ /** * CreateSubmissionDataRequestDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * CreateSubmissionDataRequestDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CreateSubmissionDataRequestDataTest extends \PHPUnit_Framework_TestCase +class CreateSubmissionDataRequestDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,20 +75,26 @@ public static function tearDownAfterClass() */ public function testCreateSubmissionDataRequestData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "auth_type" + * Test attribute "auth_phone_number_hash" */ - public function testPropertyAuthType() + public function testPropertyAuthPhoneNumberHash() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "metadata" + * Test attribute "auth_provider" */ - public function testPropertyMetadata() + public function testPropertyAuthProvider() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -95,13 +102,17 @@ public function testPropertyMetadata() */ public function testPropertyAuthSecondFactorType() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "auth_phone_number_hash" + * Test attribute "auth_session_id_hash" */ - public function testPropertyAuthPhoneNumberHash() + public function testPropertyAuthSessionIdHash() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -109,20 +120,26 @@ public function testPropertyAuthPhoneNumberHash() */ public function testPropertyAuthSessionStartedAt() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "auth_user_id_hash" + * Test attribute "auth_type" */ - public function testPropertyAuthUserIdHash() + public function testPropertyAuthType() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "auth_session_id_hash" + * Test attribute "auth_user_id_hash" */ - public function testPropertyAuthSessionIdHash() + public function testPropertyAuthUserIdHash() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -130,13 +147,17 @@ public function testPropertyAuthSessionIdHash() */ public function testPropertyAuthUsernameHash() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "name" + * Test attribute "email" */ - public function testPropertyName() + public function testPropertyEmail() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -144,20 +165,26 @@ public function testPropertyName() */ public function testPropertyFields() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "auth_provider" + * Test attribute "metadata" */ - public function testPropertyAuthProvider() + public function testPropertyMetadata() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "email" + * Test attribute "name" */ - public function testPropertyEmail() + public function testPropertyName() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -165,5 +192,7 @@ public function testPropertyEmail() */ public function testPropertyOrder() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/CreateSubmissionDataRequestTokenResponseTest.php b/test/Model/CreateSubmissionDataRequestTokenResponseTest.php index 3beb95e..13ce1d9 100644 --- a/test/Model/CreateSubmissionDataRequestTokenResponseTest.php +++ b/test/Model/CreateSubmissionDataRequestTokenResponseTest.php @@ -2,7 +2,7 @@ /** * CreateSubmissionDataRequestTokenResponseTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * CreateSubmissionDataRequestTokenResponseTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CreateSubmissionDataRequestTokenResponseTest extends \PHPUnit_Framework_TestCase +class CreateSubmissionDataRequestTokenResponseTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,20 +75,26 @@ public static function tearDownAfterClass() */ public function testCreateSubmissionDataRequestTokenResponse() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "errors" + * Test attribute "status" */ - public function testPropertyErrors() + public function testPropertyStatus() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "status" + * Test attribute "errors" */ - public function testPropertyStatus() + public function testPropertyErrors() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -95,5 +102,7 @@ public function testPropertyStatus() */ public function testPropertyToken() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/CreateSubmissionDataTest.php b/test/Model/CreateSubmissionDataTest.php new file mode 100644 index 0000000..ab68f5f --- /dev/null +++ b/test/Model/CreateSubmissionDataTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "css" + */ + public function testPropertyCss() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data_requests" + */ + public function testPropertyDataRequests() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "expires_in" + */ + public function testPropertyExpiresIn() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "field_overrides" + */ + public function testPropertyFieldOverrides() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "html" + */ + public function testPropertyHtml() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "metadata" + */ + public function testPropertyMetadata() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "password" + */ + public function testPropertyPassword() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "test" + */ + public function testPropertyTest() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateSubmissionResponseTest.php b/test/Model/CreateSubmissionResponseTest.php index b6d76af..ebe3f07 100644 --- a/test/Model/CreateSubmissionResponseTest.php +++ b/test/Model/CreateSubmissionResponseTest.php @@ -2,7 +2,7 @@ /** * CreateSubmissionResponseTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * CreateSubmissionResponseTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CreateSubmissionResponseTest extends \PHPUnit_Framework_TestCase +class CreateSubmissionResponseTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,13 +75,17 @@ public static function tearDownAfterClass() */ public function testCreateSubmissionResponse() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "submission" + * Test attribute "status" */ - public function testPropertySubmission() + public function testPropertyStatus() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,12 +93,16 @@ public function testPropertySubmission() */ public function testPropertyErrors() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "status" + * Test attribute "submission" */ - public function testPropertyStatus() + public function testPropertySubmission() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/CreateTemplateFromUploadDataTest.php b/test/Model/CreateTemplateFromUploadDataTest.php index c5c6f38..1df2807 100644 --- a/test/Model/CreateTemplateFromUploadDataTest.php +++ b/test/Model/CreateTemplateFromUploadDataTest.php @@ -2,7 +2,7 @@ /** * CreateTemplateFromUploadDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * CreateTemplateFromUploadDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class CreateTemplateFromUploadDataTest extends \PHPUnit_Framework_TestCase +class CreateTemplateFromUploadDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testCreateTemplateFromUploadData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,5 +84,7 @@ public function testCreateTemplateFromUploadData() */ public function testPropertyTemplate() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/CustomFileTest.php b/test/Model/CustomFileTest.php deleted file mode 100644 index 95c581e..0000000 --- a/test/Model/CustomFileTest.php +++ /dev/null @@ -1,92 +0,0 @@ -markTestIncomplete('Not implemented'); } /** - * Test attribute "expires_at" + * Test attribute "id" */ - public function testPropertyExpiresAt() + public function testPropertyId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "id" + * Test attribute "secret" */ - public function testPropertyId() + public function testPropertySecret() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "secret" + * Test attribute "expires_at" */ - public function testPropertySecret() + public function testPropertyExpiresAt() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -102,5 +111,7 @@ public function testPropertySecret() */ public function testPropertyDataRequestUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/DeleteTemplateResponseTest.php b/test/Model/DeleteTemplateResponseTest.php new file mode 100644 index 0000000..b9d757e --- /dev/null +++ b/test/Model/DeleteTemplateResponseTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "errors" + */ + public function testPropertyErrors() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ErrorTest.php b/test/Model/ErrorResponseTest.php similarity index 59% rename from test/Model/ErrorTest.php rename to test/Model/ErrorResponseTest.php index acc6d73..778c929 100644 --- a/test/Model/ErrorTest.php +++ b/test/Model/ErrorResponseTest.php @@ -1,8 +1,8 @@ markTestIncomplete('Not implemented'); } /** @@ -81,6 +84,8 @@ public function testError() */ public function testPropertyStatus() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,5 +93,7 @@ public function testPropertyStatus() */ public function testPropertyError() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/FolderTest.php b/test/Model/FolderTest.php index 63dfb82..0254bb0 100644 --- a/test/Model/FolderTest.php +++ b/test/Model/FolderTest.php @@ -2,7 +2,7 @@ /** * FolderTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * FolderTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class FolderTest extends \PHPUnit_Framework_TestCase +class FolderTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,33 +75,43 @@ public static function tearDownAfterClass() */ public function testFolder() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "path" + * Test attribute "id" */ - public function testPropertyPath() + public function testPropertyId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "parent_folder_id" + * Test attribute "name" */ - public function testPropertyParentFolderId() + public function testPropertyName() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "name" + * Test attribute "path" */ - public function testPropertyName() + public function testPropertyPath() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "id" + * Test attribute "parent_folder_id" */ - public function testPropertyId() + public function testPropertyParentFolderId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/FullTemplateTest.php b/test/Model/FullTemplateTest.php index cc74eaf..d3018b5 100644 --- a/test/Model/FullTemplateTest.php +++ b/test/Model/FullTemplateTest.php @@ -2,7 +2,7 @@ /** * FullTemplateTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * FullTemplateTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class FullTemplateTest extends \PHPUnit_Framework_TestCase +class FullTemplateTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,278 +75,358 @@ public static function tearDownAfterClass() */ public function testFullTemplate() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "document_processed" + * Test attribute "name" */ - public function testPropertyDocumentProcessed() + public function testPropertyName() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "expiration_interval" + * Test attribute "description" */ - public function testPropertyExpirationInterval() + public function testPropertyDescription() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "scss" + * Test attribute "public_web_form" */ - public function testPropertyScss() + public function testPropertyPublicWebForm() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "document_state" + * Test attribute "public_submissions" */ - public function testPropertyDocumentState() + public function testPropertyPublicSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "expire_after" + * Test attribute "expire_submissions" */ - public function testPropertyExpireAfter() + public function testPropertyExpireSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "description" + * Test attribute "expire_after" */ - public function testPropertyDescription() + public function testPropertyExpireAfter() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "slack_webhook_url" + * Test attribute "expiration_interval" */ - public function testPropertySlackWebhookUrl() + public function testPropertyExpirationInterval() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "demo" + * Test attribute "allow_additional_properties" */ - public function testPropertyDemo() + public function testPropertyAllowAdditionalProperties() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "path" + * Test attribute "editable_submissions" */ - public function testPropertyPath() + public function testPropertyEditableSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "header_html" + * Test attribute "locked" */ - public function testPropertyHeaderHtml() + public function testPropertyLocked() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "public_web_form" + * Test attribute "webhook_url" */ - public function testPropertyPublicWebForm() + public function testPropertyWebhookUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "field_order" + * Test attribute "slack_webhook_url" */ - public function testPropertyFieldOrder() + public function testPropertySlackWebhookUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "permanent_document_url" + * Test attribute "redirect_url" */ - public function testPropertyPermanentDocumentUrl() + public function testPropertyRedirectUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "html" + * Test attribute "first_template" */ - public function testPropertyHtml() + public function testPropertyFirstTemplate() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "template_type" + * Test attribute "html" */ - public function testPropertyTemplateType() + public function testPropertyHtml() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "id" + * Test attribute "header_html" */ - public function testPropertyId() + public function testPropertyHeaderHtml() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "page_dimensions" + * Test attribute "footer_html" */ - public function testPropertyPageDimensions() + public function testPropertyFooterHtml() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "locked" + * Test attribute "scss" */ - public function testPropertyLocked() + public function testPropertyScss() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "page_count" + * Test attribute "encrypt_pdfs" */ - public function testPropertyPageCount() + public function testPropertyEncryptPdfs() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "encrypt_pdfs" + * Test attribute "encrypt_pdfs_password" */ - public function testPropertyEncryptPdfs() + public function testPropertyEncryptPdfsPassword() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "webhook_url" + * Test attribute "defaults" */ - public function testPropertyWebhookUrl() + public function testPropertyDefaults() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "embed_domains" + * Test attribute "fields" */ - public function testPropertyEmbedDomains() + public function testPropertyFields() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "parent_folder_id" + * Test attribute "shared_field_data" */ - public function testPropertyParentFolderId() + public function testPropertySharedFieldData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "allow_additional_properties" + * Test attribute "field_order" */ - public function testPropertyAllowAdditionalProperties() + public function testPropertyFieldOrder() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "encrypt_pdfs_password" + * Test attribute "document_md5" */ - public function testPropertyEncryptPdfsPassword() + public function testPropertyDocumentMd5() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "public_submissions" + * Test attribute "document_filename" */ - public function testPropertyPublicSubmissions() + public function testPropertyDocumentFilename() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "shared_field_data" + * Test attribute "document_parse_error" */ - public function testPropertySharedFieldData() + public function testPropertyDocumentParseError() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "document_md5" + * Test attribute "document_state" */ - public function testPropertyDocumentMd5() + public function testPropertyDocumentState() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "first_template" + * Test attribute "embed_domains" */ - public function testPropertyFirstTemplate() + public function testPropertyEmbedDomains() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "defaults" + * Test attribute "page_count" */ - public function testPropertyDefaults() + public function testPropertyPageCount() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "editable_submissions" + * Test attribute "document_processed" */ - public function testPropertyEditableSubmissions() + public function testPropertyDocumentProcessed() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "expire_submissions" + * Test attribute "demo" */ - public function testPropertyExpireSubmissions() + public function testPropertyDemo() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "name" + * Test attribute "id" */ - public function testPropertyName() + public function testPropertyId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "footer_html" + * Test attribute "template_type" */ - public function testPropertyFooterHtml() + public function testPropertyTemplateType() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "document_parse_error" + * Test attribute "page_dimensions" */ - public function testPropertyDocumentParseError() + public function testPropertyPageDimensions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "fields" + * Test attribute "document_url" */ - public function testPropertyFields() + public function testPropertyDocumentUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "document_filename" + * Test attribute "permanent_document_url" */ - public function testPropertyDocumentFilename() + public function testPropertyPermanentDocumentUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "redirect_url" + * Test attribute "path" */ - public function testPropertyRedirectUrl() + public function testPropertyPath() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "document_url" + * Test attribute "parent_folder_id" */ - public function testPropertyDocumentUrl() + public function testPropertyParentFolderId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/HtmlTemplateDataTest.php b/test/Model/HtmlTemplateDataTest.php index c66a4a7..10cc376 100644 --- a/test/Model/HtmlTemplateDataTest.php +++ b/test/Model/HtmlTemplateDataTest.php @@ -2,7 +2,7 @@ /** * HtmlTemplateDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * HtmlTemplateDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class HtmlTemplateDataTest extends \PHPUnit_Framework_TestCase +class HtmlTemplateDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,34 +75,44 @@ public static function tearDownAfterClass() */ public function testHtmlTemplateData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "expiration_interval" + * Test attribute "allow_additional_properties" */ - public function testPropertyExpirationInterval() + public function testPropertyAllowAdditionalProperties() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "webhook_url" + * Test attribute "description" */ - public function testPropertyWebhookUrl() + public function testPropertyDescription() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "scss" + * Test attribute "editable_submissions" */ - public function testPropertyScss() + public function testPropertyEditableSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "allow_additional_properties" + * Test attribute "expiration_interval" */ - public function testPropertyAllowAdditionalProperties() + public function testPropertyExpirationInterval() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -109,76 +120,98 @@ public function testPropertyAllowAdditionalProperties() */ public function testPropertyExpireAfter() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "description" + * Test attribute "expire_submissions" */ - public function testPropertyDescription() + public function testPropertyExpireSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "public_submissions" + * Test attribute "footer_html" */ - public function testPropertyPublicSubmissions() + public function testPropertyFooterHtml() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "slack_webhook_url" + * Test attribute "header_html" */ - public function testPropertySlackWebhookUrl() + public function testPropertyHeaderHtml() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "header_html" + * Test attribute "html" */ - public function testPropertyHeaderHtml() + public function testPropertyHtml() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "public_web_form" + * Test attribute "name" */ - public function testPropertyPublicWebForm() + public function testPropertyName() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "editable_submissions" + * Test attribute "public_submissions" */ - public function testPropertyEditableSubmissions() + public function testPropertyPublicSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "expire_submissions" + * Test attribute "public_web_form" */ - public function testPropertyExpireSubmissions() + public function testPropertyPublicWebForm() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "name" + * Test attribute "redirect_url" */ - public function testPropertyName() + public function testPropertyRedirectUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "footer_html" + * Test attribute "scss" */ - public function testPropertyFooterHtml() + public function testPropertyScss() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "html" + * Test attribute "slack_webhook_url" */ - public function testPropertyHtml() + public function testPropertySlackWebhookUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -186,12 +219,16 @@ public function testPropertyHtml() */ public function testPropertyTemplateType() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "redirect_url" + * Test attribute "webhook_url" */ - public function testPropertyRedirectUrl() + public function testPropertyWebhookUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/InvalidRequestTest.php b/test/Model/InvalidRequestTest.php index eb99723..8af6140 100644 --- a/test/Model/InvalidRequestTest.php +++ b/test/Model/InvalidRequestTest.php @@ -2,7 +2,7 @@ /** * InvalidRequestTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * InvalidRequestTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class InvalidRequestTest extends \PHPUnit_Framework_TestCase +class InvalidRequestTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testInvalidRequest() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,6 +84,8 @@ public function testInvalidRequest() */ public function testPropertyStatus() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,5 +93,7 @@ public function testPropertyStatus() */ public function testPropertyErrors() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/ListSubmissionsResponseTest.php b/test/Model/ListSubmissionsResponseTest.php index 88f4b18..2251b99 100644 --- a/test/Model/ListSubmissionsResponseTest.php +++ b/test/Model/ListSubmissionsResponseTest.php @@ -2,7 +2,7 @@ /** * ListSubmissionsResponseTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * ListSubmissionsResponseTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class ListSubmissionsResponseTest extends \PHPUnit_Framework_TestCase +class ListSubmissionsResponseTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,26 +75,34 @@ public static function tearDownAfterClass() */ public function testListSubmissionsResponse() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "next_cursor" + * Test attribute "submissions" */ - public function testPropertyNextCursor() + public function testPropertySubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "submissions" + * Test attribute "limit" */ - public function testPropertySubmissions() + public function testPropertyLimit() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "limit" + * Test attribute "next_cursor" */ - public function testPropertyLimit() + public function testPropertyNextCursor() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/MoveFolderDataTest.php b/test/Model/MoveFolderDataTest.php index 86c5369..dee031c 100644 --- a/test/Model/MoveFolderDataTest.php +++ b/test/Model/MoveFolderDataTest.php @@ -2,7 +2,7 @@ /** * MoveFolderDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * MoveFolderDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class MoveFolderDataTest extends \PHPUnit_Framework_TestCase +class MoveFolderDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testMoveFolderData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,5 +84,7 @@ public function testMoveFolderData() */ public function testPropertyParentFolderId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/MoveTemplateDataTest.php b/test/Model/MoveTemplateDataTest.php index 588c2b6..9846fe5 100644 --- a/test/Model/MoveTemplateDataTest.php +++ b/test/Model/MoveTemplateDataTest.php @@ -2,7 +2,7 @@ /** * MoveTemplateDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * MoveTemplateDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class MoveTemplateDataTest extends \PHPUnit_Framework_TestCase +class MoveTemplateDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testMoveTemplateData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,5 +84,7 @@ public function testMoveTemplateData() */ public function testPropertyParentFolderId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/PendingTemplateTest.php b/test/Model/PendingTemplateTest.php index 03297ff..ea7b6f8 100644 --- a/test/Model/PendingTemplateTest.php +++ b/test/Model/PendingTemplateTest.php @@ -2,7 +2,7 @@ /** * PendingTemplateTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * PendingTemplateTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class PendingTemplateTest extends \PHPUnit_Framework_TestCase +class PendingTemplateTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,124 +75,160 @@ public static function tearDownAfterClass() */ public function testPendingTemplate() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "expiration_interval" + * Test attribute "id" */ - public function testPropertyExpirationInterval() + public function testPropertyId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "webhook_url" + * Test attribute "name" */ - public function testPropertyWebhookUrl() + public function testPropertyName() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "parent_folder_id" + * Test attribute "description" */ - public function testPropertyParentFolderId() + public function testPropertyDescription() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "expire_after" + * Test attribute "template_type" */ - public function testPropertyExpireAfter() + public function testPropertyTemplateType() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "allow_additional_properties" + * Test attribute "public_web_form" */ - public function testPropertyAllowAdditionalProperties() + public function testPropertyPublicWebForm() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "description" + * Test attribute "public_submissions" */ - public function testPropertyDescription() + public function testPropertyPublicSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "public_submissions" + * Test attribute "expire_submissions" */ - public function testPropertyPublicSubmissions() + public function testPropertyExpireSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "slack_webhook_url" + * Test attribute "expire_after" */ - public function testPropertySlackWebhookUrl() + public function testPropertyExpireAfter() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "path" + * Test attribute "locked" */ - public function testPropertyPath() + public function testPropertyLocked() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "public_web_form" + * Test attribute "expiration_interval" */ - public function testPropertyPublicWebForm() + public function testPropertyExpirationInterval() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "editable_submissions" + * Test attribute "allow_additional_properties" */ - public function testPropertyEditableSubmissions() + public function testPropertyAllowAdditionalProperties() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "expire_submissions" + * Test attribute "editable_submissions" */ - public function testPropertyExpireSubmissions() + public function testPropertyEditableSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "name" + * Test attribute "webhook_url" */ - public function testPropertyName() + public function testPropertyWebhookUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "template_type" + * Test attribute "slack_webhook_url" */ - public function testPropertyTemplateType() + public function testPropertySlackWebhookUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "id" + * Test attribute "redirect_url" */ - public function testPropertyId() + public function testPropertyRedirectUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "locked" + * Test attribute "path" */ - public function testPropertyLocked() + public function testPropertyPath() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "redirect_url" + * Test attribute "parent_folder_id" */ - public function testPropertyRedirectUrl() + public function testPropertyParentFolderId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/RenameFolderDataTest.php b/test/Model/RenameFolderDataTest.php index 155382a..bc80578 100644 --- a/test/Model/RenameFolderDataTest.php +++ b/test/Model/RenameFolderDataTest.php @@ -2,7 +2,7 @@ /** * RenameFolderDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * RenameFolderDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class RenameFolderDataTest extends \PHPUnit_Framework_TestCase +class RenameFolderDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testRenameFolderData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,5 +84,7 @@ public function testRenameFolderData() */ public function testPropertyName() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/SubmissionActionTest.php b/test/Model/SubmissionActionTest.php index 5755a70..7100efa 100644 --- a/test/Model/SubmissionActionTest.php +++ b/test/Model/SubmissionActionTest.php @@ -2,7 +2,7 @@ /** * SubmissionActionTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * SubmissionActionTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class SubmissionActionTest extends \PHPUnit_Framework_TestCase +class SubmissionActionTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testSubmissionAction() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,6 +84,8 @@ public function testSubmissionAction() */ public function testPropertyId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,6 +93,8 @@ public function testPropertyId() */ public function testPropertyIntegrationId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -95,6 +102,8 @@ public function testPropertyIntegrationId() */ public function testPropertyState() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -102,6 +111,8 @@ public function testPropertyState() */ public function testPropertyActionCategory() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -109,6 +120,8 @@ public function testPropertyActionCategory() */ public function testPropertyActionType() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -116,5 +129,7 @@ public function testPropertyActionType() */ public function testPropertyResultData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/SubmissionBatchDataTest.php b/test/Model/SubmissionBatchDataTest.php index f190478..f671f51 100644 --- a/test/Model/SubmissionBatchDataTest.php +++ b/test/Model/SubmissionBatchDataTest.php @@ -2,7 +2,7 @@ /** * SubmissionBatchDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * SubmissionBatchDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class SubmissionBatchDataTest extends \PHPUnit_Framework_TestCase +class SubmissionBatchDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testSubmissionBatchData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,6 +84,8 @@ public function testSubmissionBatchData() */ public function testPropertyMetadata() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,6 +93,8 @@ public function testPropertyMetadata() */ public function testPropertySubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -95,6 +102,8 @@ public function testPropertySubmissions() */ public function testPropertyTemplateId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -102,5 +111,7 @@ public function testPropertyTemplateId() */ public function testPropertyTest() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/SubmissionBatchTest.php b/test/Model/SubmissionBatchTest.php index cf26491..e169791 100644 --- a/test/Model/SubmissionBatchTest.php +++ b/test/Model/SubmissionBatchTest.php @@ -2,7 +2,7 @@ /** * SubmissionBatchTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * SubmissionBatchTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class SubmissionBatchTest extends \PHPUnit_Framework_TestCase +class SubmissionBatchTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,68 +75,88 @@ public static function tearDownAfterClass() */ public function testSubmissionBatch() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "pending_count" + * Test attribute "id" */ - public function testPropertyPendingCount() + public function testPropertyId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "completion_percentage" + * Test attribute "total_count" */ - public function testPropertyCompletionPercentage() + public function testPropertyTotalCount() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "metadata" + * Test attribute "pending_count" */ - public function testPropertyMetadata() + public function testPropertyPendingCount() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "total_count" + * Test attribute "error_count" */ - public function testPropertyTotalCount() + public function testPropertyErrorCount() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "submissions" + * Test attribute "completion_percentage" */ - public function testPropertySubmissions() + public function testPropertyCompletionPercentage() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "processed_at" + * Test attribute "state" */ - public function testPropertyProcessedAt() + public function testPropertyState() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "id" + * Test attribute "processed_at" */ - public function testPropertyId() + public function testPropertyProcessedAt() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "state" + * Test attribute "metadata" */ - public function testPropertyState() + public function testPropertyMetadata() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "error_count" + * Test attribute "submissions" */ - public function testPropertyErrorCount() + public function testPropertySubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/SubmissionDataBatchRequestTest.php b/test/Model/SubmissionDataBatchRequestTest.php index 994be30..bf64874 100644 --- a/test/Model/SubmissionDataBatchRequestTest.php +++ b/test/Model/SubmissionDataBatchRequestTest.php @@ -2,7 +2,7 @@ /** * SubmissionDataBatchRequestTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * SubmissionDataBatchRequestTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class SubmissionDataBatchRequestTest extends \PHPUnit_Framework_TestCase +class SubmissionDataBatchRequestTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testSubmissionDataBatchRequest() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,40 +84,52 @@ public function testSubmissionDataBatchRequest() */ public function testPropertyCss() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "metadata" + * Test attribute "data" */ - public function testPropertyMetadata() + public function testPropertyData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "data" + * Test attribute "html" */ - public function testPropertyData() + public function testPropertyHtml() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "test" + * Test attribute "metadata" */ - public function testPropertyTest() + public function testPropertyMetadata() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "html" + * Test attribute "template_id" */ - public function testPropertyHtml() + public function testPropertyTemplateId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "template_id" + * Test attribute "test" */ - public function testPropertyTemplateId() + public function testPropertyTest() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/SubmissionDataRequestTest.php b/test/Model/SubmissionDataRequestTest.php index d1db167..587bbac 100644 --- a/test/Model/SubmissionDataRequestTest.php +++ b/test/Model/SubmissionDataRequestTest.php @@ -2,7 +2,7 @@ /** * SubmissionDataRequestTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * SubmissionDataRequestTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class SubmissionDataRequestTest extends \PHPUnit_Framework_TestCase +class SubmissionDataRequestTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testSubmissionDataRequest() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,6 +84,8 @@ public function testSubmissionDataRequest() */ public function testPropertyId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,6 +93,8 @@ public function testPropertyId() */ public function testPropertySubmissionId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -95,6 +102,8 @@ public function testPropertySubmissionId() */ public function testPropertyName() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -102,6 +111,8 @@ public function testPropertyName() */ public function testPropertyEmail() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -109,6 +120,8 @@ public function testPropertyEmail() */ public function testPropertyOrder() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -116,6 +129,8 @@ public function testPropertyOrder() */ public function testPropertySortOrder() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -123,6 +138,8 @@ public function testPropertySortOrder() */ public function testPropertyFields() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -130,6 +147,8 @@ public function testPropertyFields() */ public function testPropertyMetadata() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -137,6 +156,8 @@ public function testPropertyMetadata() */ public function testPropertyState() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -144,6 +165,8 @@ public function testPropertyState() */ public function testPropertyViewedAt() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -151,6 +174,8 @@ public function testPropertyViewedAt() */ public function testPropertyCompletedAt() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -158,6 +183,8 @@ public function testPropertyCompletedAt() */ public function testPropertyAuthType() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -165,6 +192,8 @@ public function testPropertyAuthType() */ public function testPropertyAuthSecondFactorType() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -172,6 +201,8 @@ public function testPropertyAuthSecondFactorType() */ public function testPropertyAuthProvider() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -179,6 +210,8 @@ public function testPropertyAuthProvider() */ public function testPropertyAuthSessionStartedAt() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -186,6 +219,8 @@ public function testPropertyAuthSessionStartedAt() */ public function testPropertyAuthSessionIdHash() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -193,6 +228,8 @@ public function testPropertyAuthSessionIdHash() */ public function testPropertyAuthUserIdHash() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -200,6 +237,8 @@ public function testPropertyAuthUserIdHash() */ public function testPropertyAuthUsernameHash() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -207,6 +246,8 @@ public function testPropertyAuthUsernameHash() */ public function testPropertyAuthPhoneNumberHash() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -214,6 +255,8 @@ public function testPropertyAuthPhoneNumberHash() */ public function testPropertyIpAddress() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -221,5 +264,7 @@ public function testPropertyIpAddress() */ public function testPropertyUserAgent() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/SubmissionDataTest.php b/test/Model/SubmissionDataTest.php index 34c23b2..811d719 100644 --- a/test/Model/SubmissionDataTest.php +++ b/test/Model/SubmissionDataTest.php @@ -2,7 +2,7 @@ /** * SubmissionDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * SubmissionDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class SubmissionDataTest extends \PHPUnit_Framework_TestCase +class SubmissionDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testSubmissionData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,6 +84,8 @@ public function testSubmissionData() */ public function testPropertyCss() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,6 +93,8 @@ public function testPropertyCss() */ public function testPropertyData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -95,20 +102,8 @@ public function testPropertyData() */ public function testPropertyDataRequests() { - } - - /** - * Test attribute "expires_in" - */ - public function testPropertyExpiresIn() - { - } - - /** - * Test attribute "field_overrides" - */ - public function testPropertyFieldOverrides() - { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -116,6 +111,8 @@ public function testPropertyFieldOverrides() */ public function testPropertyHtml() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -123,13 +120,8 @@ public function testPropertyHtml() */ public function testPropertyMetadata() { - } - - /** - * Test attribute "password" - */ - public function testPropertyPassword() - { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -137,5 +129,7 @@ public function testPropertyPassword() */ public function testPropertyTest() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/SubmissionTest.php b/test/Model/SubmissionTest.php index 6bceb5a..aa40b92 100644 --- a/test/Model/SubmissionTest.php +++ b/test/Model/SubmissionTest.php @@ -2,7 +2,7 @@ /** * SubmissionTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * SubmissionTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class SubmissionTest extends \PHPUnit_Framework_TestCase +class SubmissionTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testSubmission() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,6 +84,8 @@ public function testSubmission() */ public function testPropertyId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,6 +93,8 @@ public function testPropertyId() */ public function testPropertyTemplateId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -95,6 +102,8 @@ public function testPropertyTemplateId() */ public function testPropertyTest() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -102,6 +111,8 @@ public function testPropertyTest() */ public function testPropertyEditable() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -109,6 +120,8 @@ public function testPropertyEditable() */ public function testPropertyExpired() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -116,6 +129,8 @@ public function testPropertyExpired() */ public function testPropertyExpiresAt() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -123,6 +138,8 @@ public function testPropertyExpiresAt() */ public function testPropertyProcessedAt() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -130,6 +147,8 @@ public function testPropertyProcessedAt() */ public function testPropertyState() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -137,6 +156,8 @@ public function testPropertyState() */ public function testPropertyData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -144,6 +165,8 @@ public function testPropertyData() */ public function testPropertyMetadata() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -151,6 +174,8 @@ public function testPropertyMetadata() */ public function testPropertyTruncatedText() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -158,6 +183,8 @@ public function testPropertyTruncatedText() */ public function testPropertyPdfHash() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -165,6 +192,8 @@ public function testPropertyPdfHash() */ public function testPropertyDownloadUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -172,6 +201,8 @@ public function testPropertyDownloadUrl() */ public function testPropertyPermanentDownloadUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -179,6 +210,8 @@ public function testPropertyPermanentDownloadUrl() */ public function testPropertyBatchId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -186,6 +219,8 @@ public function testPropertyBatchId() */ public function testPropertyDataRequests() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -193,6 +228,8 @@ public function testPropertyDataRequests() */ public function testPropertyActions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -200,6 +237,8 @@ public function testPropertyActions() */ public function testPropertySource() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -207,5 +246,7 @@ public function testPropertySource() */ public function testPropertyReferrer() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/TemplateDataTest.php b/test/Model/TemplateDataTest.php index ca3cdf1..1987316 100644 --- a/test/Model/TemplateDataTest.php +++ b/test/Model/TemplateDataTest.php @@ -2,7 +2,7 @@ /** * TemplateDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * TemplateDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class TemplateDataTest extends \PHPUnit_Framework_TestCase +class TemplateDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,34 +75,44 @@ public static function tearDownAfterClass() */ public function testTemplateData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "expiration_interval" + * Test attribute "allow_additional_properties" */ - public function testPropertyExpirationInterval() + public function testPropertyAllowAdditionalProperties() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "webhook_url" + * Test attribute "description" */ - public function testPropertyWebhookUrl() + public function testPropertyDescription() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "scss" + * Test attribute "editable_submissions" */ - public function testPropertyScss() + public function testPropertyEditableSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "allow_additional_properties" + * Test attribute "expiration_interval" */ - public function testPropertyAllowAdditionalProperties() + public function testPropertyExpirationInterval() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -109,82 +120,106 @@ public function testPropertyAllowAdditionalProperties() */ public function testPropertyExpireAfter() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "description" + * Test attribute "expire_submissions" */ - public function testPropertyDescription() + public function testPropertyExpireSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "public_submissions" + * Test attribute "footer_html" */ - public function testPropertyPublicSubmissions() + public function testPropertyFooterHtml() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "slack_webhook_url" + * Test attribute "header_html" */ - public function testPropertySlackWebhookUrl() + public function testPropertyHeaderHtml() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "header_html" + * Test attribute "html" */ - public function testPropertyHeaderHtml() + public function testPropertyHtml() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "public_web_form" + * Test attribute "name" */ - public function testPropertyPublicWebForm() + public function testPropertyName() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "editable_submissions" + * Test attribute "public_submissions" */ - public function testPropertyEditableSubmissions() + public function testPropertyPublicSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "expire_submissions" + * Test attribute "public_web_form" */ - public function testPropertyExpireSubmissions() + public function testPropertyPublicWebForm() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "name" + * Test attribute "redirect_url" */ - public function testPropertyName() + public function testPropertyRedirectUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "footer_html" + * Test attribute "scss" */ - public function testPropertyFooterHtml() + public function testPropertyScss() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "html" + * Test attribute "slack_webhook_url" */ - public function testPropertyHtml() + public function testPropertySlackWebhookUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "redirect_url" + * Test attribute "webhook_url" */ - public function testPropertyRedirectUrl() + public function testPropertyWebhookUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/FullTemplateDefaultsTest.php b/test/Model/TemplateDefaultsTest.php similarity index 58% rename from test/Model/FullTemplateDefaultsTest.php rename to test/Model/TemplateDefaultsTest.php index a462d37..68329e7 100644 --- a/test/Model/FullTemplateDefaultsTest.php +++ b/test/Model/TemplateDefaultsTest.php @@ -1,8 +1,8 @@ markTestIncomplete('Not implemented'); } /** @@ -81,6 +84,8 @@ public function testFullTemplateDefaults() */ public function testPropertyColor() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,6 +93,8 @@ public function testPropertyColor() */ public function testPropertyFontSize() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -95,5 +102,7 @@ public function testPropertyFontSize() */ public function testPropertyTypeface() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/UploadTemplateDataDocumentMetadataTest.php b/test/Model/TemplateDocumentMetadataTest.php similarity index 57% rename from test/Model/UploadTemplateDataDocumentMetadataTest.php rename to test/Model/TemplateDocumentMetadataTest.php index 98c250a..212a116 100644 --- a/test/Model/UploadTemplateDataDocumentMetadataTest.php +++ b/test/Model/TemplateDocumentMetadataTest.php @@ -1,8 +1,8 @@ markTestIncomplete('Not implemented'); } /** @@ -81,19 +84,25 @@ public function testUploadTemplateDataDocumentMetadata() */ public function testPropertyFilename() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "size" + * Test attribute "mime_type" */ - public function testPropertySize() + public function testPropertyMimeType() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "mime_type" + * Test attribute "size" */ - public function testPropertyMimeType() + public function testPropertySize() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/UploadTemplateDataDocumentTest.php b/test/Model/TemplateDocumentTest.php similarity index 58% rename from test/Model/UploadTemplateDataDocumentTest.php rename to test/Model/TemplateDocumentTest.php index 9e12e83..9a3f5d6 100644 --- a/test/Model/UploadTemplateDataDocumentTest.php +++ b/test/Model/TemplateDocumentTest.php @@ -1,8 +1,8 @@ markTestIncomplete('Not implemented'); } /** - * Test attribute "metadata" + * Test attribute "id" */ - public function testPropertyMetadata() + public function testPropertyId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "id" + * Test attribute "metadata" */ - public function testPropertyId() + public function testPropertyMetadata() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -95,5 +102,7 @@ public function testPropertyId() */ public function testPropertyStorage() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/TemplateTest.php b/test/Model/TemplateTest.php index f13aeb6..8df0085 100644 --- a/test/Model/TemplateTest.php +++ b/test/Model/TemplateTest.php @@ -2,7 +2,7 @@ /** * TemplateTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * TemplateTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class TemplateTest extends \PHPUnit_Framework_TestCase +class TemplateTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,104 +75,134 @@ public static function tearDownAfterClass() */ public function testTemplate() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "expiration_interval" + * Test attribute "name" */ - public function testPropertyExpirationInterval() + public function testPropertyName() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "webhook_url" + * Test attribute "description" */ - public function testPropertyWebhookUrl() + public function testPropertyDescription() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "parent_folder_id" + * Test attribute "public_web_form" */ - public function testPropertyParentFolderId() + public function testPropertyPublicWebForm() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "expire_after" + * Test attribute "public_submissions" */ - public function testPropertyExpireAfter() + public function testPropertyPublicSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "allow_additional_properties" + * Test attribute "expire_submissions" */ - public function testPropertyAllowAdditionalProperties() + public function testPropertyExpireSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "description" + * Test attribute "expire_after" */ - public function testPropertyDescription() + public function testPropertyExpireAfter() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "public_submissions" + * Test attribute "expiration_interval" */ - public function testPropertyPublicSubmissions() + public function testPropertyExpirationInterval() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "slack_webhook_url" + * Test attribute "allow_additional_properties" */ - public function testPropertySlackWebhookUrl() + public function testPropertyAllowAdditionalProperties() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "path" + * Test attribute "editable_submissions" */ - public function testPropertyPath() + public function testPropertyEditableSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "public_web_form" + * Test attribute "locked" */ - public function testPropertyPublicWebForm() + public function testPropertyLocked() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "editable_submissions" + * Test attribute "webhook_url" */ - public function testPropertyEditableSubmissions() + public function testPropertyWebhookUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "expire_submissions" + * Test attribute "slack_webhook_url" */ - public function testPropertyExpireSubmissions() + public function testPropertySlackWebhookUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "name" + * Test attribute "redirect_url" */ - public function testPropertyName() + public function testPropertyRedirectUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "permanent_document_url" + * Test attribute "id" */ - public function testPropertyPermanentDocumentUrl() + public function testPropertyId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -179,40 +210,52 @@ public function testPropertyPermanentDocumentUrl() */ public function testPropertyTemplateType() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "id" + * Test attribute "page_dimensions" */ - public function testPropertyId() + public function testPropertyPageDimensions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "page_dimensions" + * Test attribute "document_url" */ - public function testPropertyPageDimensions() + public function testPropertyDocumentUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "locked" + * Test attribute "permanent_document_url" */ - public function testPropertyLocked() + public function testPropertyPermanentDocumentUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "redirect_url" + * Test attribute "path" */ - public function testPropertyRedirectUrl() + public function testPropertyPath() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "document_url" + * Test attribute "parent_folder_id" */ - public function testPropertyDocumentUrl() + public function testPropertyParentFolderId() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/TemplatestemplateIdaddFieldsFieldsTest.php b/test/Model/TemplatestemplateIdaddFieldsFieldsTest.php deleted file mode 100644 index fb8710e..0000000 --- a/test/Model/TemplatestemplateIdaddFieldsFieldsTest.php +++ /dev/null @@ -1,680 +0,0 @@ -markTestIncomplete('Not implemented'); } /** - * Test attribute "data_request" + * Test attribute "status" */ - public function testPropertyDataRequest() + public function testPropertyStatus() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,12 +93,16 @@ public function testPropertyDataRequest() */ public function testPropertyErrors() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "status" + * Test attribute "data_request" */ - public function testPropertyStatus() + public function testPropertyDataRequest() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/UpdateSubmissionDataRequestDataTest.php b/test/Model/UpdateSubmissionDataRequestDataTest.php index f38c761..9795b5c 100644 --- a/test/Model/UpdateSubmissionDataRequestDataTest.php +++ b/test/Model/UpdateSubmissionDataRequestDataTest.php @@ -2,7 +2,7 @@ /** * UpdateSubmissionDataRequestDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * UpdateSubmissionDataRequestDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class UpdateSubmissionDataRequestDataTest extends \PHPUnit_Framework_TestCase +class UpdateSubmissionDataRequestDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testUpdateSubmissionDataRequestData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,6 +84,8 @@ public function testUpdateSubmissionDataRequestData() */ public function testPropertyAuthPhoneNumberHash() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -88,6 +93,8 @@ public function testPropertyAuthPhoneNumberHash() */ public function testPropertyAuthProvider() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -95,6 +102,8 @@ public function testPropertyAuthProvider() */ public function testPropertyAuthSecondFactorType() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -102,6 +111,8 @@ public function testPropertyAuthSecondFactorType() */ public function testPropertyAuthSessionIdHash() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -109,6 +120,8 @@ public function testPropertyAuthSessionIdHash() */ public function testPropertyAuthSessionStartedAt() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -116,6 +129,8 @@ public function testPropertyAuthSessionStartedAt() */ public function testPropertyAuthType() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -123,6 +138,8 @@ public function testPropertyAuthType() */ public function testPropertyAuthUserIdHash() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -130,6 +147,8 @@ public function testPropertyAuthUserIdHash() */ public function testPropertyAuthUsernameHash() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -137,6 +156,8 @@ public function testPropertyAuthUsernameHash() */ public function testPropertyEmail() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -144,6 +165,8 @@ public function testPropertyEmail() */ public function testPropertyFields() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -151,6 +174,8 @@ public function testPropertyFields() */ public function testPropertyMetadata() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -158,6 +183,8 @@ public function testPropertyMetadata() */ public function testPropertyName() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -165,5 +192,7 @@ public function testPropertyName() */ public function testPropertyOrder() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/UpdateTemplateDataTest.php b/test/Model/UpdateTemplateDataTest.php index 10f533f..2ed8d7e 100644 --- a/test/Model/UpdateTemplateDataTest.php +++ b/test/Model/UpdateTemplateDataTest.php @@ -2,7 +2,7 @@ /** * UpdateTemplateDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * UpdateTemplateDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class UpdateTemplateDataTest extends \PHPUnit_Framework_TestCase +class UpdateTemplateDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,6 +75,8 @@ public static function tearDownAfterClass() */ public function testUpdateTemplateData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -81,5 +84,7 @@ public function testUpdateTemplateData() */ public function testPropertyTemplate() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/UpdateTemplateResponseTest.php b/test/Model/UpdateTemplateResponseTest.php index b14e628..a5004d3 100644 --- a/test/Model/UpdateTemplateResponseTest.php +++ b/test/Model/UpdateTemplateResponseTest.php @@ -2,7 +2,7 @@ /** * UpdateTemplateResponseTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * UpdateTemplateResponseTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class UpdateTemplateResponseTest extends \PHPUnit_Framework_TestCase +class UpdateTemplateResponseTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,19 +75,25 @@ public static function tearDownAfterClass() */ public function testUpdateTemplateResponse() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "errors" + * Test attribute "status" */ - public function testPropertyErrors() + public function testPropertyStatus() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "status" + * Test attribute "errors" */ - public function testPropertyStatus() + public function testPropertyErrors() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Model/UploadTemplateDataTest.php b/test/Model/UploadTemplateDataTest.php index c6e9a5e..10e8b8f 100644 --- a/test/Model/UploadTemplateDataTest.php +++ b/test/Model/UploadTemplateDataTest.php @@ -2,7 +2,7 @@ /** * UploadTemplateDataTest * - * PHP version 5 + * PHP version 7.4 * * @category Class * @package DocSpring @@ -15,10 +15,9 @@ * * DocSpring is a service that helps you fill out and sign PDF templates. * - * OpenAPI spec version: v1 - * + * The version of the OpenAPI document: v1 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 3.3.0 + * OpenAPI Generator version: 7.1.0 */ /** @@ -27,7 +26,9 @@ * Please update the test case below to test the model. */ -namespace DocSpring; +namespace DocSpring\Test\Model; + +use PHPUnit\Framework\TestCase; /** * UploadTemplateDataTest Class Doc Comment @@ -38,34 +39,34 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class UploadTemplateDataTest extends \PHPUnit_Framework_TestCase +class UploadTemplateDataTest extends TestCase { /** * Setup before running any test case */ - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { } /** * Setup before running each test case */ - public function setUp() + public function setUp(): void { } /** * Clean up after running each test case */ - public function tearDown() + public function tearDown(): void { } /** * Clean up after running all test cases */ - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { } @@ -74,41 +75,53 @@ public static function tearDownAfterClass() */ public function testUploadTemplateData() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "expiration_interval" + * Test attribute "allow_additional_properties" */ - public function testPropertyExpirationInterval() + public function testPropertyAllowAdditionalProperties() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "webhook_url" + * Test attribute "description" */ - public function testPropertyWebhookUrl() + public function testPropertyDescription() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "scss" + * Test attribute "document" */ - public function testPropertyScss() + public function testPropertyDocument() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "allow_additional_properties" + * Test attribute "editable_submissions" */ - public function testPropertyAllowAdditionalProperties() + public function testPropertyEditableSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "document" + * Test attribute "expiration_interval" */ - public function testPropertyDocument() + public function testPropertyExpirationInterval() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -116,76 +129,98 @@ public function testPropertyDocument() */ public function testPropertyExpireAfter() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "description" + * Test attribute "expire_submissions" */ - public function testPropertyDescription() + public function testPropertyExpireSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "public_submissions" + * Test attribute "footer_html" */ - public function testPropertyPublicSubmissions() + public function testPropertyFooterHtml() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "slack_webhook_url" + * Test attribute "header_html" */ - public function testPropertySlackWebhookUrl() + public function testPropertyHeaderHtml() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "header_html" + * Test attribute "html" */ - public function testPropertyHeaderHtml() + public function testPropertyHtml() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "public_web_form" + * Test attribute "name" */ - public function testPropertyPublicWebForm() + public function testPropertyName() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "editable_submissions" + * Test attribute "public_submissions" */ - public function testPropertyEditableSubmissions() + public function testPropertyPublicSubmissions() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "expire_submissions" + * Test attribute "public_web_form" */ - public function testPropertyExpireSubmissions() + public function testPropertyPublicWebForm() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "name" + * Test attribute "redirect_url" */ - public function testPropertyName() + public function testPropertyRedirectUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "footer_html" + * Test attribute "scss" */ - public function testPropertyFooterHtml() + public function testPropertyScss() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "html" + * Test attribute "slack_webhook_url" */ - public function testPropertyHtml() + public function testPropertySlackWebhookUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -193,12 +228,16 @@ public function testPropertyHtml() */ public function testPropertyTemplateType() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test attribute "redirect_url" + * Test attribute "webhook_url" */ - public function testPropertyRedirectUrl() + public function testPropertyWebhookUrl() { + // TODO: implement + $this->markTestIncomplete('Not implemented'); } }